From 5b5368193e255c2ea6594ab1d306b47e52f028c9 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sun, 24 Dec 2023 02:37:31 -0500 Subject: [PATCH 1/3] Add logout script for river --- dot_config/wleave/layout | 2 +- dot_local/bin/executable_river-logout | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 dot_local/bin/executable_river-logout diff --git a/dot_config/wleave/layout b/dot_config/wleave/layout index 922b5a4..61fa2fd 100644 --- a/dot_config/wleave/layout +++ b/dot_config/wleave/layout @@ -12,7 +12,7 @@ } { "label" : "logout", - "action" : "loginctl terminate-user $USER", + "action" : "${HOME}/.local/bin/river-logout", "text" : "Logout", "keybind" : "e" } diff --git a/dot_local/bin/executable_river-logout b/dot_local/bin/executable_river-logout new file mode 100644 index 0000000..a6655fb --- /dev/null +++ b/dot_local/bin/executable_river-logout @@ -0,0 +1,5 @@ +#!/bin/bash + +RIVER=`ps -C river` + +[[ $RIVER != "" ]] && riverctl spawn 'reset' && riverctl exit || echo "River is not running." From b3b7209ffab39031b6d40336e5ca1dcfcab7ea3b Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sun, 24 Dec 2023 02:38:19 -0500 Subject: [PATCH 2/3] Test tty instead of systemd env var before starting river --- dot_bash_profile.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_bash_profile.tmpl b/dot_bash_profile.tmpl index 78e18ee..2e686c6 100644 --- a/dot_bash_profile.tmpl +++ b/dot_bash_profile.tmpl @@ -75,4 +75,4 @@ export XAUTHORITY="${XDG_RUNTIME_DIR}/Xauthority" [[ -f ~/.bashrc ]] && . ~/.bashrc # start river -[[ -z "${DISPLAY}" && "${XDG_VTNR}" -eq 1 ]] && exec dbus-run-session river +[[ -z $DISPLAY && $(tty) = "/dev/tty1" ]] && exec dbus-run-session river From d545bb85c97b8ff767af93b44d2e45d0c9668430 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sun, 24 Dec 2023 02:46:42 -0500 Subject: [PATCH 3/3] Add pipe to awk for RIVER variable --- dot_local/bin/executable_river-logout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_local/bin/executable_river-logout b/dot_local/bin/executable_river-logout index a6655fb..b3480bc 100644 --- a/dot_local/bin/executable_river-logout +++ b/dot_local/bin/executable_river-logout @@ -1,5 +1,5 @@ #!/bin/bash -RIVER=`ps -C river` +RIVER=`ps -C river | awk '/river/'` [[ $RIVER != "" ]] && riverctl spawn 'reset' && riverctl exit || echo "River is not running."