From 1918ebb0713ad69c9ad5af5e68c93cf9ca81ace0 Mon Sep 17 00:00:00 2001 From: Trumeet Date: Sun, 20 Feb 2022 16:43:06 -0800 Subject: pwrdialog + brightnessctl --- SystemdGraphicalSession/i3config | 16 ---------------- SystemdGraphicalSession/pwrdialog | 35 +++++++++++++++++++++++++++++++++++ SystemdGraphicalSession/xbindkeysrc | 11 +++++++++++ 3 files changed, 46 insertions(+), 16 deletions(-) create mode 100755 SystemdGraphicalSession/pwrdialog diff --git a/SystemdGraphicalSession/i3config b/SystemdGraphicalSession/i3config index 447f9a5..f13dca1 100644 --- a/SystemdGraphicalSession/i3config +++ b/SystemdGraphicalSession/i3config @@ -54,19 +54,3 @@ bar { font pango:Icons 10 } bindsym $mod+x [urgent=latest] focus -set $Locker systemctl --user start i3lock -set $mode_system System (l) lock, (Shift+e) logout, (Shift+s) suspend, (Shift+h) hibernate, (Ctrl+Shift+r) reboot, (Ctrl+Shift+s) shutdown -mode "$mode_system" { - bindsym l exec --no-startup-id $Locker, mode "default" - bindsym Shift+e exec --no-startup-id systemctl --user stop graphical-session.target - bindsym Shift+s exec --no-startup-id $Locker && systemctl suspend, mode "default" - bindsym Shift+h exec --no-startup-id $Locker && systemctl hibernate, mode "default" - bindsym Control+Shift+r exec --no-startup-id systemctl reboot, mode "default" - bindsym Control+Shift+s exec --no-startup-id systemctl poweroff -i, mode "default" - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -bindsym Control+Mod1+Delete mode "$mode_system" diff --git a/SystemdGraphicalSession/pwrdialog b/SystemdGraphicalSession/pwrdialog new file mode 100755 index 0000000..4507e1a --- /dev/null +++ b/SystemdGraphicalSession/pwrdialog @@ -0,0 +1,35 @@ +#!/bin/sh +set -e +choice=$(dialog \ + --clear \ + --erase-on-exit \ + --stdout \ + --backtitle $(hostname) \ + --title "Power Options" \ + --menu "Select an option:" 24 50 12 \ + l "Lock" \ + e "Logout" \ + s "S3" \ + r "Reboot" \ + h "S5") +case $choice in + l) + cmd="exec systemctl --user start i3lock" + ;; + e) + cmd="exec systemctl --user stop graphical-session.target" + ;; + s) + cmd="systemctl --user start i3lock && exec systemctl suspend" + ;; + r) + cmd="exec systemctl reboot" + ;; + h) + cmd="exec systemctl poweroff" + ;; + *) + cmd="exit 1" + ;; +esac +$cmd diff --git a/SystemdGraphicalSession/xbindkeysrc b/SystemdGraphicalSession/xbindkeysrc index e6d6c39..2bed0fd 100644 --- a/SystemdGraphicalSession/xbindkeysrc +++ b/SystemdGraphicalSession/xbindkeysrc @@ -71,5 +71,16 @@ "flameshot gui" Print +# Brightness +"brightnessctl -s +5%" + XF86MonBrightnessUp + +"brightnessctl s 5%-" + XF86MonBrightnessDown + +# Power Dialog +"xterm -fullscreen ~/.local/pwrdialog" + Control + Mod1 + Delete + # # End of xbindkeys configuration -- cgit v1.2.3