chore: moved hotkey daemon to it's own script and run with a terminal to allow prompting authentication

This commit is contained in:
2024-08-27 21:42:29 +02:00
parent 443b6c5dfe
commit 85a1c3b469
5 changed files with 27 additions and 9 deletions

17
bin/actions/hotkey-daemon.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
source $HOME/dotfiles/bin/helpers/functions.sh
# Kill any running swhkd and swhks processes
if pgrep -x "swhkd" > /dev/null; then
printfe "%s\n" "yellow" "swhkd is running, killing it..."
sudo pkill swhkd
fi
if pgrep -x "swhks" > /dev/null; then
printfe "%s\n" "yellow" "swhks is running, killing it..."
sudo pkill swhks
fi
printfe "%s\n" "green" "Starting hotkey daemon..."
swhks & pkexec swhkd -c ~/.config/swhkdrc

View File

@ -18,15 +18,18 @@ run_startup_scripts() {
case $(date +%H) in case $(date +%H) in
0[0-9]|1[0-1]) 0[0-9]|1[0-1])
time_of_day="morning" time_of_day="morning"
emoji="🌅"
;; ;;
1[2-7]) 1[2-7])
time_of_day="afternoon" time_of_day="afternoon"
emoji="🌞"
;; ;;
1[8-9]|2[0-3]) 1[8-9]|2[0-3])
time_of_day="evening" time_of_day="evening"
emoji="🌆"
;; ;;
esac esac
printfe "%s" "cyan" "Welcome and good $time_of_day $(whoami)!" printfe "%s" "cyan" "Hi $(whoami), good $time_of_day! $emoji"
echo "" echo ""
# Initialize array to hold commands # Initialize array to hold commands

View File

@ -79,7 +79,7 @@ case $1 in
$HOME/dotfiles/bin/actions/term.sh $@ $HOME/dotfiles/bin/actions/term.sh $@
;; ;;
"hotkey-daemon") "hotkey-daemon")
bash -c "swhks & pkexec swhkd -c ~/.config/swhkdrc" & x-terminal-emulator -e $HOME/dotfiles/bin/actions/hotkey-daemon.sh $@
;; ;;
*) *)
printfe "%s\n" "red" "Unknown command $1" printfe "%s\n" "red" "Unknown command $1"

View File

@ -79,18 +79,16 @@ config:
# Commands to run after login # Commands to run after login
startup: startup:
delay: 1 delay: 5
delay_between_ms: 500 delay_between_ms: 1
commands: commands:
1password: 1password 1password: 1password
hotkey-deamon: dotf hotkey-daemon hotkey-deamon: dotf hotkey-daemon
# Might want to run steam in flatpak at some point: flatpak run com.valvesoftware.Steam
# Not possible at this point due to avorion needing workshop mods symlinked
steam: steam
trayscale: flatpak run dev.deedles.Trayscale trayscale: flatpak run dev.deedles.Trayscale
spotify: flatpak run com.spotify.Client
vesktop: flatpak run dev.vencord.Vesktop vesktop: flatpak run dev.vencord.Vesktop
telegram: flatpak run org.telegram.desktop telegram: flatpak run org.telegram.desktop
spotify: flatpak run com.spotify.Client
steam: steam
# Fonts to install (Mostly tested with Nerd Fonts) # Fonts to install (Mostly tested with Nerd Fonts)
fonts: fonts:

View File

@ -1,3 +1,3 @@
{ {
"enable-crash-reporter": false, "enable-crash-reporter": true,
} }