From 2e1b0451ffbb789230f575d00e0741826a1a80fb Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 14 Apr 2024 15:40:03 +0200 Subject: Start startup apps within awesome rc.lua --- awesome/default.nix | 9 ++++++--- awesome/rc.lua | 14 +++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'awesome') diff --git a/awesome/default.nix b/awesome/default.nix index 3c47017..5baaf95 100644 --- a/awesome/default.nix +++ b/awesome/default.nix @@ -48,12 +48,15 @@ EOF ''; wp = ../wallpapers; - - dirsLua = pkgs.writeTextDir "dirs.lua" '' + startupAppsLua = builtins.toString ( + builtins.map (a: ''"${a}",'') config.awesome.startupApps + ); + configLua = pkgs.writeTextDir "config.lua" '' home_dir = os.getenv("HOME").."/" bin_dir = "${./bin}/" share_dir = "${./share}/" wp_dir = "${wp}/" + startupApps = { ${startupAppsLua} } ''; # awesomeInner is what is started up by startx, within an X session. @@ -94,7 +97,7 @@ EOF exec ${pkgs.awesome}/bin/awesome \ -c ${./rc.lua} \ - --search ${dirsLua} \ + --search ${configLua} \ --search ${./share} \ --search ${pkgs.awesome}/share/awesome/themes \ 2>&1 2>>$this_log diff --git a/awesome/rc.lua b/awesome/rc.lua index 3abbb2c..5cb6c7f 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -17,7 +17,7 @@ local function info(msg) naughty.notify({ text = msg }) end -require("dirs") +require("config") require("pulseaudio") muteAll() -- pre-emptively mute all mics, just in-case @@ -514,3 +514,15 @@ end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} + +-- {{{ Startup Apps +local tty_cmd = io.popen("tty") +local tty = tty_cmd:read() +tty_cmd:close() + +if tty == "/dev/tty1" then + for app = 1, #startupApps do + awful.util.spawn(startupApps[app]) + end +end +-- }}} -- cgit v1.2.3