forked from raexera/yoru
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rxyhn
committed
May 31, 2022
1 parent
e8bbd88
commit 027c111
Showing
22 changed files
with
487 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
local awful = require("awful") | ||
local filesystem = require("gears.filesystem") | ||
local config_dir = filesystem.get_configuration_dir() | ||
|
||
local function run_once_pgrep(cmd) | ||
local findme = cmd | ||
local firstspace = cmd:find(" ") | ||
if firstspace then | ||
findme = cmd:sub(0, firstspace - 1) | ||
end | ||
awful.spawn.easy_async_with_shell(string.format("pgrep -u $USER -x %s > /dev/null || (%s)", findme, cmd)) | ||
end | ||
|
||
local function run_once_ps(findme, cmd) | ||
awful.spawn.easy_async_with_shell(string.format("ps -C %s|wc -l", findme), function(stdout) | ||
if tonumber(stdout) ~= 2 then | ||
awful.spawn(cmd, false) | ||
end | ||
end) | ||
end | ||
|
||
local function run_once_grep(command) | ||
awful.spawn.easy_async_with_shell(string.format("ps aux | grep '%s' | grep -v 'grep'", command), function(stdout) | ||
if stdout == "" or stdout == nil then | ||
awful.spawn(command, false) | ||
end | ||
end) | ||
end | ||
|
||
-- List of apps to start once on start-up | ||
local autostart_app = { | ||
-- Compositor | ||
"picom -b --experimental-backends --config " .. config_dir .. "/configuration/picom.conf", | ||
-- Music server | ||
"mpd", | ||
-- Playertctl support for mpd | ||
"mpDris2", | ||
} | ||
|
||
for _, app in ipairs(autostart_app) do | ||
run_once_pgrep(app) | ||
end | ||
|
||
-- Polkit and keyring | ||
run_once_ps("polkit-gnome-authentication-agent-1", "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1") | ||
|
||
-- Bluetooth | ||
run_once_grep("blueman-applet") | ||
|
||
-- Network Manager | ||
run_once_grep("nm-applet") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.