From 12f5bac3b9cbb0396cd2cf34aea1bc9e46f88713 Mon Sep 17 00:00:00 2001 From: randomuser Date: Fri, 8 Jul 2022 02:28:49 +0000 Subject: [PATCH 1/2] add thinkpad x220 support --- sh/status | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sh/status b/sh/status index 243beef..aeaa3cb 100755 --- a/sh/status +++ b/sh/status @@ -2,6 +2,7 @@ power_prefix="/sys/class/power_supply/" [ -d "${power_prefix}sbs-20-000b" ] && bat="sbs-20-000b" +[ -d "${power_prefix}BAT0" ] && bat="BAT0" [ "$(ps aux | grep pulseaudio | wc -l)" -eq 2 ] && ss="pulse" || ss="alsa" @@ -25,6 +26,7 @@ mod_bspwm () { } mod_power () { + [ -z "$bat" ] || tr -d '\n' < /sys/class/power_supply/$bat/capacity } From 98705dc892c574628ac9aad7c9c302f9fbf653b6 Mon Sep 17 00:00:00 2001 From: randomuser Date: Fri, 8 Jul 2022 03:34:55 +0000 Subject: [PATCH 2/2] reconcile --- Makefile | 1 + sh/bspwm-toggle-gaps | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100755 sh/bspwm-toggle-gaps diff --git a/Makefile b/Makefile index 38dc2e2..a584e7e 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ sh: cp -f sh/tmenu_run $(DESTDIR)$(PREFIX)/bin cp -f sh/ss $(DESTDIR)$(PREFIX)/bin cp -f sh/net $(DESTDIR)$(PREFIX)/bin + cp -f sh/bspwm-toggle-gaps $(DESTDIR)$(PREFIX)/bin mkc: c/scream c/timer c/boid c/anaconda c/colors diff --git a/sh/bspwm-toggle-gaps b/sh/bspwm-toggle-gaps new file mode 100755 index 0000000..776fc5a --- /dev/null +++ b/sh/bspwm-toggle-gaps @@ -0,0 +1,11 @@ +#!/bin/sh + +gaps="$(bspc config top_padding)" + +if [ "$gaps" -eq 20 ]; then + bspc config window_gap 0 + bspc config top_padding 18 +else + bspc config window_gap 3 + bspc config top_padding 20 +fi