From 6f895a31fa8689d8e8d360fee80d2765bcd85cbb Mon Sep 17 00:00:00 2001 From: xyz Date: Thu, 27 May 2021 20:23:35 -0700 Subject: organize scripts, add PATH --- .bash_profile | 1 + .config/sxhkd/sxhkdrc | 2 +- .local/bin/set_dwm_status_bar | 8 ++++++++ .local/bin/time.uuid | 6 ++++++ .xinitrc | 2 +- programs/my_scripts/set_dwm_status_bar.sh | 6 ------ programs/my_scripts/time.uuid.sh | 4 ---- 7 files changed, 17 insertions(+), 12 deletions(-) create mode 100755 .local/bin/set_dwm_status_bar create mode 100755 .local/bin/time.uuid delete mode 100755 programs/my_scripts/set_dwm_status_bar.sh delete mode 100755 programs/my_scripts/time.uuid.sh diff --git a/.bash_profile b/.bash_profile index c875ab0d..fef1368d 100644 --- a/.bash_profile +++ b/.bash_profile @@ -13,6 +13,7 @@ export EDITOR=nvim export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc" #export QT_QPA_PLATFORMTHEME=qt5ct export QT_STYLE_OVERRIDE=kvantum +export PATH="$(find ~/.local/bin -type d -printf %p:)$PATH" # startx when login, should be put after environmental variables for .xinitrc to use if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 471ffc63..3fc79624 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -1,2 +1,2 @@ alt + Print - ffmpeg -f x11grab -i $DISPLAY -vframes 1 $HOME/pictures/screenshots/$($HOME/programs/my_scripts/time.uuid.sh).png + ffmpeg -f x11grab -i $DISPLAY -vframes 1 $HOME/pictures/screenshots/$(time.uuid).png diff --git a/.local/bin/set_dwm_status_bar b/.local/bin/set_dwm_status_bar new file mode 100755 index 00000000..2c0bad68 --- /dev/null +++ b/.local/bin/set_dwm_status_bar @@ -0,0 +1,8 @@ +#!/bin/sh + +xsetroot -name "$(date "+%a %m/%d %H:%M") \ +| $(if xset q | grep -q "Caps Lock: *on"; then echo A; else echo a; fi) \ +| $(cat /sys/class/net/wlp6s0/operstate) \ +| $(free -h | awk '(NR==2){ print $4 }') \ +| $(sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp) \ +| $(cat /sys/class/power_supply/BAT1/capacity)%" diff --git a/.local/bin/time.uuid b/.local/bin/time.uuid new file mode 100755 index 00000000..f8d42d4d --- /dev/null +++ b/.local/bin/time.uuid @@ -0,0 +1,6 @@ +#!/bin/sh + +# echo current nanosecond since epoch and alpha-numerically ordered UUID +# https://stackoverflow.com/questions/28681650/generate-alpha-numerically-ordered-uuids-over-time?noredirect=1&lq=1 +# https://askubuntu.com/questions/342842/what-does-this-command-mean-awk-f-print-4 +echo $(date '+%s.%N').$(uuidgen -t | awk -F- '{OFS="-"; print $3,$2,$1,$4,$5}') diff --git a/.xinitrc b/.xinitrc index 364a097a..610c6313 100644 --- a/.xinitrc +++ b/.xinitrc @@ -37,7 +37,7 @@ export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx while true; do - $HOME/programs/my_scripts/set_dwm_status_bar.sh + set_dwm_status_bar sleep 1 done & diff --git a/programs/my_scripts/set_dwm_status_bar.sh b/programs/my_scripts/set_dwm_status_bar.sh deleted file mode 100755 index 035adff4..00000000 --- a/programs/my_scripts/set_dwm_status_bar.sh +++ /dev/null @@ -1,6 +0,0 @@ -xsetroot -name "$(date "+%a %m/%d %H:%M") \ -| $(if xset q | grep -q "Caps Lock: *on"; then echo A; else echo a; fi) \ -| $(cat /sys/class/net/wlp6s0/operstate) \ -| $(free -h | awk '(NR==2){ print $4 }') \ -| $(sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp) \ -| $(cat /sys/class/power_supply/BAT1/capacity)%" diff --git a/programs/my_scripts/time.uuid.sh b/programs/my_scripts/time.uuid.sh deleted file mode 100755 index 438499a8..00000000 --- a/programs/my_scripts/time.uuid.sh +++ /dev/null @@ -1,4 +0,0 @@ -# echo current nanosecond since epoch and alpha-numerically ordered UUID -# https://stackoverflow.com/questions/28681650/generate-alpha-numerically-ordered-uuids-over-time?noredirect=1&lq=1 -# https://askubuntu.com/questions/342842/what-does-this-command-mean-awk-f-print-4 -echo $(date '+%s.%N').$(uuidgen -t | awk -F- '{OFS="-"; print $3,$2,$1,$4,$5}') -- cgit v1.2.3-70-g09d2