diff options
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/datec | 2 | ||||
-rwxr-xr-x | .local/bin/mpvsel | 5 | ||||
-rwxr-xr-x | .local/bin/set_dwm_status_bar | 8 | ||||
-rwxr-xr-x | .local/bin/time.uuid | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/.local/bin/datec b/.local/bin/datec index d2e8715e..8146a68f 100755 --- a/.local/bin/datec +++ b/.local/bin/datec @@ -1,3 +1,3 @@ #!/bin/sh -TZ=Asia/Shanghai date "+%a %m/%d/%Y %H:%M:%S UTC%:::z" +TZ=Asia/Shanghai date '+%a %m/%d/%Y %H:%M:%S UTC%:::z' diff --git a/.local/bin/mpvsel b/.local/bin/mpvsel index 2b1142e3..a5625f04 100755 --- a/.local/bin/mpvsel +++ b/.local/bin/mpvsel @@ -5,7 +5,6 @@ url=$(xsel -ob) case $url in - *"youtu"*) mpv --ytdl-format="bestvideo[height<=?900][fps<=?30][vcodec!=?vp9]+bestaudio/best" --ytdl-raw-options='write-sub=,sub-lang="en,en-US,en-GB,zh-CN,zh-Hans,zh-Hant,zh-HK,zh-SG,zh-TW"' --fs --speed=2 --af=rubberband=pitch-scale=0.981818181818181 $url ;; - *"douyu"*) alacritty -e mpv $(basename $url | python $HOME/programs/real-url/douyu.py | tail -1) & ;; - *) echo "Clipboard url not supportted." >&2; exit 1 ;; + *'douyu'*) alacritty -e mpv "$(basename "$url" | python "$HOME/programs/real-url/douyu.py" | tail -1)" & ;; + *) mpv --ytdl-format='bestvideo[height<=?900][fps<=?60][vcodec!^=?vp9][vcodec!^=?av01]+bestaudio/bestbestvideo[height<=?900][fps<=?60][vcodec!^=?vp9][vcodec!^=?av01]' --ytdl-raw-options='write-sub=,sub-lang="en,en-US,en-GB,zh-CN,zh-Hans,zh-Hant,zh-HK,zh-SG,zh-TW"' --fs --speed=2 --af=rubberband=pitch-scale=0.981818181818181 "$url" ;; esac diff --git a/.local/bin/set_dwm_status_bar b/.local/bin/set_dwm_status_bar index 0ad0b95b..bfae853b 100755 --- a/.local/bin/set_dwm_status_bar +++ b/.local/bin/set_dwm_status_bar @@ -1,9 +1,11 @@ #!/bin/sh -xsetroot -name "$(date "+%a %m/%d %H:%M") \ +xsetroot -name "$(date '+%a %m/%d %H:%M') \ +| $(TZ=Asia/Shanghai date '+/%d %H:') \ | $(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) \ | $(amixer get Master | awk -F'[][]' 'END{ print $6" "$2 }') \ | $(cat /sys/class/power_supply/BAT1/capacity)%" + +#| $(free -h | awk '(NR==2){ print $4 }') \ +#| $(sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp) \ diff --git a/.local/bin/time.uuid b/.local/bin/time.uuid index f8d42d4d..eadae926 100755 --- a/.local/bin/time.uuid +++ b/.local/bin/time.uuid @@ -3,4 +3,4 @@ # 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}') +echo "$(date '+%s.%N')"."$(uuidgen -t | awk -F- '{OFS="-"; print $3,$2,$1,$4,$5}')" |