From 9651ff906cc3ecf9262e31127075e8a77bb29937 Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:11:51 +0000 Subject: [PATCH 1/7] Added a script to check battery status --- scripts/battery_status.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/battery_status.sh diff --git a/scripts/battery_status.sh b/scripts/battery_status.sh new file mode 100644 index 0000000..a2993f0 --- /dev/null +++ b/scripts/battery_status.sh @@ -0,0 +1,10 @@ +#!/bin/env bash +#Get battery status +cd /sys/class/power_supply +for f in `ls`; do +if [ -e $f"/capacity" ]; then +export stat=`cat $f"/status"` +export cap=`cat $f"/capacity"` +echo battery $f": "$stat", "$cap"%" +fi +done|zenity --text-info --filename=/dev/stdin --title "Power Status" \ No newline at end of file From 86eeb91e8d53ed197e76d9d57531118753191e48 Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:14:06 +0000 Subject: [PATCH 2/7] Updated dependency list with zenity for battery status script --- i38.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i38.sh b/i38.sh index 8f539ec..a033229 100755 --- a/i38.sh +++ b/i38.sh @@ -9,7 +9,7 @@ i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3" export DIALOGOPTS='--no-lines --visit-items' # Check to make sure minimum requirements are installed. -for i in dialog grun sgtk-menu yad ; do +for i in dialog grun sgtk-menu yad zenity ; do if ! command -v "$i" &> /dev/null ; then missing+=("$i") fi From 0a2e56a3feffc81c34c8bd93eff4d03d403c793b Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:22:04 +0000 Subject: [PATCH 3/7] Updated config to include command (mod+Control+b) to get battery status. --- i38.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/i38.sh b/i38.sh index a033229..aa5f5f3 100755 --- a/i38.sh +++ b/i38.sh @@ -287,6 +287,9 @@ bindsym \$mod+F1 exec --no-startup-id sgtk-menu -f # Desktop icons bindsym \$mod+Control+d exec --no-startup-id yad --icons --compact --no-buttons --title="Desktop" --close-on-unfocus --read-dir=${HOME}/Desktop +#Check battery status +bindsym \$mod+Control+b exec --no-startup-id ${i3Path}/scripts/battery_status.sh + # change focus # alt+tab and shift tab bindsym Mod1+Shift+Tab focus left From 9d64d98a774a7b5bab0d088e5b99985d52c6ee30 Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:45:44 +0000 Subject: [PATCH 4/7] Added a check to prevent both ratpoison key and default mode key from being set to Super (Mod4) --- i38.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/i38.sh b/i38.sh index aa5f5f3..f1d30b2 100755 --- a/i38.sh +++ b/i38.sh @@ -145,12 +145,19 @@ while getopts "${args}" i ; do done # Configuration questions +#Prevent setting ratpoison mode key to the same as default mode key +while [ "$escapeKey == "$mod" ] +do escapeKey="$(menulist "Ratpoison mode key:" Control+t Control+z Control+Escape Alt+Escape Control+Space Super)" escapeKey="${escapeKey//Alt/Mod1}" escapeKey="${escapeKey//Super/Mod4}" mod="$(menulist "I3 mod key, for top level bindings:" Alt Control Super)" mod="${mod//Alt/Mod1}" mod="${mod//Super/Mod4}" +if [ ""$escapeKey" == "$mod" ]; then +echo "Sorry, these cannot be the same key." +fi +done # Volume jump volumeJump=$(rangebox "How much should pressing the volume keys change the volume?" 1 15 5) # Web browser From 2da7081ff3ae45c97626263ec54bc0ebd2dde955 Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:47:30 +0000 Subject: [PATCH 5/7] Update i38.sh --- i38.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i38.sh b/i38.sh index f1d30b2..33cc15c 100755 --- a/i38.sh +++ b/i38.sh @@ -154,7 +154,7 @@ escapeKey="${escapeKey//Super/Mod4}" mod="$(menulist "I3 mod key, for top level bindings:" Alt Control Super)" mod="${mod//Alt/Mod1}" mod="${mod//Super/Mod4}" -if [ ""$escapeKey" == "$mod" ]; then +if [ "$escapeKey" == "$mod" ]; then echo "Sorry, these cannot be the same key." fi done From 9e66815ef7003d653c681d2b7cf369bd2426f8bc Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:52:21 +0000 Subject: [PATCH 6/7] Update i38.sh --- i38.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i38.sh b/i38.sh index 33cc15c..95f3b5f 100755 --- a/i38.sh +++ b/i38.sh @@ -146,7 +146,7 @@ done # Configuration questions #Prevent setting ratpoison mode key to the same as default mode key -while [ "$escapeKey == "$mod" ] +while [ "$escapeKey" == "$mod" ] do escapeKey="$(menulist "Ratpoison mode key:" Control+t Control+z Control+Escape Alt+Escape Control+Space Super)" escapeKey="${escapeKey//Alt/Mod1}" From 0255f9444089c882372e22a7fb64fcd8110192f7 Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 19:08:46 +0000 Subject: [PATCH 7/7] Removed zenity dependency and made battery status use speech dispatcher --- i38.sh | 2 +- scripts/battery_status.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/i38.sh b/i38.sh index 8245ec6..61e3e9b 100644 --- a/i38.sh +++ b/i38.sh @@ -9,7 +9,7 @@ i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3" export DIALOGOPTS='--no-lines --visit-items' # Check to make sure minimum requirements are installed. -for i in dialog grun sgtk-menu yad zenity ; do +for i in dialog grun sgtk-menu yad ; do if ! command -v "$i" &> /dev/null ; then missing+=("$i") fi diff --git a/scripts/battery_status.sh b/scripts/battery_status.sh index a2993f0..8204e01 100644 --- a/scripts/battery_status.sh +++ b/scripts/battery_status.sh @@ -7,4 +7,4 @@ export stat=`cat $f"/status"` export cap=`cat $f"/capacity"` echo battery $f": "$stat", "$cap"%" fi -done|zenity --text-info --filename=/dev/stdin --title "Power Status" \ No newline at end of file +done|spd-say -e \ No newline at end of file