Merge pull request #2216 from psychon/deprecate-get_dir
Deprecate gears.filesystem.get_dir
This commit is contained in:
commit
356d730b7d
|
@ -71,7 +71,7 @@ Awesome has four themes you can choose from: *default*, *sky*, *xresources*, and
|
||||||
To change the theme, open your rc.lua and edit this line near the beginning of
|
To change the theme, open your rc.lua and edit this line near the beginning of
|
||||||
the file:
|
the file:
|
||||||
|
|
||||||
beautiful.init(gears.filesystem.get_dir("config") .. "/themes/default/theme.lua")
|
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
||||||
|
|
||||||
For this tutorial we will stick with the default theme.
|
For this tutorial we will stick with the default theme.
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ require("sample_files")(
|
||||||
--
|
--
|
||||||
-- with
|
-- with
|
||||||
--
|
--
|
||||||
-- beautiful.init(gears.filesystem.get_dir("config") .. "mytheme.lua")
|
-- beautiful.init(gears.filesystem.get_configuration_dir() .. "mytheme.lua")
|
||||||
--
|
--
|
||||||
-- in your `rc.lua`.
|
-- in your `rc.lua`.
|
||||||
--
|
--
|
||||||
|
|
|
@ -145,8 +145,10 @@ function filesystem.get_dir(d)
|
||||||
if d == "config" then
|
if d == "config" then
|
||||||
-- No idea why this is what is returned, I recommend everyone to use
|
-- No idea why this is what is returned, I recommend everyone to use
|
||||||
-- get_configuration_dir() instead
|
-- get_configuration_dir() instead
|
||||||
|
require("gears.debug").deprecate("gears.filesystem.get_xdg_config_home() .. 'awesome/'", {deprecated_in=5})
|
||||||
return filesystem.get_xdg_config_home() .. "awesome/"
|
return filesystem.get_xdg_config_home() .. "awesome/"
|
||||||
elseif d == "cache" then
|
elseif d == "cache" then
|
||||||
|
require("gears.debug").deprecate("gears.filesystem.get_cache_dir", {deprecated_in=5})
|
||||||
return filesystem.get_cache_dir()
|
return filesystem.get_cache_dir()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -130,7 +130,7 @@ local function load_count_table()
|
||||||
return instance.count_table
|
return instance.count_table
|
||||||
end
|
end
|
||||||
instance.count_table = {}
|
instance.count_table = {}
|
||||||
local count_file_name = gfs.get_dir("cache") .. "/menu_count_file"
|
local count_file_name = gfs.get_cache_dir() .. "/menu_count_file"
|
||||||
local count_file = io.open (count_file_name, "r")
|
local count_file = io.open (count_file_name, "r")
|
||||||
if count_file then
|
if count_file then
|
||||||
for line in count_file:lines() do
|
for line in count_file:lines() do
|
||||||
|
@ -146,7 +146,7 @@ end
|
||||||
|
|
||||||
local function write_count_table(count_table)
|
local function write_count_table(count_table)
|
||||||
count_table = count_table or instance.count_table
|
count_table = count_table or instance.count_table
|
||||||
local count_file_name = gfs.get_dir("cache") .. "/menu_count_file"
|
local count_file_name = gfs.get_cache_dir() .. "/menu_count_file"
|
||||||
local count_file = assert(io.open(count_file_name, "w"))
|
local count_file = assert(io.open(count_file_name, "w"))
|
||||||
for name, count in pairs(count_table) do
|
for name, count in pairs(count_table) do
|
||||||
local str = string.format("%s;%d\n", name, count)
|
local str = string.format("%s;%d\n", name, count)
|
||||||
|
|
|
@ -54,7 +54,7 @@ local gfs = require("gears.filesystem") --DOC_HIDE
|
||||||
prompt = "<b>Run: </b>",
|
prompt = "<b>Run: </b>",
|
||||||
hooks = hooks,
|
hooks = hooks,
|
||||||
textbox = atextbox,
|
textbox = atextbox,
|
||||||
history_path = gfs.get_dir("cache") .. "/history",
|
history_path = gfs.get_cache_dir() .. "/history",
|
||||||
done_callback = clear,
|
done_callback = clear,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ local naughty = {} --DOC_HIDE
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
textbox = atextbox,
|
textbox = atextbox,
|
||||||
history_path = gfs.get_dir("cache") .. "/history",
|
history_path = gfs.get_cache_dir() .. "/history",
|
||||||
}
|
}
|
||||||
|
|
||||||
parent:add( wibox.widget { --DOC_HIDE
|
parent:add( wibox.widget { --DOC_HIDE
|
||||||
|
|
|
@ -44,7 +44,7 @@ local terminal = "xterm" --DOC_HIDE
|
||||||
end},
|
end},
|
||||||
},
|
},
|
||||||
textbox = atextbox,
|
textbox = atextbox,
|
||||||
history_path = gfs.get_dir('cache') .. '/history',
|
history_path = gfs.get_cache_dir() .. '/history',
|
||||||
exe_callback = function(cmd) awful.spawn(cmd) end
|
exe_callback = function(cmd) awful.spawn(cmd) end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue