From 7cd8108298d1e60f7146579cf7a98d9e9d676fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 22 Oct 2023 17:47:08 +0200 Subject: [PATCH] Try to fix timer --- awesome/rc.lua | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index 45ebadd..4bf4d90 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -2,8 +2,6 @@ local gears = require("gears") local awful = require("awful") local beautiful = require("beautiful") - - -- Local imports local grid = require("components.layout.grid") @@ -18,6 +16,18 @@ require("utils.signals") -- Autofocus a new client when previously focused one is closed require("awful.autofocus") +-- Define layouts +awful.layout.append_default_layouts({ + awful.layout.suit.tile, + awful.layout.suit.floating, + grid.horizontal, + awful.layout.suit.fair.horizontal, + awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile.top, + grid, +}) + -- List of apps to run on start-up local run_on_start_up = { @@ -28,18 +38,6 @@ local run_on_start_up = { "feh --no-fehbg --bg-fill " .. gears.filesystem.get_configuration_dir() .. "/images/wallpaper.png", } --- Define layouts -awful.layout.layouts = { - awful.layout.suit.tile, - awful.layout.suit.floating, - grid.horizontal, - awful.layout.suit.fair.horizontal, - awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, - awful.layout.suit.tile.top, - grid, -} - -- Run all the apps listed in run_on_start_up for _, app in ipairs(run_on_start_up) do local findme = app @@ -48,7 +46,7 @@ for _, app in ipairs(run_on_start_up) do findme = app:sub(0, firstspace - 1) end -- Run commands only if it's not already running. - awful.spawn.with_shell(string.format("echo 'pgrep -u $USER -x %s > /dev/null || (%s)' | bash -", findme, app), false) + awful.spawn.with_shell(string.format("echo 'pgrep -f -u $USER -x %s > /dev/null || (%s)' | bash -", findme, app), false) end -- Start timers @@ -57,7 +55,7 @@ gears.timer { call_now = true, autostart = true, callback = function() - awful.spawn.with_shell({"xmodmap", "/home/user/.Xmodmap"}) -- If not repeated it sometimes just stops working + awful.spawn({"xmodmap", "/home/user/.Xmodmap"}) -- If not repeated it sometimes just stops working end }