summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <>2021-01-24 20:23:19 -0500
committertslil clingman <>2021-01-24 20:23:19 -0500
commit3c79bbc4529f62d462f6807f354b6b4c5e3477e6 (patch)
tree3df4f41d1a19eb0e48e60d75f580ff1d8d47b093
parent515c31a1f08d7ba500bf7261d7018a250dfd9779 (diff)
parent92f24df41be941d407965368a9c84b7f061fddb8 (diff)
Merge branch 'master' of git.sr.ht:~tslil/scripts
-rwxr-xr-xbattery12
-rwxr-xr-xdwm_status13
-rwxr-xr-xlock15
-rwxr-xr-xsc21
4 files changed, 37 insertions, 24 deletions
diff --git a/battery b/battery
index 29189ae..1e7a7da 100755
--- a/battery
+++ b/battery
@@ -1,9 +1,7 @@
#!/bin/sh
report=$(acpi | tr -d ',')
-echo $report | grep -qv Unknown
-if [ "$?" = "0" ]; then
- status=$(echo $report | cut -d\ -f 3 | cut -b 1)
- perc=$(echo $report | cut -d\ -f 4)
- time=$(echo $report | cut -d\ -f 5 | sed 's/\([0-9]*\):\([0-9]*\).*/\1h\2m/')
- echo $status$perc $time
-fi
+status=$(echo $report | cut -d\ -f 3 | cut -b 1)
+perc=$(echo $report | cut -d\ -f 4)
+time=$(echo $report | cut -d\ -f 5 | sed 's/\([0-9]*\):\([0-9]*\).*/\1h\2m/')
+echo $status$perc $time
+
diff --git a/dwm_status b/dwm_status
new file mode 100755
index 0000000..947d9ad
--- /dev/null
+++ b/dwm_status
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+n=0
+while true; do
+ if [ "$(( $n % 2 ))" = "0" ]; then
+ bat="$(battery)"
+ fi;
+ time="$(date +%d/%Hh%M)"
+ temp="$(( $(cat /sys/class/thermal/thermal_zone0/temp) / 1000))C"
+ xsetroot -name "$temp | $bat | $time"
+ n=$(( $n + 1 ))
+ sleep 30s
+done
diff --git a/lock b/lock
index d8e4489..3134405 100755
--- a/lock
+++ b/lock
@@ -1,8 +1,15 @@
#!/usr/bin/env sh
+
+# Clear keys
killall -s HUP gpg-agent
keychain --clear
-xset dpms force off
+
+# We want powersaving now that screen is locked
+xset +dpms
+sleep 1; xset dpms force off
+
+# Lock
slock
-fix_backlight
-xset s off
-xest -dpms
+
+# Clean up on exit
+trap "xset -dpms" EXIT
diff --git a/sc b/sc
index c0e7986..ba01945 100755
--- a/sc
+++ b/sc
@@ -3,17 +3,12 @@
reset_ratpoison="yes"
case "$1" in
- "d") xrandr --nograb --output VGA1 --off --output LVDS1 --auto;;
- "r") xrandr --nograb --output VGA1 --auto --primary --output LVDS1 --off;;
- "c") xrandr --nograb --output VGA1 --auto --output LVDS1 --auto;;
- "n") xrandr --nograb --output LVDS1 --auto --above VGA1 --output VGA1 --auto;;
- "s") xrandr --nograb --output LVDS1 --auto --below VGA1 --output VGA1 --auto;;
- "e") xrandr --nograb --output LVDS1 --auto --right-of VGA1 --output VGA1 --auto;;
- "w") xrandr --nograb --output LVDS1 --auto --left-of VGA1 --output VGA1 --auto;;
- *) xrandr --nograb; reset_ratpoison="" ;;
+ "d") xrandr --nograb --output VGA-1 --off --output LVDS-1 --auto;;
+ "r") xrandr --nograb --output VGA-1 --auto --primary --output LVDS-1 --off;;
+ "c") xrandr --nograb --output VGA-1 --auto --output LVDS-1 --auto;;
+ "n") xrandr --nograb --output LVDS-1 --auto --above VGA-1 --output VGA-1 --auto;;
+ "s") xrandr --nograb --output LVDS-1 --auto --below VGA-1 --output VGA-1 --auto;;
+ "e") xrandr --nograb --output LVDS-1 --auto --right-of VGA-1 --output VGA-1 --auto;;
+ "w") xrandr --nograb --output LVDS-1 --auto --left-of VGA-1 --output VGA-1 --auto;;
+ *) xrandr --nograb; reset_ratpoison="" ;;
esac;
-
-if [ -n "$reset_ratpoison" ]; then
- [ -n "$BACKGROUND_IMAGE" ] && feh --bg-scale "$BACKGROUND_IMAGE"
- #ratpoison -c restart
-fi;