diff options
Diffstat (limited to 'home/xyz/.local/bin')
-rwxr-xr-x | home/xyz/.local/bin/backlight | 23 | ||||
-rwxr-xr-x | home/xyz/.local/bin/beyondallreason | 3 | ||||
-rwxr-xr-x | home/xyz/.local/bin/sbar | 68 | ||||
-rwxr-xr-x | home/xyz/.local/bin/upd | 24 | ||||
-rwxr-xr-x | home/xyz/.local/bin/xmr | 4 |
5 files changed, 12 insertions, 110 deletions
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 "<function>;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 diff --git a/home/xyz/.local/bin/upd b/home/xyz/.local/bin/upd index b668e0f9..8d832113 100755 --- a/home/xyz/.local/bin/upd +++ b/home/xyz/.local/bin/upd @@ -7,7 +7,7 @@ all () { qb refl usb - xmr + #xmr } clean () { @@ -50,7 +50,7 @@ userjs () { } misc () { - "$EDITOR" +PlugUpgrade +PlugClean! +PlugUpdate +qa + "$EDITOR" +PlugClean! +PlugUpdate +qa tldr --update sudo hardcode-fixer sudo units_cur @@ -101,24 +101,24 @@ usb () { #rsync -navPR --delete ~/archive ~/documents ~/downloads ~/music ~/pictures ~/programs ~/test ~/videos ~/.local/share/stardict/dic ~/.local/share/qBittorrent ~/.local/share/sdcv_history ~/.cache/nsxiv ~/.config/qBittorrent ~/.bitmonero/wallets ~/.password-store /run/media/xyz/bd0 # --files-from make -a not imply -r, so need to specify explicitly - rsync -avPRr --delete --files-from="$XDG_CONFIG_HOME/myconf/upd_rsync_files" / /run/media/xyz/bd0 + rsync -avPRr --delete --files-from="$XDG_CONFIG_HOME/myconf/upd_rsync_files" / /run/media/xyz/bd0/pp # not sure if useful or not sync } -xmr () { - # use cd to workaround monero-blockchain-export.log log file save in current dir? issue, haven't tested - cd "$HOME/.bitmonero" || exit - monero-blockchain-export --output-file /run/media/xyz/bd0/archive/monero/blockchain.raw - # not sure if useful or not - sync -} +#xmr () { +# # use cd to workaround monero-blockchain-export.log log file save in current dir? issue, haven't tested +# cd "$HOME/.bitmonero" || exit +# monero-blockchain-export --output-file /run/media/xyz/bd0/archive/monero/blockchain.raw +# # not sure if useful or not +# sync +#} if [ $# -eq 0 ]; then fast else - while getopts acfjmpqrux opt; do + while getopts acfjmpqru opt; do case $opt in a)all;; c)clean;; @@ -129,7 +129,7 @@ else q)qb;; r)refl;; u)usb;; - x)xmr;; + #x)xmr;; \?)exit 1;; esac done diff --git a/home/xyz/.local/bin/xmr b/home/xyz/.local/bin/xmr deleted file mode 100755 index e0516b9a..00000000 --- a/home/xyz/.local/bin/xmr +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -pidof -q monerod || alacritty -e monerod -monero-wallet-cli --config-file="$HOME/.bitmonero/monero-wallet-cli.conf" |