mirror of
https://github.com/lcpz/lain.git
synced 2026-09-10 07:26:24 -04:00
Fix issue for GIO - Fs widget not working (#564)
* Fix issue for GIO * support both versions
This commit is contained in:
parent
88f5a8abd2
commit
9f350d95a1
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
local helpers = require("lain.helpers")
|
||||
local Gio = require("lgi").Gio
|
||||
local GioUnix = require("lgi").GioUnix
|
||||
local focused = require("awful.screen").focused
|
||||
local wibox = require("wibox")
|
||||
local naughty = require("naughty")
|
||||
|
|
@ -76,8 +77,19 @@ local function factory(args)
|
|||
fs_now = {}
|
||||
|
||||
local notifypaths = {}
|
||||
for _, mount in ipairs(Gio.unix_mounts_get()) do
|
||||
local path = Gio.unix_mount_get_mount_path(mount)
|
||||
|
||||
local mounts_get
|
||||
local mount_get_mount_path
|
||||
pcall(function()
|
||||
mounts_get = GioUnix.mounts_get
|
||||
mount_get_mount_path = GioUnix.mount_get_mount_path
|
||||
end)
|
||||
if not mounts_get then
|
||||
mounts_get = Gio.unix_mounts_get
|
||||
mount_get_mount_path = Gio.unix_mount_get_mount_path
|
||||
end
|
||||
for _, mount in ipairs(mounts_get()) do
|
||||
local path = mount_get_mount_path(mount)
|
||||
local root = Gio.File.new_for_path(path)
|
||||
local info = root:query_filesystem_info(query)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue