Merge branch 'master' of github.com:LukeSmithxyz/voidrice into chambln-refactor
This commit is contained in:
commit
ae8929205e
17 changed files with 32 additions and 31 deletions
|
@ -18,7 +18,7 @@ mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)"
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
# Start workspaces on the main monitor.
|
# 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
|
bspc desktop -f 1
|
||||||
|
|
||||||
# If you want a multi-monitor display or something else, I leave that to you to
|
# 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
|
bspc rule -a Zathura state=tiled
|
||||||
|
|
||||||
dropdownname="dropdown"
|
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 hidden=on
|
||||||
bspc rule -a St:$dropdownname sticky=on
|
bspc rule -a St:$dropdownname sticky=on
|
||||||
bspc rule -a St:$dropdownname state=floating
|
bspc rule -a St:$dropdownname state=floating
|
||||||
|
|
|
@ -13,7 +13,7 @@ if ! echo "$mainmonitor" | grep LVDS >/dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start workspaces on the main monitor.
|
# 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
|
bspc desktop -f 1
|
||||||
|
|
||||||
# If you want a multi-monitor display or something else, I leave that to you to
|
# 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
|
bspc config focus_follows_pointer true
|
||||||
|
|
||||||
dropdownname="dropdown"
|
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 hidden=on
|
||||||
bspc rule -a St:$dropdownname sticky=on
|
bspc rule -a St:$dropdownname sticky=on
|
||||||
bspc rule -a St:$dropdownname state=floating
|
bspc rule -a St:$dropdownname state=floating
|
||||||
|
|
|
@ -88,9 +88,9 @@ case "$extension" in
|
||||||
try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;;
|
try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;;
|
||||||
# HTML Pages:
|
# HTML Pages:
|
||||||
htm|html|xhtml)
|
htm|html|xhtml)
|
||||||
try w3m -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 lynx -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
|
||||||
try elinks -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
|
;; # fall back to highlight/cat if the text browsers fail
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
# Toggles all cronjobs off/on.
|
# Toggles all cronjobs off/on.
|
||||||
# Stores disabled crontabs in ~/.consaved until restored.
|
# 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.")
|
||||||
|
|
|
@ -7,7 +7,7 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit
|
||||||
|
|
||||||
/usr/bin/notify-send "📰 Updating RSS feeds..."
|
/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
|
echo 🔃 > /tmp/newsupdate
|
||||||
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
|
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
|
||||||
|
|
|
@ -18,10 +18,10 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
|
||||||
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
|
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
|
||||||
tail -n 1 | awk '{print $1}')
|
tail -n 1 | awk '{print $1}')
|
||||||
|
|
||||||
res_ext_x=$(echo $res_external | sed 's/x.*//')
|
res_ext_x=$(echo "$res_external" | sed 's/x.*//')
|
||||||
res_ext_y=$(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_x=$(echo "$res_internal" | sed 's/x.*//')
|
||||||
res_int_y=$(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_x=$(echo "$res_ext_x / $res_int_x" | bc -l)
|
||||||
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
|
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
|
||||||
|
@ -53,7 +53,7 @@ multimon() { # Multi-monitor handler.
|
||||||
esac ;}
|
esac ;}
|
||||||
|
|
||||||
onescreen() { # If only one output available or chosen.
|
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.
|
postrun() { # Stuff to run to clean up.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/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:"
|
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
|
||||||
|
|
|
@ -18,5 +18,5 @@ case "$1" in
|
||||||
setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
||||||
*)
|
*)
|
||||||
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $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
|
esac
|
||||||
|
|
|
@ -6,5 +6,5 @@
|
||||||
# (with other things) by default and is used in some other places.
|
# (with other things) by default and is used in some other places.
|
||||||
|
|
||||||
for i in $(ls /tmp/mpvSockets/*); do
|
for i in $(ls /tmp/mpvSockets/*); do
|
||||||
echo '{ "command": ["set_property", "pause", true] }' | socat - $i;
|
echo '{ "command": ["set_property", "pause", true] }' | socat - "$i";
|
||||||
done
|
done
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
# entr command to run `queueandnotify` when newsboat queue is changed
|
# 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
|
||||||
|
|
|
@ -6,7 +6,7 @@ base="$(basename "$1")"
|
||||||
notify-send "⏳ Queuing $base..."
|
notify-send "⏳ Queuing $base..."
|
||||||
cmd="$2"
|
cmd="$2"
|
||||||
[ -z "$cmd" ] && cmd="youtube-dl --add-metadata"
|
[ -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")"
|
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
|
||||||
tsp -D "$idnum" mv "$base" "$realname"
|
tsp -D "$idnum" mv "$base" "$realname"
|
||||||
tsp -D "$idnum" notify-send "👍 $realname done."
|
tsp -D "$idnum" notify-send "👍 $realname done."
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
|
|
||||||
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
||||||
base="$(basename "$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; }"
|
||||||
|
|
|
@ -28,7 +28,7 @@ printprices() { # Print/format all prices
|
||||||
for x in "$dir"/*; do
|
for x in "$dir"/*; do
|
||||||
[ -f "$x" ] || break
|
[ -f "$x" ] || break
|
||||||
info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")"
|
info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")"
|
||||||
printf "%s$%0.2f " $info
|
printf "%s$%0.2f " "$info"
|
||||||
done | sed 's/ $/\n/'
|
done | sed 's/ $/\n/'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# The clickable help menu. Middle click to restart wm.
|
# The clickable help menu. Middle click to restart wm.
|
||||||
|
|
||||||
# If dwm is running, use dwm's readme and restart.
|
# 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
|
READMEFILE=/usr/local/share/dwm/larbs.mom
|
||||||
restartwm() { pkill -HUP dwm ;} ||
|
restartwm() { pkill -HUP dwm ;} ||
|
||||||
restartwm() { i3 restart ;}
|
restartwm() { i3 restart ;}
|
||||||
|
|
|
@ -14,4 +14,4 @@ case $BLOCK_BUTTON in
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
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)"
|
||||||
|
|
|
@ -6,17 +6,18 @@
|
||||||
# If we have internet, get a weather report from wttr.in and store it locally.
|
# If we have internet, get a weather report from wttr.in and store it locally.
|
||||||
# You could set up a shell alias to view the full file in a pager in the
|
# You could set up a shell alias to view the full file in a pager in the
|
||||||
# terminal if desired. This function will only be run once a day when needed.
|
# terminal if desired. This function will only be run once a day when needed.
|
||||||
getforecast() { curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;}
|
weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport"
|
||||||
|
getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
|
||||||
|
|
||||||
# Some very particular and terse stream manipulation. We get the maximum
|
# Some very particular and terse stream manipulation. We get the maximum
|
||||||
# precipication chance and the daily high and low from the downloaded file and
|
# precipication chance and the daily high and low from the downloaded file and
|
||||||
# display them with coresponding emojis.
|
# display them with coresponding emojis.
|
||||||
showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" |
|
showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" |
|
||||||
grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')"
|
grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')"
|
||||||
sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
|
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid -f "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" ;;
|
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
|
||||||
2) getforecast && showweather ;;
|
2) getforecast && showweather ;;
|
||||||
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
|
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
|
||||||
- Middle click to update forecast.
|
- Middle click to update forecast.
|
||||||
|
@ -28,7 +29,7 @@ esac
|
||||||
|
|
||||||
# The test if our forcecast is updated to the day. If it isn't download a new
|
# The test if our forcecast is updated to the day. If it isn't download a new
|
||||||
# weather report from wttr.in with the above function.
|
# weather report from wttr.in with the above function.
|
||||||
[ "$(stat -c %y "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
[ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||||
getforecast
|
getforecast
|
||||||
|
|
||||||
showweather
|
showweather
|
||||||
|
|
|
@ -18,4 +18,4 @@ cmds="\
|
||||||
|
|
||||||
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
|
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
|
||||||
|
|
||||||
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`
|
echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-
|
||||||
|
|
Loading…
Reference in a new issue