Use XDG_CONFIG_HOME

This commit is contained in:
Thomas Avé 2022-08-06 17:21:13 +02:00
parent 33cd4712cf
commit 4bf8c9f9eb
2 changed files with 5 additions and 10 deletions

View File

@ -123,7 +123,7 @@ keys.globalkeys = gears.table.join(
function() function()
local c = client.focus local c = client.focus
if c and c.class == "Alacritty" then if c and c.class == "Alacritty" then
awful.spawn(string.format("/home/user/.config/awesome/scripts/launch_alacritty.sh %d", c.pid)) awful.spawn(string.format(os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/launch_alacritty.sh %d", c.pid))
else else
awful.spawn(apps.terminal) awful.spawn(apps.terminal)
end end
@ -147,14 +147,14 @@ keys.globalkeys = gears.table.join(
-- launch rofi -- launch rofi
awful.key({modkey}, "XF86Launch5", awful.key({modkey}, "XF86Launch5",
function() function()
awful.spawn("/home/user/.config/awesome/scripts/toggle_rofi.sh") awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "awesome/scripts/toggle_rofi.sh")
end, end,
{description = "application launcher", group = "launcher"} {description = "application launcher", group = "launcher"}
), ),
-- launch rofi -- launch rofi
awful.key({modkey}, "d", awful.key({modkey}, "d",
function() function()
awful.spawn("/home/user/.config/awesome/scripts/toggle_rofi.sh") awful.spawn(os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/toggle_rofi.sh")
end, end,
{description = "application launcher", group = "launcher"} {description = "application launcher", group = "launcher"}
), ),
@ -246,7 +246,7 @@ keys.globalkeys = gears.table.join(
awful.key({modkey}, "Escape", awful.key({modkey}, "Escape",
function() function()
-- emit signal to show the exit screen -- emit signal to show the exit screen
awful.util.spawn("rofi -show power-menu -modi power-menu:~/.config/awesome/scripts/rofi-power-menu") awful.util.spawn("rofi -show power-menu -modi power-menu:" .. os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/rofi-power-menu")
end, end,
{description = "toggle exit screen", group = "hotkeys"} {description = "toggle exit screen", group = "hotkeys"}
), ),

View File

@ -18,13 +18,8 @@ local awful = require("awful")
-- define default apps (global variable so other components can access it) -- define default apps (global variable so other components can access it)
apps = { apps = {
network_manager = "nm-connection-editor", -- recommended: nm-connection-editor
power_manager = "", -- recommended: xfce4-power-manager
terminal = 'bash -c "WINIT_X11_SCALE_FACTOR=1 alacritty"',
launcher = "/home/user/.toggle_rofi.sh",
lock = "i3lock", lock = "i3lock",
screenshot = "scrot -e 'mv $f ~/Pictures/Screenshots/ 2>/dev/null'", screenshot = "scrot -e 'mv $f ~/Pictures/Screenshots/ 2>/dev/null'",
filebrowser = "nautilus"
} }
-- List of apps to run on start-up -- List of apps to run on start-up
@ -32,7 +27,7 @@ local run_on_start_up = {
"numlockx on", "numlockx on",
"nm-applet", "nm-applet",
"xcape -e \"Super_L=Super_L|XF86Launch5\" -t 5000", "xcape -e \"Super_L=Super_L|XF86Launch5\" -t 5000",
"/home/user/.config/awesome/scripts/setup_display.sh", os.getenv("XDG_CONFIG_HOME") .. "/awesome/scripts/setup_display.sh",
"xmodmap /home/user/.Xmodmap" "xmodmap /home/user/.Xmodmap"
} }