diff --git a/gui/awesome.sh b/gui/awesome.sh index 05706dc..1f5fc3e 100755 --- a/gui/awesome.sh +++ b/gui/awesome.sh @@ -38,6 +38,10 @@ autorandr --change --force mpd picomdaemon +# power save +xset 600 +xss-lock $(command -v lock.sh) & + exec dbus-run-session -- awesome 2> /tmp/awesome.log EOT diff --git a/gui/awesome/rc.lua b/gui/awesome/rc.lua index 4b7aeb8..0826e04 100644 --- a/gui/awesome/rc.lua +++ b/gui/awesome/rc.lua @@ -337,10 +337,11 @@ awful.screen.connect_for_each_screen(function(s) wibox.widget.systray(), mytextclock, logout_menu_widget{ - onpoweroff = function() awful.spawn.with_shell("sudo poweroff") end, onlogout = awful.quit, - onreboot = function() awful.spawn.with_shell("sudo shutdown -r now") end, - onlock = function () awful.spawn.with_shell("xset dpms force off") end + onpoweroff = function() awful.spawn.with_shell("loginctl poweroff") end, + onreboot = function() awful.spawn.with_shell("loginctl reboot") end, + onlock = function () awful.spawn.with_shell("loginctl lock-sessions") end, + onsuspend = function() awful.spawn.with_shell("loginctl suspend") end, }, }, }, diff --git a/gui/basic.sh b/gui/basic.sh index 3b2d159..afdde65 100755 --- a/gui/basic.sh +++ b/gui/basic.sh @@ -14,7 +14,6 @@ case "$UNAMEA" in pavucontrol \ ibus ibus-table ibus-table-wubi \ gnome-keyring \ - xss-lock \ nitrogen \ network-manager network-manager-gnome \ exfat-utils \ diff --git a/gui/slock.sh b/gui/slock.sh index 1d5c9be..8e5e403 100755 --- a/gui/slock.sh +++ b/gui/slock.sh @@ -4,4 +4,15 @@ DIR=$(dirname "$(readlink -f "$0")") log 'Setting up slock' +case "$UNAMEA" in + *Ubuntu*) + sudo apt install -y \ + xss-lock + ;; + *artix*) + sudo pacman -S --noconfirm --needed \ + xss-lock + ;; +esac + makeinstallrepo https://gitee.com/klesh/slock.git slock