diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-24 17:01:34 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-24 17:01:34 +0200 |
commit | 677fb02e3430c94ac113cf15eba4b72073605e50 (patch) | |
tree | 3f30dde1e6e132104897ac8654c8a7dca33cfb92 /.config | |
parent | In progress (diff) | |
download | dotfiles-bsd-677fb02e3430c94ac113cf15eba4b72073605e50.tar.gz dotfiles-bsd-677fb02e3430c94ac113cf15eba4b72073605e50.tar.bz2 dotfiles-bsd-677fb02e3430c94ac113cf15eba4b72073605e50.tar.xz dotfiles-bsd-677fb02e3430c94ac113cf15eba4b72073605e50.tar.zst dotfiles-bsd-677fb02e3430c94ac113cf15eba4b72073605e50.zip |
Better sxhkd handling
Diffstat (limited to '.config')
-rwxr-xr-x | .config/bspwm/bspwmrc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 2f4f677..426e976 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -7,6 +7,7 @@ use Time::HiRes; use WWW::Curl::Easy; use constant { + DASH_PATH => '/usr/local/bin/dash', SXHKD_PATH => '/usr/local/bin/sxhkd', PGREP_PATH => '/bin/pgrep', PKILL_PATH => '/bin/pkill', @@ -56,7 +57,12 @@ sub run_if_dead my $bin; my $pid; - $bin = $argv[0]; + if ($argv[0] =~ /SXHKD_SHELL/) { + $bin = $argv[1]; + } + else { + $bin = $argv[0]; + } $bin =~ s/.+\///g; my (undef, undef, $retval) = capture { system( @@ -68,8 +74,14 @@ sub run_if_dead if ($retval != 0) { $pid = fork(); if (not $pid) { - exec(@argv); - exit; + if ($argv[0] =~ /SXHKD_SHELL/) { + exec($argv[0] . ' ' . $argv[1]); + exit; + } + else { + exec(@argv); + exit; + } } } return; @@ -131,7 +143,7 @@ sub bspc_rules sub run_bg_programs { - run_if_dead(SXHKD_PATH); + run_if_dead('SXHKD_SHELL=' . DASH_PATH, SXHKD_PATH); run_if_dead(COMPTON_PATH); run_if_dead(DUNST_PATH); run_if_dead(LOWBAT_PATH); |