summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormajamin <45718559+majamin@users.noreply.github.com>2020-10-22 11:27:50 -0700
committerGitHub <noreply@github.com>2020-10-22 14:27:50 -0400
commit06bec852386d57daf6cff778eacc691fa50d2fc1 (patch)
tree8d9a9a35b95d2b547915c4f355005ed11474a3dd
parentcb5d88c8f3813826dc5bfa2508bd86ace4613f62 (diff)
downloadeibhear-06bec852386d57daf6cff778eacc691fa50d2fc1.tar.gz
eibhear-06bec852386d57daf6cff778eacc691fa50d2fc1.tar.zst
eibhear-06bec852386d57daf6cff778eacc691fa50d2fc1.zip
kill and start only current user's session (#829)
-rwxr-xr-x.local/bin/sysact4
-rw-r--r--.zprofile4
2 files changed, 4 insertions, 4 deletions
diff --git a/.local/bin/sysact b/.local/bin/sysact
index 0a7cdd0..e73981f 100755
--- a/.local/bin/sysact
+++ b/.local/bin/sysact
@@ -10,8 +10,8 @@ esac
cmds="\
🔒 lock slock
-🚪 leave dwm kill -TERM $(pidof -s dwm)
-♻ renew dwm kill -HUP $(pidof -s dwm)
+🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$")
+♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$")
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
🔃 reboot ${reb:-sudo -A reboot}
🖥 shutdown ${shut:-sudo -A shutdown -h now}"
diff --git a/.zprofile b/.zprofile
index e7b62f6..d122b67 100644
--- a/.zprofile
+++ b/.zprofile
@@ -131,8 +131,8 @@ ex=🎯:\
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 &
if pacman -Qs libxft-bgra >/dev/null 2>&1; then
- # Start graphical server on tty1 if not already running.
- [ "$(tty)" = "/dev/tty1" ] && ! pidof Xorg >/dev/null 2>&1 && exec startx
+ # Start graphical server on user's current tty if not already running.
+ [[ -n "$(tty)" && -z $(pgrep -u $USER "\bXorg$") ]] && exec startx
else
echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm.
Please run: