From 2c4d292a9fdaf8c318f0316edb057621debc2db7 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Thu, 23 Feb 2023 16:21:45 -0800 Subject: delete unnecessary configs for pinphone --- home/xyz/.local/bin/backlight | 23 ------------- home/xyz/.local/bin/beyondallreason | 3 -- home/xyz/.local/bin/sbar | 68 ------------------------------------- 3 files changed, 94 deletions(-) delete mode 100755 home/xyz/.local/bin/backlight delete mode 100755 home/xyz/.local/bin/beyondallreason delete mode 100755 home/xyz/.local/bin/sbar (limited to 'home/xyz/.local/bin') diff --git a/home/xyz/.local/bin/backlight b/home/xyz/.local/bin/backlight deleted file mode 100755 index 3de87f56..00000000 --- a/home/xyz/.local/bin/backlight +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -brightness=$(cat /sys/class/backlight/intel_backlight/brightness) -max_brightness=$(cat /sys/class/backlight/intel_backlight/max_brightness) -step=$((max_brightness/20)) - -case "$1" in - '-u') - case "$brightness" in - 0) echo 1;; - 1) echo "$step";; - *) echo "$((brightness+step))";; - esac - ;; - '-d') - case "$brightness" in - 1) echo 0;; - "$step") echo 1;; - *) echo "$((brightness-step))";; - esac - ;; - *) exit 1;; -esac > /sys/class/backlight/intel_backlight/brightness diff --git a/home/xyz/.local/bin/beyondallreason b/home/xyz/.local/bin/beyondallreason deleted file mode 100755 index 780cbc24..00000000 --- a/home/xyz/.local/bin/beyondallreason +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec /usr/bin/beyondallreason -w "$XDG_DATA_HOME/beyond_all_reason" "$@" diff --git a/home/xyz/.local/bin/sbar b/home/xyz/.local/bin/sbar deleted file mode 100755 index 461d83ac..00000000 --- a/home/xyz/.local/bin/sbar +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# modified from pystardust, GPLv3 license: https://github.com/pystardust/sbar - -# INIT -sec=0 - -# MODULES -update_time () { - time="$(date '+%a %m/%d %H:%M') $(TZ=Asia/Shanghai date '+/%d %H:') $(date -u '+/%d %H:')" -} - -#update_cap () { -# cap="$(if xset q | grep -q "Caps Lock: *on"; then echo A; else echo a; fi)" -#} - -update_net () { - net="$(if nmcli -t --fields type,state device | grep -q '\(ethernet\|wifi\):connected'; then echo 1; else echo 0; fi)" - vpn="$(if nmcli -t --fields type,state device | grep -q '\(tun\|wireguard\):connected'; then echo 1; else echo 0; fi)" -} - -update_vol () { - # $(NF-1) for both alsa and pulseaudio - vol="$(amixer get Master | awk -F'[][]' 'END{printf("%d %s",($(NF-1)=="on")?1:0,$2)}')" -} - -update_mic () { - # $(NF-1) for both alsa and pulseaudio - mic="$(amixer get Capture | awk -F '[][]' 'END{print ($(NF-1)=="on")?1:0}')" -} - -update_bat () { - bat="$(cat /sys/class/power_supply/BAT0/capacity)%" -} - -update_gpu () { - gpu="$(envycontrol -q | awk 'END{print toupper(substr($NF,0,1))}')" -} - -display () { - xsetroot -name "$time | N $net V $vpn | M $vol C $mic | $gpu | $bat" -} - -# modules that don't update on their own need to be run at the start for getting their initial value -update_net -update_vol -update_mic -update_gpu - -# SIGNALLING -# trap ";display" "RTMIN+n" -trap "update_mic;display" "RTMIN" -trap "update_vol;display" "RTMIN+1" -# xev can't read my toggle internet keyboard key, don't know what key to use in sxhkd to send signal -trap "update_net;display" "RTMIN+2" -# to update it from external commands -## kill -m $(pidof -x sbar) -# where m = 34 + n - -while :; do - sleep 1 & - wait - [ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds - [ $((sec % 60)) -eq 0 ] && update_net - [ $((sec % 60)) -eq 0 ] && update_bat - # how often the display updates ( 5 seconds ) - [ $((sec % 5 )) -eq 0 ] && display - sec=$((sec + 1)) -done -- cgit v1.2.3-70-g09d2