From a876f3788efd2f2d08aefface2ea7e01abfbd094 Mon Sep 17 00:00:00 2001 From: Alexei Syssoyev <34723727+AlexSyssoyev@users.noreply.github.com> Date: Sun, 31 May 2020 16:06:59 -0300 Subject: [PATCH 01/12] Another lol fix (#670) --- .local/bin/linkhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 931dd6dc..923a3f93 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -18,5 +18,5 @@ case "$1" in setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;; *) if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" - else setsid -f $BROWSER "$1" >/dev/null 2>&1 fi ;; + else setsid -f $BROWSER "$1" >/dev/null 2>&1; fi ;; esac From 37ea7a555269a92d524bf78d492e4ebc64a133d0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 31 May 2020 15:18:41 -0400 Subject: [PATCH 02/12] old scripts cleanup --- .config/i3/config | 2 +- .local/bin/lmc | 28 ---------------------------- .local/bin/showclip | 10 ---------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100755 .local/bin/lmc delete mode 100755 .local/bin/showclip diff --git a/.config/i3/config b/.config/i3/config index ed7e7a59..5553699c 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -62,7 +62,7 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode bindsym $mod+Shift+Delete exec --no-startup-id pulsemixer --mute ; exec --no-startup-id mpc pause && pkill -RTMIN+10 i3blocks ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e lf # Show selection: -bindsym $mod+Insert exec --no-startup-id showclip +bindsym $mod+Insert exec --no-startup-id notify-send "📋 Clipboard contents:" "$(xclip -o -selection clipboard)" ##bindsym $mod+Pause # #---Letter Key Bindings---# # diff --git a/.local/bin/lmc b/.local/bin/lmc deleted file mode 100755 index d4314952..00000000 --- a/.local/bin/lmc +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -NUM="${2:-5}" - -# Uncomment the following line to use Pulseaudio. -# PULSE=true - -if [ "$PULSE" ]; then - toggle() { pulsemixer --toggle-mute ;} - mute() { pulsemixer --mute ;} - up() { pulsemixer --change-volume +"$NUM" ;} - down() { pulsemixer --change-volume -"$NUM" ;} - control() { pulsemixer ;} -else - toggle() { amixer sset Master toggle ;} - mute() { amixer sset Master mute ;} - up() { amixer sset Master "$NUM"%+ ;} - down() { amixer sset Master "$NUM"%- ;} - control() { alsamixer ;} -fi - -case "$1" in - toggle) toggle ;; - mute) mute ;; - up) up ;; - down) down ;; - control) control ;; -esac diff --git a/.local/bin/showclip b/.local/bin/showclip deleted file mode 100755 index d2faff8b..00000000 --- a/.local/bin/showclip +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Display contents of selection via dunst if running. -# Separate script for i3. - -clip=$(xclip -o -selection clipboard) -prim=$(xclip -o -selection primary) - -[ -n "$clip" ] && notify-send "Clipboard:" "$clip" -[ -n "$prim" ] && notify-send "Primary:" "$prim" From ad161d9363aadeb9f4ec3c852ca6c96162f2b4b0 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sun, 31 May 2020 23:09:02 +0200 Subject: [PATCH 03/12] fixes issue #663 , i3block break (#675) i3block wont break with this --- .local/bin/statusbar/music | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 6bd44e5e..faba0c33 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -2,7 +2,7 @@ filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ';} -pidof -x mpdup >/dev/null 2>&1 || mpdup & +pidof -x mpdup >/dev/null 2>&1 || mpdup >/dev/null 2>&1 & case $BLOCK_BUTTON in 1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # right click, pause/unpause From e7a91dd8838f58601e9be38530bc9f43ac516961 Mon Sep 17 00:00:00 2001 From: Lucas Budde Mior Date: Mon, 1 Jun 2020 00:43:46 +0000 Subject: [PATCH 04/12] Use only awk in shortcuts script --- .local/bin/shortcuts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 19d3ffd4..c0b7d075 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Output locations. Unactivated progs should go to /dev/null. +Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" ranger_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf" @@ -15,15 +15,17 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ - >(awk '{print "hash -d "$1"="$2}' >> "$zsh_named_dirs") \ - >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ - >(awk '{print "map g" $1, ":cd", $2 "\nmap t" $1, ":cd", $2 "\nmap M" $1, ":cd", $2 ":mo\nmap Y" $1, ":cd", $2 ":co" }' >> "$vifm_shortcuts") \ - >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ - | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" +awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); + printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; + printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; + printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; + printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; + printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" # Format the `files` file in the correct syntax and sent it to both configs. -sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:-$HOME/.config}/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ - >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ - >(awk '{print "map", $1, ":e", $2 "" }' >> "$vifm_shortcuts") \ - | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" +awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); + printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; + printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; + printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/files" From 49084aa9f02b5790905fbfc84d2c8ca568ed9141 Mon Sep 17 00:00:00 2001 From: Lucas Budde Mior Date: Mon, 1 Jun 2020 00:51:12 +0000 Subject: [PATCH 05/12] Comment on shortcuts properly commented --- .local/bin/shortcuts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index c0b7d075..cc52d7a9 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,6 +1,6 @@ #!/usr/bin/env bash -Output locations. Unactivated progs should go to /dev/null. +# Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" ranger_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf" From 4e683c6fdc5abbf869d60b6dd6162fc3785b46d3 Mon Sep 17 00:00:00 2001 From: Lucas Budde Mior Date: Sun, 31 May 2020 22:16:50 -0300 Subject: [PATCH 06/12] now shortcuts is posix compliant, so #!/bin/sh --- .local/bin/shortcuts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index cc52d7a9..15ef2980 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" @@ -16,16 +16,16 @@ printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; - printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; - printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; + printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; + printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; + printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" # Format the `files` file in the correct syntax and sent it to both configs. awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; - printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; - printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/files" + printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; + printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; + printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/files" From 16e228f3cc5e0ff47fe385e3b58eb621d8a26c14 Mon Sep 17 00:00:00 2001 From: Lucas Budde Mior Date: Sun, 31 May 2020 22:59:24 -0300 Subject: [PATCH 07/12] comments on shortcuts fixed --- .local/bin/shortcuts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 15ef2980..6d252316 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -15,7 +15,7 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); +awk "!/^\s*#/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; @@ -24,7 +24,7 @@ awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" # Format the `files` file in the correct syntax and sent it to both configs. -awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); +awk "!/^\s*#/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; From 00bf44782de6c1d6b43fe071d4e182376620acd7 Mon Sep 17 00:00:00 2001 From: Lucas Budde Mior Date: Sun, 31 May 2020 22:59:24 -0300 Subject: [PATCH 08/12] comments on shortcuts fixed --- .local/bin/shortcuts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 15ef2980..80cd4fff 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -15,7 +15,7 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; @@ -24,7 +24,7 @@ awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" # Format the `files` file in the correct syntax and sent it to both configs. -awk "!/^\s*$/{gsub(\"\\\s*#.*$\",\"\"); +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; From 63a7f762d7811fa3a8b47363f208530801c209d6 Mon Sep 17 00:00:00 2001 From: Lucas Budde Mior Date: Mon, 1 Jun 2020 00:22:52 -0300 Subject: [PATCH 09/12] escaped dollar sign on shortcuts --- .local/bin/shortcuts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 80cd4fff..4bdaf055 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -15,7 +15,7 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*\$\",\"\"); printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; @@ -24,7 +24,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" # Format the `files` file in the correct syntax and sent it to both configs. -awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*\$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; From 42187933e071d1e97717d1a3837399a74d375953 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 31 May 2020 23:30:05 -0400 Subject: [PATCH 10/12] trailing whitespace fix --- .local/bin/shortcuts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 4bdaf055..ed4f89f9 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -6,7 +6,7 @@ zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" ranger_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" -vifm_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/vifm/vifmshortcuts" +vifm_shortcuts="/dev/null" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null @@ -15,8 +15,8 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*\$\",\"\"); - printf(\"%s=\42cd %s && ls -a\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); + printf(\"%s=\42cd %s && ls -a\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; @@ -24,8 +24,8 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*\$\",\"\"); printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" # Format the `files` file in the correct syntax and sent it to both configs. -awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*\$\",\"\"); - printf(\"%s=\42\$EDITOR %s\42 \\\ \n\",\$1,\$2) >> \"$shell_shortcuts\" ; +awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); + printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/files" From 87b0754319a00648cd20b7f013cc821868f6d25e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 1 Jun 2020 11:30:28 -0400 Subject: [PATCH 11/12] just let it be swallowed --- .config/lf/lfrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 1b30ae90..1a8442f6 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -18,7 +18,7 @@ cmd open ${{ image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*) $EDITOR $fx;; image/x-xcf|image/svg+xml) setsid -f gimp $f >/dev/null 2>&1 ;; - image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\)\(_large\)*$" | setsid -f sxiv -aio 2>/dev/null | lf-select ;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;; audio/*) mpv --audio-display=no $f ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; From f820ccf4dd69d4cf784fca4fc0e1ae273993077e Mon Sep 17 00:00:00 2001 From: JameyBear Date: Mon, 1 Jun 2020 15:29:57 -0400 Subject: [PATCH 12/12] Shellcheck (#676) Co-authored-by: WhispersOfJ --- .config/bspwm/bspwm/bspwmrc | 4 ++-- .config/bspwm/bspwmrc | 4 ++-- .config/ranger/scope.sh | 6 +++--- .local/bin/cron/crontog | 2 +- .local/bin/cron/newsup | 2 +- .local/bin/displayselect | 10 +++++----- .local/bin/getkeys | 4 ++-- .local/bin/linkhandler | 2 +- .local/bin/pauseallmpv | 2 +- .local/bin/podentr | 4 ++-- .local/bin/qndl | 2 +- .local/bin/rotdir | 2 +- .local/bin/statusbar/crypto | 2 +- .local/bin/statusbar/help-icon | 2 +- .local/bin/statusbar/news | 2 +- .local/bin/sysact | 2 +- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.config/bspwm/bspwm/bspwmrc b/.config/bspwm/bspwm/bspwmrc index 71c1a34f..f0d48091 100755 --- a/.config/bspwm/bspwm/bspwmrc +++ b/.config/bspwm/bspwm/bspwmrc @@ -18,7 +18,7 @@ mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)" # fi # Start workspaces on the main monitor. -bspc monitor $mainmonitor -d 1 2 3 4 5 6 7 8 9 10 +bspc monitor "$mainmonitor" -d 1 2 3 4 5 6 7 8 9 10 bspc desktop -f 1 # If you want a multi-monitor display or something else, I leave that to you to @@ -32,7 +32,7 @@ bspc config focus_follows_pointer true bspc rule -a Zathura state=tiled dropdownname="dropdown" -bspc query -N -n .hidden >/dev/null || setsid -f $TERMINAL -n "$dropdownname" -e dropdown >/dev/null 2>&1 +bspc query -N -n .hidden >/dev/null || setsid -f "$TERMINAL" -n "$dropdownname" -e dropdown >/dev/null 2>&1 bspc rule -a St:$dropdownname hidden=on bspc rule -a St:$dropdownname sticky=on bspc rule -a St:$dropdownname state=floating diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 95ff5db8..36b9abcc 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -13,7 +13,7 @@ if ! echo "$mainmonitor" | grep LVDS >/dev/null 2>&1; then fi # Start workspaces on the main monitor. -bspc monitor $mainmonitor -d 1 2 3 4 5 6 7 8 9 10 +bspc monitor "$mainmonitor" -d 1 2 3 4 5 6 7 8 9 10 bspc desktop -f 1 # If you want a multi-monitor display or something else, I leave that to you to @@ -26,7 +26,7 @@ bspc config top_padding 24 # top_padding I set equal to polybar's height bspc config focus_follows_pointer true dropdownname="dropdown" -bspc query -N -n .hidden >/dev/null || setsid -f $TERMINAL -n "$dropdownname" -e dropdown >/dev/null 2>&1 +bspc query -N -n .hidden >/dev/null || setsid -f "$TERMINAL" -n "$dropdownname" -e dropdown >/dev/null 2>&1 bspc rule -a St:$dropdownname hidden=on bspc rule -a St:$dropdownname sticky=on bspc rule -a St:$dropdownname state=floating diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh index cce86cf9..174ba17c 100755 --- a/.config/ranger/scope.sh +++ b/.config/ranger/scope.sh @@ -88,9 +88,9 @@ case "$extension" in try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; # HTML Pages: htm|html|xhtml) - try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } - try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } - try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try w3m -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; } + try lynx -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; } + try elinks -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; } ;; # fall back to highlight/cat if the text browsers fail esac diff --git a/.local/bin/cron/crontog b/.local/bin/cron/crontog index 8168012e..5aba5e65 100755 --- a/.local/bin/cron/crontog +++ b/.local/bin/cron/crontog @@ -3,4 +3,4 @@ # Toggles all cronjobs off/on. # Stores disabled crontabs in ~/.consaved until restored. -([ -f ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved ] && crontab - < ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && rm ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") +([ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved ] && crontab - < "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && rm "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > "${XDG_CONFIG_HOME:-$HOME/.config}"/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index bf8898ea..94cfd873 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -7,7 +7,7 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit /usr/bin/notify-send "📰 Updating RSS feeds..." -ps ax | grep -q newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit +pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit echo 🔃 > /tmp/newsupdate pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 1c611033..890363c2 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -18,10 +18,10 @@ twoscreen() { # If multi-monitor is selected and there are two screens. res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \ tail -n 1 | awk '{print $1}') - res_ext_x=$(echo $res_external | sed 's/x.*//') - res_ext_y=$(echo $res_external | sed 's/.*x//') - res_int_x=$(echo $res_internal | sed 's/x.*//') - res_int_y=$(echo $res_internal | sed 's/.*x//') + res_ext_x=$(echo "$res_external" | sed 's/x.*//') + res_ext_y=$(echo "$res_external" | sed 's/.*x//') + res_int_x=$(echo "$res_internal" | sed 's/x.*//') + res_int_y=$(echo "$res_internal" | sed 's/.*x//') scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l) scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l) @@ -53,7 +53,7 @@ multimon() { # Multi-monitor handler. esac ;} onescreen() { # If only one output available or chosen. - xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ') + xrandr --output "$1" --auto --scale 1.0x1.0 "$(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ')" } postrun() { # Stuff to run to clean up. diff --git a/.local/bin/getkeys b/.local/bin/getkeys index 0a0e86e1..266f29a6 100755 --- a/.local/bin/getkeys +++ b/.local/bin/getkeys @@ -1,5 +1,5 @@ #!/bin/sh -cat ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/getkeys/"$1" 2>/dev/null && exit +cat "${XDG_DATA_HOME:-$HOME/.local/share}"/larbs/getkeys/"$1" 2>/dev/null && exit echo "Run command with one of the following arguments for info about that program:" -ls ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/getkeys +ls "${XDG_DATA_HOME:-$HOME/.local/share}"/larbs/getkeys diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 923a3f93..e720641a 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -18,5 +18,5 @@ case "$1" in setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;; *) if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" - else setsid -f $BROWSER "$1" >/dev/null 2>&1; fi ;; + else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi ;; esac diff --git a/.local/bin/pauseallmpv b/.local/bin/pauseallmpv index 15b9f599..d69a4146 100755 --- a/.local/bin/pauseallmpv +++ b/.local/bin/pauseallmpv @@ -6,5 +6,5 @@ # (with other things) by default and is used in some other places. for i in $(ls /tmp/mpvSockets/*); do - echo '{ "command": ["set_property", "pause", true] }' | socat - $i; + echo '{ "command": ["set_property", "pause", true] }' | socat - "$i"; done diff --git a/.local/bin/podentr b/.local/bin/podentr index 9a8313ab..9454b07f 100755 --- a/.local/bin/podentr +++ b/.local/bin/podentr @@ -2,6 +2,6 @@ # entr command to run `queueandnotify` when newsboat queue is changed -[ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit +[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit -echo ${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue | entr -p queueandnotify 2>/dev/null +echo "${XDG_DATA_HOME:-$HOME/.local/share}"/newsboat/queue | entr -p queueandnotify 2>/dev/null diff --git a/.local/bin/qndl b/.local/bin/qndl index f5bd14f2..2236c66d 100755 --- a/.local/bin/qndl +++ b/.local/bin/qndl @@ -6,7 +6,7 @@ base="$(basename "$1")" notify-send "⏳ Queuing $base..." cmd="$2" [ -z "$cmd" ] && cmd="youtube-dl --add-metadata" -idnum="$(tsp $cmd "$1")" +idnum="$(tsp "$cmd" "$1")" realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")" tsp -D "$idnum" mv "$base" "$realname" tsp -D "$idnum" notify-send "👍 $realname done." diff --git a/.local/bin/rotdir b/.local/bin/rotdir index 7313a424..7d320409 100755 --- a/.local/bin/rotdir +++ b/.local/bin/rotdir @@ -9,4 +9,4 @@ [ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 base="$(basename "$1")" - ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }" +find "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }" diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index bb19fc94..ef025d49 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -28,7 +28,7 @@ printprices() { # Print/format all prices for x in "$dir"/*; do [ -f "$x" ] || break info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")" - printf "%s$%0.2f " $info + printf "%s$%0.2f " "$info" done | sed 's/ $/\n/' } diff --git a/.local/bin/statusbar/help-icon b/.local/bin/statusbar/help-icon index 9c90964a..5044324b 100755 --- a/.local/bin/statusbar/help-icon +++ b/.local/bin/statusbar/help-icon @@ -3,7 +3,7 @@ # The clickable help menu. Middle click to restart wm. # If dwm is running, use dwm's readme and restart. -ps ax | grep -q "\sdwm$" && +pgrep -f "\sdwm$" && READMEFILE=/usr/local/share/dwm/larbs.mom restartwm() { pkill -HUP dwm ;} || restartwm() { i3 restart ;} diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index b414981e..e9975972 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰" $1}' | sed 's/^📰0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰" $1}' | sed 's/^📰0$//g')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/sysact b/.local/bin/sysact index 0a7cdd02..ce925ce1 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -18,4 +18,4 @@ cmds="\ choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 -`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-` +echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-