diff options
author | pryazha <pryadeiniv@mail.ru> | 2025-06-15 16:06:11 +0500 |
---|---|---|
committer | pryazha <pryadeiniv@mail.ru> | 2025-06-15 16:06:11 +0500 |
commit | 55d0510313c623a5d9070b7ddc88693a63ca5c2b (patch) | |
tree | 9d2308af32704325505f0a18e95365e37f004214 /scripts | |
parent | 01180bc8d01a3511c355567ac5734cac6e132ab5 (diff) |
some scripts, bash, tmux changes
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/backup | 15 | ||||
-rwxr-xr-x | scripts/capture | 4 | ||||
-rwxr-xr-x | scripts/changecpufreq (renamed from scripts/cpufreqchange) | 0 | ||||
-rwxr-xr-x | scripts/dwmbar | 22 | ||||
-rwxr-xr-x | scripts/en2ru | 3 | ||||
-rwxr-xr-x | scripts/genpasswd (renamed from scripts/gen_passwords) | 0 | ||||
-rwxr-xr-x | scripts/image_from_xclip | 2 | ||||
-rwxr-xr-x | scripts/maim2clip (renamed from scripts/maim_screenshot) | 0 | ||||
-rwxr-xr-x | scripts/pickcolor (renamed from scripts/cpick) | 0 | ||||
-rwxr-xr-x | scripts/startdwm | 15 | ||||
-rwxr-xr-x | scripts/startdwmvoid | 10 | ||||
-rwxr-xr-x | scripts/status-bar/sb-battery | 34 | ||||
-rwxr-xr-x | scripts/status-bar/sb-cpu | 7 | ||||
-rwxr-xr-x | scripts/status-bar/sb-date | 3 | ||||
-rwxr-xr-x | scripts/status-bar/sb-memory | 6 | ||||
-rwxr-xr-x | scripts/status-bar/sb-volume | 7 | ||||
-rwxr-xr-x | scripts/statusbar | 8 | ||||
-rwxr-xr-x | scripts/void_startdwm | 22 | ||||
-rwxr-xr-x | scripts/xclip2png | 6 |
19 files changed, 63 insertions, 101 deletions
diff --git a/scripts/backup b/scripts/backup new file mode 100755 index 0000000..bce2944 --- /dev/null +++ b/scripts/backup @@ -0,0 +1,15 @@ +#!/bin/bash + +directories=" +$HOME/projects +$HOME/books +$HOME/log +$HOME/music +$HOME/pictures +$HOME/studies +$HOME/.ssh +" + +set -x + +tar cf backup_`date +%d_%m_%Y`.tar $directories diff --git a/scripts/capture b/scripts/capture new file mode 100755 index 0000000..fb33a5b --- /dev/null +++ b/scripts/capture @@ -0,0 +1,4 @@ +#!/bin/sh +set -x +# TODO(pryazha): autodetect video input (not x11 only) +ffmpeg -video_size 1920x2160 -framerate 25 -f x11grab -i :0 $(date +%d_%m_%Y).mp4 diff --git a/scripts/cpufreqchange b/scripts/changecpufreq index 5945487..5945487 100755 --- a/scripts/cpufreqchange +++ b/scripts/changecpufreq diff --git a/scripts/dwmbar b/scripts/dwmbar new file mode 100755 index 0000000..808b3f7 --- /dev/null +++ b/scripts/dwmbar @@ -0,0 +1,22 @@ +#!/bin/sh +while true ; do + MUSIC=$(~/dotfiles/scripts/sb/sb-playerctl); + if [ -n "${MUSIC}" ] ; then + MUSIC="Playing: ${MUSIC} " + fi + + BAT="$(cat /sys/class/power_supply/BAT0/capacity)" + if [ ${BAT} -ge 50 ] ; then + BAT=" ${BAT}% " + else + BAT=" ${BAT}% " + fi + + DATE="$(date "+(%a) %R %x") " + + CPU=" $(cat /sys/class/thermal/thermal_zone0/temp | cut -b 1,2)" + + xsetroot -name "${MUSIC}${BAT}${DATE}${CPU}" + + sleep 60 +done diff --git a/scripts/en2ru b/scripts/en2ru deleted file mode 100755 index 2c69562..0000000 --- a/scripts/en2ru +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# You need to install translate-shell -trans -b :ru "$@" diff --git a/scripts/gen_passwords b/scripts/genpasswd index bb7f016..bb7f016 100755 --- a/scripts/gen_passwords +++ b/scripts/genpasswd diff --git a/scripts/image_from_xclip b/scripts/image_from_xclip deleted file mode 100755 index 7485c19..0000000 --- a/scripts/image_from_xclip +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xclip -selection clipboard -t image/png -o > $1 diff --git a/scripts/maim_screenshot b/scripts/maim2clip index 87b1c38..87b1c38 100755 --- a/scripts/maim_screenshot +++ b/scripts/maim2clip diff --git a/scripts/cpick b/scripts/pickcolor index de88f00..de88f00 100755 --- a/scripts/cpick +++ b/scripts/pickcolor diff --git a/scripts/startdwm b/scripts/startdwm index d90b865..2fc43ad 100755 --- a/scripts/startdwm +++ b/scripts/startdwm @@ -1,13 +1,10 @@ #!/bin/sh -xrandr --output eDP --mode 1920x1080 --primary --output HDMI-A-0 --mode 1920x1080 --above eDP -feh --bg-scale $HOME/pictures/wallpapers/vocaloid.png +feh --bg-center $HOME/pictures/wallpapers/vocaloid.png -xinput set-prop "Logitech G102 LIGHTSYNC Gaming Mouse" "libinput Accel Profile Enabled" 0 1 0 -setxkbmap us,ru -option "grp:lctrl_lwin_toggle" -setxkbmap -option "caps:ctrl_modifier" -xset r rate 200 25 +dwmbar & +dunst & -statusbar & - -dwm 2> ~/.dwm.log +while true ; do + dwm 2> ~/.dwm.log +done diff --git a/scripts/startdwmvoid b/scripts/startdwmvoid new file mode 100755 index 0000000..bce94eb --- /dev/null +++ b/scripts/startdwmvoid @@ -0,0 +1,10 @@ +#!/bin/sh + +feh --bg-scale $HOME/pictures/wallpapers/vocaloid.png + +pkill pipewire +pipewire & + +dwmbar & + +dbus-run-session dwm 2> ~/.dwm.log diff --git a/scripts/status-bar/sb-battery b/scripts/status-bar/sb-battery deleted file mode 100755 index ae59416..0000000 --- a/scripts/status-bar/sb-battery +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -for battery in /sys/class/power_supply/BAT?*; do - # If non-first battery, print a space separator. - [ -n "${capacity+x}" ] && printf " " - - capacity="$(cat "$battery/capacity" 2>&1)" - if [ "$capacity" -gt 90 ]; then - status=" " - elif [ "$capacity" -gt 60 ]; then - status=" " - elif [ "$capacity" -gt 40 ]; then - status=" " - elif [ "$capacity" -gt 10 ]; then - status=" " - else - status=" " - fi - - case "$(cat "$battery/status" 2>&1)" in - Full) status=" " ;; - Discharging) - if [ "$capacity" -le 20 ]; then - status="$status" - fi - ;; - Charging) status="$status" ;; - "Not charging") status=" " ;; - Unknown) status="? $status" ;; - *) exit 1 ;; - esac - - echo "$status$capacity%" -done diff --git a/scripts/status-bar/sb-cpu b/scripts/status-bar/sb-cpu deleted file mode 100755 index a83b541..0000000 --- a/scripts/status-bar/sb-cpu +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -case "$BLOCK_BUTTON" in - 1) setsid --fork cpupower-gui ;; -esac - -echo " $(cat /sys/class/thermal/thermal_zone0/temp | cut -b 1,2)" diff --git a/scripts/status-bar/sb-date b/scripts/status-bar/sb-date deleted file mode 100755 index 0420109..0000000 --- a/scripts/status-bar/sb-date +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo " $(date '+%H:%M')" diff --git a/scripts/status-bar/sb-memory b/scripts/status-bar/sb-memory deleted file mode 100755 index e45325e..0000000 --- a/scripts/status-bar/sb-memory +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -free_mib="$(free --mebi | grep '^Mem:' | tr -s ' ' | cut -d' ' -f3)" -free_gib="$(echo "scale=2; $free_mib / 1024" | bc)" - -echo " $(printf "%.2f" "$free_gib")G" diff --git a/scripts/status-bar/sb-volume b/scripts/status-bar/sb-volume deleted file mode 100755 index 2bd20ba..0000000 --- a/scripts/status-bar/sb-volume +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -case "$BLOCK_BUTTON" in - 1) setsid --fork pavucontrol ;; -esac - -echo $(awk '{ print $2 }' <(wpctl get-volume @DEFAULT_AUDIO_SINK@) | cut -c 3,4)% diff --git a/scripts/statusbar b/scripts/statusbar deleted file mode 100755 index 2f36991..0000000 --- a/scripts/statusbar +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -while true ; do - BAT=$(cat /sys/class/power_supply/BAT0/capacity) - DATE=$(date "+%R %x") - CPU=$(cat /sys/class/thermal/thermal_zone0/temp | cut -b 1,2) - xsetroot -name "Battery: $BAT% | Time: $DATE | CPU: $CPU" - sleep 60 -done diff --git a/scripts/void_startdwm b/scripts/void_startdwm deleted file mode 100755 index eddd335..0000000 --- a/scripts/void_startdwm +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -xrandr --output eDP --mode 1920x1080 --primary --output HDMI-A-0 --mode 1920x1080 --left-of eDP -feh --bg-scale /home/pryazha/pictures/wallpapers/purple_miku.png - -xinput set-prop "Logitech G102 LIGHTSYNC Gaming Mouse" "libinput Accel Profile Enabled" 0 1 0 -setxkbmap us,ru -option "grp:lctrl_lwin_toggle" -setxkbmap -option "caps:ctrl_modifier" -xset r rate 200 25 - -dunst & -slstatus & - -pkill pipewire -pkill pipewire-pulse - -pipewire & -pipewire-pulse & - -wireplumber & - -dbus-run-session dwm 2> ~/.dwm.log diff --git a/scripts/xclip2png b/scripts/xclip2png new file mode 100755 index 0000000..9347981 --- /dev/null +++ b/scripts/xclip2png @@ -0,0 +1,6 @@ +#!/bin/sh +filename=$(date +%d_%m_%Y) +if [[ "$1" ]] ; then + filename="$1" +fi +xclip -selection clipboard -t image/png -o > $filename |