diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/scripts/2bws.sh | 40 | ||||
-rwxr-xr-x | scripts/scripts/bar.sh | 75 | ||||
-rwxr-xr-x | scripts/scripts/bat | 56 | ||||
-rwxr-xr-x | scripts/scripts/bluetooth.sh | 14 | ||||
-rwxr-xr-x | scripts/scripts/blur.sh | 25 | ||||
-rwxr-xr-x | scripts/scripts/cmusnp.sh | 45 | ||||
-rwxr-xr-x | scripts/scripts/date.sh | 4 | ||||
-rwxr-xr-x | scripts/scripts/doot | 53 | ||||
-rwxr-xr-x | scripts/scripts/draw.sh | 11 | ||||
-rwxr-xr-x | scripts/scripts/get_xres | 3 | ||||
-rwxr-xr-x | scripts/scripts/hidebars.sh | 23 | ||||
-rwxr-xr-x | scripts/scripts/img.sh | 32 | ||||
-rwxr-xr-x | scripts/scripts/music.sh | 16 | ||||
-rwxr-xr-x | scripts/scripts/netwrk.sh | 10 | ||||
-rwxr-xr-x | scripts/scripts/playpause.sh | 17 | ||||
-rwxr-xr-x | scripts/scripts/popups/cover.sh | 14 | ||||
-rwxr-xr-x | scripts/scripts/record | 23 | ||||
-rwxr-xr-x | scripts/scripts/restartbars.sh | 6 | ||||
-rwxr-xr-x | scripts/scripts/time.sh | 6 | ||||
-rwxr-xr-x | scripts/scripts/tmux-fzf.sh | 15 | ||||
-rwxr-xr-x | scripts/scripts/up | 20 | ||||
-rwxr-xr-x | scripts/scripts/url.sh | 4 | ||||
-rwxr-xr-x | scripts/scripts/vol | 21 | ||||
-rwxr-xr-x | scripts/scripts/wscycle.sh | 30 | ||||
-rwxr-xr-x | scripts/scripts/zatheme.sh | 37 |
25 files changed, 600 insertions, 0 deletions
diff --git a/scripts/scripts/2bws.sh b/scripts/scripts/2bws.sh new file mode 100755 index 0000000..6f81baa --- /dev/null +++ b/scripts/scripts/2bws.sh | |||
@@ -0,0 +1,40 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # display workspace status | ||
3 | # requires wmctrl | ||
4 | |||
5 | # get the current workspace | ||
6 | ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' ) | ||
7 | |||
8 | # icons | ||
9 | CURRENT=● | ||
10 | OCCUPIED=● | ||
11 | UNOCCUPIED=· | ||
12 | |||
13 | # colors | ||
14 | current="$( ~/scripts/get_xres color5 )" | ||
15 | occupied="$( ~/scripts/get_xres color8 )" | ||
16 | unoccupied="$( ~/scripts/get_xres color8 )" | ||
17 | |||
18 | # print workspaces to stdout | ||
19 | draw() { | ||
20 | for i in {0..5}; do | ||
21 | # get the number of windows in each workspace | ||
22 | windows=$( wmctrl -l | cut -d ' ' -f3 | grep $i | wc -l ) | ||
23 | |||
24 | |||
25 | if [[ $i -eq $ws ]] | ||
26 | then | ||
27 | # current workspace | ||
28 | echo -ne "%{F$current} $CURRENT " | ||
29 | else | ||
30 | if [[ $windows -eq 0 ]] | ||
31 | then | ||
32 | echo -ne "%{F$unoccupied} $UNOCCUPIED " | ||
33 | else | ||
34 | echo -ne "%{F$occupied} $OCCUPIED " | ||
35 | fi | ||
36 | fi | ||
37 | done | ||
38 | } | ||
39 | |||
40 | draw | ||
diff --git a/scripts/scripts/bar.sh b/scripts/scripts/bar.sh new file mode 100755 index 0000000..1903462 --- /dev/null +++ b/scripts/scripts/bar.sh | |||
@@ -0,0 +1,75 @@ | |||
1 | #! /usr/bin/env bash | ||
2 | |||
3 | |||
4 | fg="$(get_xres color15)" | ||
5 | fg_light="$(get_xres color10)" | ||
6 | bg="$(get_xres color0)" | ||
7 | # %{F$fg} $(date +%d/%m) %{F$fg_light} $(date +%Y) | ||
8 | |||
9 | (while true; do echo -e "\n$(date +%H)\n$(date +%M)\n"; sleep 10; done) | dzen2 \ | ||
10 | -e "onstart=uncollapse;" \ | ||
11 | -fg "$fg" \ | ||
12 | -bg "$fg_light" \ | ||
13 | -tw 0 \ | ||
14 | -l 3 \ | ||
15 | -x 20 \ | ||
16 | -y 600 \ | ||
17 | -w 70 \ | ||
18 | -h 30 \ | ||
19 | -sa c \ | ||
20 | -p & | ||
21 | |||
22 | (echo -e "\n"; while true; do echo -e "$(bat -i)"; sleep 1; done )| dzen2 \ | ||
23 | -e "onstart=uncollapse;" \ | ||
24 | -fg "$fg" \ | ||
25 | -bg "$fg_light" \ | ||
26 | -tw 70 \ | ||
27 | -l 4 \ | ||
28 | -x 20 \ | ||
29 | -y 500 \ | ||
30 | -w 70 \ | ||
31 | -h 15 \ | ||
32 | -sa c \ | ||
33 | -p & | ||
34 | |||
35 | ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' ) | ||
36 | |||
37 | # colors | ||
38 | current="$( ~/scripts/get_xres color5 )" | ||
39 | occupied="$( ~/scripts/get_xres color8 )" | ||
40 | unoccupied="$( ~/scripts/get_xres color8 )" | ||
41 | |||
42 | # print workspaces to stdout | ||
43 | draw() { | ||
44 | for i in {0..5}; do | ||
45 | # get the number of windows in each workspace | ||
46 | windows=$( wmctrl -l | cut -d ' ' -f3 | grep $i | wc -l ) | ||
47 | |||
48 | |||
49 | if [[ $i -eq $ws ]] | ||
50 | then | ||
51 | # current workspace | ||
52 | echo -ne "^($current)O" | ||
53 | else | ||
54 | if [[ $windows -eq 0 ]] | ||
55 | then | ||
56 | echo -ne "^($unoccupied)o" | ||
57 | else | ||
58 | echo -ne "^($occupied)x" | ||
59 | fi | ||
60 | fi | ||
61 | done | ||
62 | } | ||
63 | |||
64 | # echo -e "\n\n$(draw)\n" | dzen2 \ | ||
65 | # -e "onstart=uncollapse;" \ | ||
66 | # -fg "$fg" \ | ||
67 | # -bg "$fg_light" \ | ||
68 | # -tw 70 \ | ||
69 | # -l 4 \ | ||
70 | # -x 20 \ | ||
71 | # -y 500 \ | ||
72 | # -w 70 \ | ||
73 | # -h 15 \ | ||
74 | # -sa c \ | ||
75 | # -p & | ||
diff --git a/scripts/scripts/bat b/scripts/scripts/bat new file mode 100755 index 0000000..6746d82 --- /dev/null +++ b/scripts/scripts/bat | |||
@@ -0,0 +1,56 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | red="\e[31m" | ||
4 | grn="\e[32m" | ||
5 | ylw="\e[33m" | ||
6 | cyn="\e[36m" | ||
7 | blu="\e[34m" | ||
8 | prp="\e[35m" | ||
9 | bprp="\e[35;1m" | ||
10 | rst="\e[0m" | ||
11 | |||
12 | icon="$( ~/scripts/get_xres color4 )" | ||
13 | fg="$( ~/scripts/get_xres color8 )" | ||
14 | |||
15 | bat_status="" | ||
16 | bat_status=$( cat /sys/class/power_supply/BAT0/capacity ) | ||
17 | charging_status=$( cat /sys/class/power_supply/BAT0/status ) | ||
18 | |||
19 | health() { | ||
20 | for i in {0..4} | ||
21 | do | ||
22 | if [[ $i -le $(( $bat_status/20 )) ]]; then | ||
23 | echo -ne "#[fg=colour1]• " | ||
24 | else | ||
25 | echo -ne "#[fg=colour8]• " | ||
26 | fi | ||
27 | done | ||
28 | echo | ||
29 | } | ||
30 | |||
31 | bat_status_small() { | ||
32 | if [[ "$charging_status" = *Charging* ]]; then | ||
33 | echo -ne "+$bat_status%" | ||
34 | else | ||
35 | echo -ne "$bat_status%" | ||
36 | fi | ||
37 | } | ||
38 | |||
39 | [ -z "$1" ] && { | ||
40 | bat_status_small | ||
41 | } | ||
42 | |||
43 | while getopts qi options | ||
44 | do | ||
45 | case $options in | ||
46 | i) | ||
47 | bat_status_small | ||
48 | ;; | ||
49 | q) | ||
50 | if [[ "$charging_status" = *Charging* ]]; then | ||
51 | echo -ne "+ $(health)" | ||
52 | else | ||
53 | health | ||
54 | fi | ||
55 | esac | ||
56 | done | ||
diff --git a/scripts/scripts/bluetooth.sh b/scripts/scripts/bluetooth.sh new file mode 100755 index 0000000..85b7f08 --- /dev/null +++ b/scripts/scripts/bluetooth.sh | |||
@@ -0,0 +1,14 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | connections=$( hcitool con ) | ||
4 | devices=$( hcitool dev | wc -l ) | ||
5 | |||
6 | if [ $devices = 1 ] | ||
7 | then | ||
8 | echo -n "" | ||
9 | elif [[ $devices > 1 && $connections = "Connections:" ]] | ||
10 | then | ||
11 | echo -n "" | ||
12 | else | ||
13 | echo -n "" | ||
14 | fi | ||
diff --git a/scripts/scripts/blur.sh b/scripts/scripts/blur.sh new file mode 100755 index 0000000..9349b03 --- /dev/null +++ b/scripts/scripts/blur.sh | |||
@@ -0,0 +1,25 @@ | |||
1 | #! /usr/bin/env bash | ||
2 | |||
3 | state="unblurred" | ||
4 | while :; do | ||
5 | current_workspace="$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')" | ||
6 | if [[ -n "$current_workspace" ]]; then | ||
7 | num_windows="$(echo "$(wmctrl -l)" | awk -F" " '{print $2}' | grep ^$current_workspace)" | ||
8 | if [ -n "$num_windows" ]; then | ||
9 | if [ "$state" != "blurred" ]; then | ||
10 | for i in {0..6}; do | ||
11 | feh --bg-fill ~/pics/blurs/busy"$i".jpg | ||
12 | done | ||
13 | fi | ||
14 | state="blurred" | ||
15 | else | ||
16 | if [ "$state" != "unblurred" ]; then | ||
17 | for i in $(seq 5 -1 0); do | ||
18 | feh --bg-fill ~/pics/blurs/busy"$i".jpg | ||
19 | done | ||
20 | feh --bg-fill ~/pics/blurs/busy.jpg | ||
21 | fi | ||
22 | state="unblurred" | ||
23 | fi | ||
24 | fi | ||
25 | done | ||
diff --git a/scripts/scripts/cmusnp.sh b/scripts/scripts/cmusnp.sh new file mode 100755 index 0000000..b43c7e8 --- /dev/null +++ b/scripts/scripts/cmusnp.sh | |||
@@ -0,0 +1,45 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # Display currently playing song from cmus | ||
3 | # Requires cmus | ||
4 | |||
5 | # colors | ||
6 | active="$( ~/scripts/get_xres color7 )" | ||
7 | inactive="$( ~/scripts/get_xres color7 )" | ||
8 | |||
9 | np_string="" | ||
10 | |||
11 | trunc() { | ||
12 | max_length=$1 | ||
13 | text=$2 | ||
14 | length=${#text} | ||
15 | (( length > max_length )) && | ||
16 | text=${text::$(( max_length ))}... | ||
17 | echo "$text" | ||
18 | } | ||
19 | |||
20 | if pgrep -x "cmus" > /dev/null | ||
21 | then | ||
22 | status=$( cmus-remote -Q | grep status\ | sed 's/status //' ) | ||
23 | artist=$( cmus-remote -Q | grep tag\ artist\ | sed 's/tag artist //' ) | ||
24 | title=$( cmus-remote -Q | grep tag\ title\ | sed 's/tag title //' ) | ||
25 | |||
26 | np_string="$title - $artist" | ||
27 | np_string=$( trunc 35 "$np_string" ) | ||
28 | |||
29 | spc=$(( $(( 32 - ${#np_string} ))/2 )) | ||
30 | spc="$( printf "%${spc}s" )" | ||
31 | |||
32 | if [[ "$status" = *playing* ]] | ||
33 | then | ||
34 | echo -ne "%{F#FF0000}%{F#FFFFFF}PAUSE" | ||
35 | elif [[ "$status" = *paused* ]] | ||
36 | then | ||
37 | echo -ne "PLAY" | ||
38 | elif [[ "$status" = *stopped* ]] | ||
39 | then | ||
40 | echo -ne "START" | ||
41 | fi | ||
42 | |||
43 | else | ||
44 | echo | ||
45 | fi | ||
diff --git a/scripts/scripts/date.sh b/scripts/scripts/date.sh new file mode 100755 index 0000000..f97bdc9 --- /dev/null +++ b/scripts/scripts/date.sh | |||
@@ -0,0 +1,4 @@ | |||
1 | #! /usr/bin/env bash | ||
2 | |||
3 | month="$(date +%B)" | ||
4 | printf "%s $(date +%e) $(date +%Y)" "${month^^}" | ||
diff --git a/scripts/scripts/doot b/scripts/scripts/doot new file mode 100755 index 0000000..defb363 --- /dev/null +++ b/scripts/scripts/doot | |||
@@ -0,0 +1,53 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | red="\e[31m" | ||
3 | grn="\e[32m" | ||
4 | ylw="\e[33m" | ||
5 | cyn="\e[36m" | ||
6 | blu="\e[34m" | ||
7 | prp="\e[35m" | ||
8 | bprp="\e[35;1m" | ||
9 | gry="\e[94m" | ||
10 | rst="\e[0m" | ||
11 | |||
12 | COL=$(tput cols) | ||
13 | ROW=$(tput lines) | ||
14 | ((PADY = ROW / 2 - 1 - ${#ENTS[@]} / 2)) | ||
15 | ((PADX = COL / 2 - LEN / 2)) | ||
16 | |||
17 | for ((i = 0; i < PADX; ++i)); do | ||
18 | PADC="$PADC " | ||
19 | done | ||
20 | |||
21 | for ((i = 0; i < PADY; ++i)); do | ||
22 | PADR="$PADR\n" | ||
23 | done | ||
24 | clear | ||
25 | printf "%b" "$PADR" | ||
26 | |||
27 | echo -ne "$ylw$PADC" | ||
28 | echo -e ' _/_' | ||
29 | echo -n "$PADC" | ||
30 | echo -n '/' | ||
31 | echo -ne "$rst" | ||
32 | echo -n '`▅_▅'\''' | ||
33 | echo -ne "$ylw" | ||
34 | echo '\' | ||
35 | echo -n "$PADC" | ||
36 | echo -n '\' | ||
37 | echo -ne "$prp" | ||
38 | echo -ne ' vwv ' | ||
39 | echo -ne "$ylw" | ||
40 | echo -e '/' | ||
41 | echo -n "$PADC" | ||
42 | echo -n ' `---'\''' | ||
43 | |||
44 | echo -e "$rst" | ||
45 | |||
46 | for ((i = 0; i < PADX - 5; ++i)); do | ||
47 | PADT="$PADT " | ||
48 | done | ||
49 | |||
50 | echo "$PADT$USER @ $HOSTNAME" | ||
51 | echo "$PADT$(uptime -p)" | ||
52 | |||
53 | read x | ||
diff --git a/scripts/scripts/draw.sh b/scripts/scripts/draw.sh new file mode 100755 index 0000000..8e34904 --- /dev/null +++ b/scripts/scripts/draw.sh | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # Spawn terminals interactively | ||
3 | # Requires slop, urxvt | ||
4 | |||
5 | read -r X Y W H < <(slop -f "%x %y %w %h" -b 4 -c 0.8,0.8,0.8,0.8 -t 0 ) | ||
6 | (( W /= 14 )) | ||
7 | (( H /= 25 )) | ||
8 | |||
9 | g=${W}x${H}+${X}+${Y} | ||
10 | |||
11 | urxvtc -geometry $g | ||
diff --git a/scripts/scripts/get_xres b/scripts/scripts/get_xres new file mode 100755 index 0000000..9276ef4 --- /dev/null +++ b/scripts/scripts/get_xres | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | xrdb -query | grep -w $1 | awk '{print $2}' | ||
diff --git a/scripts/scripts/hidebars.sh b/scripts/scripts/hidebars.sh new file mode 100755 index 0000000..6f449d6 --- /dev/null +++ b/scripts/scripts/hidebars.sh | |||
@@ -0,0 +1,23 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | pkill n30f | ||
4 | while getopts hs options | ||
5 | do | ||
6 | case $options in | ||
7 | h) # hide | ||
8 | pkill -f polybar\ artist | ||
9 | pkill -f polybar\ track | ||
10 | pkill -f polybar\ album | ||
11 | ;; | ||
12 | s) # show | ||
13 | if pgrep -f polybar\ artist > /dev/null; then | ||
14 | ~/scripts/popups/cover.sh | ||
15 | else | ||
16 | polybar artist & | ||
17 | polybar track & | ||
18 | polybar album & | ||
19 | ~/scripts/popups/cover.sh | ||
20 | fi | ||
21 | ;; | ||
22 | esac | ||
23 | done | ||
diff --git a/scripts/scripts/img.sh b/scripts/scripts/img.sh new file mode 100755 index 0000000..baea386 --- /dev/null +++ b/scripts/scripts/img.sh | |||
@@ -0,0 +1,32 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # z3bra -- 2014-01-21 | ||
4 | # http://blog.z3bra.org/2014/01/images-in-terminal.html | ||
5 | |||
6 | test -z "$1" && exit | ||
7 | |||
8 | W3MIMGDISPLAY="/usr/lib/w3m/w3mimgdisplay" | ||
9 | FILENAME=$1 | ||
10 | FONTH=14 # Size of one terminal row | ||
11 | FONTW=8 # Size of one terminal column | ||
12 | COLUMNS=`tput cols` | ||
13 | LINES=`tput lines` | ||
14 | |||
15 | read width height <<< `echo -e "5;$FILENAME" | $W3MIMGDISPLAY` | ||
16 | |||
17 | max_width=$(($FONTW * $COLUMNS)) | ||
18 | max_height=$(($FONTH * $(($LINES - 2)))) # substract one line for prompt | ||
19 | |||
20 | if test $width -gt $max_width; then | ||
21 | height=$(($height * $max_width / $width)) | ||
22 | width=$max_width | ||
23 | fi | ||
24 | if test $height -gt $max_height; then | ||
25 | width=$(($width * $max_height / $height)) | ||
26 | height=$max_height | ||
27 | fi | ||
28 | |||
29 | w3m_command="0;1;0;0;$width;$height;;;;;$FILENAME\n4;\n3;" | ||
30 | |||
31 | tput cup $(($height/$FONTH)) 0 | ||
32 | echo -e $w3m_command|$W3MIMGDISPLAY | ||
diff --git a/scripts/scripts/music.sh b/scripts/scripts/music.sh new file mode 100755 index 0000000..1de3bc0 --- /dev/null +++ b/scripts/scripts/music.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | while getopts abt options | ||
4 | do | ||
5 | case $options in | ||
6 | a) | ||
7 | cmus-remote -Q | grep tag\ artist\ | sed 's/tag artist //' | ||
8 | ;; | ||
9 | b) | ||
10 | cmus-remote -Q | grep tag\ album\ | sed 's/tag album //' | ||
11 | ;; | ||
12 | t) | ||
13 | cmus-remote -Q | grep tag\ title\ | sed 's/tag title //' | ||
14 | ;; | ||
15 | esac | ||
16 | done | ||
diff --git a/scripts/scripts/netwrk.sh b/scripts/scripts/netwrk.sh new file mode 100755 index 0000000..4fec3a5 --- /dev/null +++ b/scripts/scripts/netwrk.sh | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | status=$( nmcli | sed -n 1p | awk '{print $2}' ) | ||
4 | |||
5 | if [ $status = "connected" ] | ||
6 | then | ||
7 | echo -n '' | ||
8 | else | ||
9 | echo -n '' | ||
10 | fi | ||
diff --git a/scripts/scripts/playpause.sh b/scripts/scripts/playpause.sh new file mode 100755 index 0000000..72ba0fb --- /dev/null +++ b/scripts/scripts/playpause.sh | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # Interactive polybar icon for music controls | ||
3 | # Requires cmus | ||
4 | |||
5 | if pgrep -x "cmus" > /dev/null | ||
6 | then | ||
7 | status=$( cmus-remote -Q | grep status\ | sed 's/status //' ) | ||
8 | if [[ "$status" == *playing* ]]; then | ||
9 | echo -ne " %{F$(get_xres color2)} " | ||
10 | elif [[ "$status" == *paused* ]]; then | ||
11 | echo -ne " %{F$(get_xres color2)} " | ||
12 | elif [[ "$status" == *stopped* ]]; then | ||
13 | echo -ne " %{F$(get_xres color2)} " | ||
14 | fi | ||
15 | else | ||
16 | echo -ne " " | ||
17 | fi | ||
diff --git a/scripts/scripts/popups/cover.sh b/scripts/scripts/popups/cover.sh new file mode 100755 index 0000000..356e5ba --- /dev/null +++ b/scripts/scripts/popups/cover.sh | |||
@@ -0,0 +1,14 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | folder=$( cmus-remote -Q | grep -w file | sed 's/file //' ) | ||
4 | cover=${folder%/*}/cover.png | ||
5 | |||
6 | convert "$cover" -resize 200x200 ~/tmp/cover.png | ||
7 | |||
8 | if pgrep n30f > /dev/null | ||
9 | then | ||
10 | pkill n30f | ||
11 | n30f -x 20 -y 700 ~/tmp/cover.png -c "hidebars.sh -h" -d | ||
12 | else | ||
13 | n30f -x 20 -y 700 ~/tmp/cover.png -c "hidebars.sh -h" -d | ||
14 | fi | ||
diff --git a/scripts/scripts/record b/scripts/scripts/record new file mode 100755 index 0000000..bc59fb7 --- /dev/null +++ b/scripts/scripts/record | |||
@@ -0,0 +1,23 @@ | |||
1 | #!/bin/bash | ||
2 | slop=$(slop -f "%x %y %w %h %g %i") || exit 1 | ||
3 | read -r X Y W H G ID < <(echo $slop) | ||
4 | ffmpeg \ | ||
5 | -f x11grab \ | ||
6 | -s "$W"x"$H" \ | ||
7 | -i :0.0+$X,$Y \ | ||
8 | -f alsa \ | ||
9 | -thread_queue_size 512 \ | ||
10 | -ac 2 \ | ||
11 | -ar 48000 \ | ||
12 | -i hw:0 \ | ||
13 | -framerate 60 \ | ||
14 | -vcodec libx264 \ | ||
15 | -threads 4 \ | ||
16 | -y \ | ||
17 | "$HOME"/tmp/x.mkv | ||
18 | |||
19 | ffmpeg \ | ||
20 | -i "$HOME"/tmp/x.mkv \ | ||
21 | -pix_fmt yuv420p \ | ||
22 | -vf scale=-2:1080 \ | ||
23 | "/home/np/vids/rec/$1" | ||
diff --git a/scripts/scripts/restartbars.sh b/scripts/scripts/restartbars.sh new file mode 100755 index 0000000..44d339f --- /dev/null +++ b/scripts/scripts/restartbars.sh | |||
@@ -0,0 +1,6 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | pkill polybar | ||
4 | polybar time & | ||
5 | polybar date & | ||
6 | polybar music & | ||
diff --git a/scripts/scripts/time.sh b/scripts/scripts/time.sh new file mode 100755 index 0000000..66b0fbe --- /dev/null +++ b/scripts/scripts/time.sh | |||
@@ -0,0 +1,6 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | fg="$(get_xres color15)" | ||
4 | fg_light="$(get_xres color8)" | ||
5 | # %{F$fg} $(date +%d/%m) %{F$fg_light} $(date +%Y) | ||
6 | echo -ne "$(date +%p) $(date +%I:%M)" | ||
diff --git a/scripts/scripts/tmux-fzf.sh b/scripts/scripts/tmux-fzf.sh new file mode 100755 index 0000000..9caa7ea --- /dev/null +++ b/scripts/scripts/tmux-fzf.sh | |||
@@ -0,0 +1,15 @@ | |||
1 | #! /usr/bin/env bash | ||
2 | |||
3 | function __fzf() { | ||
4 | fzf --cycle --height 7 --reverse | ||
5 | } | ||
6 | |||
7 | function __list_to_fzf() { | ||
8 | tmux ls -F "#{session_name}" | __fzf | ||
9 | } | ||
10 | |||
11 | if [ -n "$TMUX" ]; then | ||
12 | tmux switch-client -t "$(__list_to_fzf)" | ||
13 | else | ||
14 | tmux a -dt "$(tmux ls -F "#{session_name}" | __fzf)" | ||
15 | fi | ||
diff --git a/scripts/scripts/up b/scripts/scripts/up new file mode 100755 index 0000000..6b9ece4 --- /dev/null +++ b/scripts/scripts/up | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | id=$( cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1 ) | ||
4 | |||
5 | if [ $# != 1 ]; then | ||
6 | echo "needs an arg" | ||
7 | else | ||
8 | if [ -f "$1" ]; then | ||
9 | ext="${1##*.}" | ||
10 | id="$id.$ext" | ||
11 | scp -P 22222 "$1" ferrn:~/www/nerd/uploads/"$id" | ||
12 | echo "https://u.peppe.rs/$id" | ||
13 | if hash xclip 2> /dev/null; then | ||
14 | echo "https://u.peppe.rs/$id" | xclip -selection clipboard | ||
15 | echo "https://u.peppe.rs/$id" | xclip -i | ||
16 | fi | ||
17 | else | ||
18 | echo "file does not exist" | ||
19 | fi | ||
20 | fi | ||
diff --git a/scripts/scripts/url.sh b/scripts/scripts/url.sh new file mode 100755 index 0000000..6b3264d --- /dev/null +++ b/scripts/scripts/url.sh | |||
@@ -0,0 +1,4 @@ | |||
1 | #! /usr/bin/env bash | ||
2 | |||
3 | echo "$1" | xclip -i | ||
4 | echo "$1" | xclip -sel c | ||
diff --git a/scripts/scripts/vol b/scripts/scripts/vol new file mode 100755 index 0000000..8ed96da --- /dev/null +++ b/scripts/scripts/vol | |||
@@ -0,0 +1,21 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | fg="$( ~/scripts/get_xres color7 )" | ||
4 | icon="$( ~/scripts/get_xres color2 )" | ||
5 | |||
6 | while getopts idq options | ||
7 | do | ||
8 | case $options in | ||
9 | i) | ||
10 | amixer sset Master 2%+ | ||
11 | ;; | ||
12 | |||
13 | d) | ||
14 | amixer sset Master 2%- | ||
15 | ;; | ||
16 | q) | ||
17 | cur_vol=$( amixer sget Master | awk -F"[][]" '/dB/ { print $2 }' ) | ||
18 | echo " %{F$fg}$cur_vol" | ||
19 | ;; | ||
20 | esac | ||
21 | done | ||
diff --git a/scripts/scripts/wscycle.sh b/scripts/scripts/wscycle.sh new file mode 100755 index 0000000..7ea608d --- /dev/null +++ b/scripts/scripts/wscycle.sh | |||
@@ -0,0 +1,30 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | # cycle through workspaces | ||
3 | |||
4 | # get the current ws | ||
5 | ws=$( xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //' ) | ||
6 | total=5 | ||
7 | |||
8 | while getopts fr options | ||
9 | do | ||
10 | case $options in | ||
11 | f) | ||
12 | if [[ $ws -eq $total ]] | ||
13 | then | ||
14 | wmctrl -s 0 | ||
15 | else | ||
16 | ws=$(( $ws + 1 )) | ||
17 | wmctrl -s $ws | ||
18 | fi | ||
19 | ;; | ||
20 | r) | ||
21 | if [[ $ws -eq 0 ]] | ||
22 | then | ||
23 | wmctrl -s $total | ||
24 | else | ||
25 | ws=$(( $ws - 1 )) | ||
26 | wmctrl -s $ws | ||
27 | fi | ||
28 | ;; | ||
29 | esac | ||
30 | done | ||
diff --git a/scripts/scripts/zatheme.sh b/scripts/scripts/zatheme.sh new file mode 100755 index 0000000..4cda119 --- /dev/null +++ b/scripts/scripts/zatheme.sh | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | |||
4 | echo 'set incremental-search true | ||
5 | |||
6 | set recolor "true" | ||
7 | |||
8 | set default-bg "'$( get_xres color0 )'" | ||
9 | set default-fg "'$( get_xres color7 )'" | ||
10 | |||
11 | set completion-bg "'$( get_xres color0 )'" | ||
12 | set completion-fg "'$( get_xres color7 )'" | ||
13 | set completion-highlight-bg "'$( get_xres color5 )'" | ||
14 | set completion-highlight-fg "'$( get_xres color7 )'" | ||
15 | |||
16 | set statusbar-bg "'$( get_xres color0 )'" | ||
17 | set statusbar-fg "'$( get_xres color7 )'" | ||
18 | |||
19 | set inputbar-bg "'$( get_xres color0 )'" | ||
20 | set inputbar-fg "'$( get_xres color7 )'" | ||
21 | |||
22 | set recolor-darkcolor "'$( get_xres color7 )'" | ||
23 | set recolor-lightcolor "'$( get_xres color0 )'" | ||
24 | |||
25 | set window-height "800" | ||
26 | set window-width "600" | ||
27 | |||
28 | set adjust-open "width" | ||
29 | set smooth-scroll true | ||
30 | set statusbar-home-tilde "true" | ||
31 | set statusbar-h-padding "50" | ||
32 | set statusbar-v-padding "50" | ||
33 | set guioptions "s" | ||
34 | |||
35 | set font "Input 10" | ||
36 | |||
37 | ' > ~/.config/zathura/zathurarc | ||