From 165f25c3eb9f15af8587663de509ec89053ac307 Mon Sep 17 00:00:00 2001 From: Jonatan6 Date: Wed, 10 Feb 2021 17:47:30 +0100 Subject: [PATCH 001/102] make it possible to change the font for text slides I set free-sans to be the default, because it seems that that is what imagemagick is uses, when you don't specify a font. --- .local/bin/slider | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.local/bin/slider b/.local/bin/slider index d8d87b17..cb9a8812 100755 --- a/.local/bin/slider +++ b/.local/bin/slider @@ -12,6 +12,7 @@ cache="${XDG_CACHE_HOME:-$HOME/.cache}/slider" while getopts "hvrpi:c:a:o:d:f:t:e:x:" o; do case "${o}" in c) bgc="$OPTARG" ;; t) fgc="$OPTARG" ;; + f) font="$OPTARG" ;; i) file="$OPTARG" ;; a) audio="$OPTARG" ;; o) outfile="$OPTARG" ;; @@ -34,6 +35,7 @@ while getopts "hvrpi:c:a:o:d:f:t:e:x:" o; do case "${o}" in -c color of background (use html names, black is default) -t text color for text slides (white is default) -s text font size for text slides (150 is default) + -f text font for text slides (FreeSans is default) -o output video file -e if no audio given, the time in seconds that the last slide will be shown (5 is default) -x resolution (1920x1080 is default) @@ -96,7 +98,7 @@ do convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" else { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && - convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" + convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-FreeSans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" fi # If the first line, do not write yet. From 4bf6941b871b70e19951536a90ab3aacacce29ae Mon Sep 17 00:00:00 2001 From: memreyagci Date: Sun, 21 Feb 2021 16:10:28 +0100 Subject: [PATCH 002/102] Deleted the .xinitrc link at $HOME for even a cleaner home directory. A custom filename and directory can be specified with startx command, which in this case is $XINITRC variable that indicates $XDG_CONFIG_HOME/x11/xinitrc --- .config/shell/profile | 4 ++-- .xinitrc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 120000 .xinitrc diff --git a/.config/shell/profile b/.config/shell/profile index 06831cbb..f6b14265 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -19,7 +19,7 @@ export BROWSER="brave" export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" -#export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc" +export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc" #export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config" export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0" @@ -142,7 +142,7 @@ ex=🎯:\ if pacman -Qs libxft-bgra >/dev/null 2>&1; then # Start graphical server on user's current tty if not already running. - [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx + [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx $XINITRC else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: diff --git a/.xinitrc b/.xinitrc deleted file mode 120000 index 518bb5db..00000000 --- a/.xinitrc +++ /dev/null @@ -1 +0,0 @@ -.config/x11/xinitrc \ No newline at end of file From bc553f06be4635ad24ee3cc499523050a4ed389d Mon Sep 17 00:00:00 2001 From: narukeh Date: Fri, 5 Mar 2021 15:43:44 +0100 Subject: [PATCH 003/102] fix sb-forecast --- .local/bin/statusbar/sb-forecast | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 6652edd2..1c9c0ff7 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -6,6 +6,7 @@ # 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 # terminal if desired. This function will only be run once a day when needed. +LOCATION='' weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} @@ -14,7 +15,7 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')" -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 "°"}' ;} +sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;} case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;; From 6bbaa969033b6e4d5ae7a18fde754f7323c7e4cb Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 7 Mar 2021 15:06:57 -0500 Subject: [PATCH 004/102] fix --- .local/bin/statusbar/sb-forecast | 1 - 1 file changed, 1 deletion(-) diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 1c9c0ff7..7b8416ec 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -6,7 +6,6 @@ # 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 # terminal if desired. This function will only be run once a day when needed. -LOCATION='' weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} From f47e40243f2774f68bfa02ebee9289b0ce26564b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 7 Mar 2021 15:07:41 -0500 Subject: [PATCH 005/102] clean up --- .local/bin/cron/cronbat | 9 ------ .local/bin/statusbar/sb-crypto | 54 ---------------------------------- .local/share/larbs/getkeys/i3 | 48 ------------------------------ FUNDING.yml | 2 +- 4 files changed, 1 insertion(+), 112 deletions(-) delete mode 100755 .local/bin/cron/cronbat delete mode 100755 .local/bin/statusbar/sb-crypto delete mode 100644 .local/share/larbs/getkeys/i3 diff --git a/.local/bin/cron/cronbat b/.local/bin/cron/cronbat deleted file mode 100755 index bd953c7a..00000000 --- a/.local/bin/cron/cronbat +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Notify me with notify-send if my battery is below 25%. -# You can set this to run via cron. - -[ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit -[ "$(cat /sys/class/power_supply/BAT0/capacity)" -lt 25 ] && -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus && -notify-send -u critical "Battery critically low." diff --git a/.local/bin/statusbar/sb-crypto b/.local/bin/statusbar/sb-crypto deleted file mode 100755 index 94ed9496..00000000 --- a/.local/bin/statusbar/sb-crypto +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# Shows the price for desired cryptocurrencies. Module updates automatically -# every calendar day, but can also be updated with a middle click. - -# Currencies should be ;-separated: -# human-readable name;urlname;icon -coins="Bitcoin;btc;💰 -Etherium;eth;🍸 -Basic Attention Token;bat;🦁 -LBC;lbc;📚" - -# Directory where currency info is stored. -dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" - -getprices() { # The command to get the desired prices - printf "🔃 "; printprices - { rm -rf "${dir:?}/*" - echo "$coins" | while IFS=';' read -r human web icon; do - val="$(curl -s "rate.sx/1$web")" && - echo "$icon;$val;$human" > "$dir/$web" - done; [ -d "$dir" ] && touch "$dir" - pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" ;} & - exit - } - -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" - done | sed 's/ $/\n/' - } - -[ ! -d "$dir" ] && mkdir -p "$dir" && { getprices; exit ;} - -# If currencies haven't been updated today, try to update them. -[ "$(stat -c %x "$HOME/.local/share/crypto-prices" | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && - { ping -q -c 1 example.org >/dev/null 2>&1 && getprices || exit ;} - -case $BLOCK_BUTTON in - 1) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")" - notify-send "Exact prices in USD" "$(awk -F';' '{print $1, $3 ":\n\t$" $2}' "$dir"/*) -Last updated: - $uptime" ;; - 2) getprices ;; - 3) notify-send "💸 Crypto-currency module" "\- Left click for exact prices. -- Middle click to update. -- Shows 🔃 if updating prices. -- Manually add/remove currencies to list in the script." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -printprices diff --git a/.local/share/larbs/getkeys/i3 b/.local/share/larbs/getkeys/i3 deleted file mode 100644 index 695744ae..00000000 --- a/.local/share/larbs/getkeys/i3 +++ /dev/null @@ -1,48 +0,0 @@ - _ _____ -(_)___ / -| | |_ \ -| |___) | -|_|____/ -i3 is the window manager. -For a full readme, press super+F1. -This is a partial key list. - esc left workspace exit i3 - tab last workspace - - - vol -- vol - _ - vol -- vol - = + vol ++ vol - + + vol ++ vol - q kill win kill win - w nmtui (wlan) browser - e neomutt tutorials - r ranger winresize - t toggle hor/vert gaps=15px - y calcurse resize left - u dropdown term resize down - i htop resize up - o sticky win resize right - p pause music pause A/V - [ back 10 secs back 2 min - ] forward 10 secs forward 2 min - \ last workspace - a calculator audio control - s + inner gaps - inner gaps - d dmenu remove gaps - f fullscreen freeze mode - g left workspace GIMP - h focus left move win left - j focus down move win down - k focus up move win up - l focus right move win right - ; right workspace - ' fast right win - z + outer gaps - outer gaps - x lock screen shutdown - c webcam - v open Vimwiki - b bar on/off stick/float win (left) - n newsboat stick/float win (right) - m ncmpcpp mute audio - , < previous song restart song - . > next song - / ? fast win below kill win diff --git a/FUNDING.yml b/FUNDING.yml index ec61a8bc..c7c9a22e 100644 --- a/FUNDING.yml +++ b/FUNDING.yml @@ -1,2 +1,2 @@ -custom: ["https://lukesmith.xyz/donate.html", "https://lukesmith.xyz/crypto.html"] +custom: ["https://lukesmith.xyz/donate.html"] github: lukesmithxyz From deecc427071e013dc3a9af949334dd412d010dae Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 7 Mar 2021 15:40:43 -0500 Subject: [PATCH 006/102] startx alias --- .config/shell/aliasrc | 4 ++++ .config/shell/profile | 2 +- .config/x11/xprofile | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 1b0e8359..6ad7a8bd 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -3,11 +3,15 @@ # Use neovim for vim if present. [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" +# Use $XINITRC variable if file exists. +[ -f "$XINITRC" ] && alias startx="startx $XINITRC" + # Verbosity and settings that you pretty much just always are going to want. alias \ cp="cp -iv" \ mv="mv -iv" \ rm="rm -vI" \ + bc="bc -ql" \ mkd="mkdir -pv" \ yt="youtube-dl --add-metadata -i" \ yta="yt -x -f bestaudio/best" \ diff --git a/.config/shell/profile b/.config/shell/profile index f6b14265..d0754183 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -142,7 +142,7 @@ ex=🎯:\ if pacman -Qs libxft-bgra >/dev/null 2>&1; then # Start graphical server on user's current tty if not already running. - [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx $XINITRC + [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC" else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: diff --git a/.config/x11/xprofile b/.config/x11/xprofile index b4db27bd..f7182e19 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -3,10 +3,10 @@ # This file runs when a DM logs you into a graphical session. # If you use startx/xinit like a Chad, this file will also be sourced. -mpd & # music player daemon-you might prefer it as a service though -remaps & # run the remaps script, switching caps/esc and more; check it for more info setbg & # set the background with the `setbg` script #xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Uncomment to use Xresources colors/settings on startup +mpd & # music player daemon-you might prefer it as a service though +remaps & # run the remaps script, switching caps/esc and more; check it for more info xcompmgr & # xcompmgr for transparency dunst & # dunst for notifications xset r rate 300 50 & # Speed xrate up From 284b1078cb6231863244a1355dd08cd81be279a6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 7 Mar 2021 15:44:52 -0500 Subject: [PATCH 007/102] minor tweaks, electrum and mbsync to ~/.config --- .config/nvim/init.vim | 6 +++--- .config/shell/aliasrc | 6 +++++- .config/shell/profile | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 65883d7b..ce0db87f 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -113,13 +113,13 @@ set noshowcmd " Automatically deletes all trailing whitespace and newlines at end of file on save. autocmd BufWritePre * %s/\s\+$//e - autocmd BufWritePre * %s/\n\+\%$//e - autocmd BufWritePre *.[ch] %s/\%$/\r/e + autocmd BufWritePre * %s/\n\+\%$//e + autocmd BufWritePre *.[ch] %s/\%$/\r/e " When shortcut files are updated, renew bash and ranger configs with new material: autocmd BufWritePost bm-files,bm-dirs !shortcuts " Run xrdb whenever Xdefaults or Xresources are updated. - autocmd BufRead,BufNewFile xresources,xdefaults set filetype=xdefaults + autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb % " Recompile dwmblocks on config edit. autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks } diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 6ad7a8bd..107ecb8c 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -6,6 +6,11 @@ # Use $XINITRC variable if file exists. [ -f "$XINITRC" ] && alias startx="startx $XINITRC" +# sudo not required for some system commands +for x in mount umount sv pacman updatedb su ; do + alias $x="sudo $x" +done + # Verbosity and settings that you pretty much just always are going to want. alias \ cp="cp -iv" \ @@ -31,7 +36,6 @@ alias \ trem="transmission-remote" \ YT="youtube-viewer" \ sdn="sudo shutdown -h now" \ - f="$FILE" \ e="$EDITOR" \ v="$EDITOR" \ p="sudo pacman" \ diff --git a/.config/shell/profile b/.config/shell/profile index d0754183..9515179d 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -40,6 +40,8 @@ export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison" export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history" export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat" +export MBSYNCRC="${XDG_CONFIG_HOME:-$HOME/.config}/mbsync/config" +export ELECTRUMDIR="${XDG_DATA_HOME:-$HOME/.local/share}/electrum" # Other program settings: export DICS="/usr/share/stardict/dic/" From 9666c78aef55c5f0d27d0433186e2d54f9643e06 Mon Sep 17 00:00:00 2001 From: Sahid Velji Date: Sun, 7 Mar 2021 15:46:26 -0500 Subject: [PATCH 008/102] Use g instead of gg in zathura (#900) --- .config/zathura/zathurarc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index f1bae202..452e1168 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -12,3 +12,4 @@ map K zoom in map J zoom out map i recolor map p print +map g goto top From 87c295003995ffdb071551ce0fe56307aadfdda8 Mon Sep 17 00:00:00 2001 From: Stephen Szwiec <55602870+StephenSzwiec@users.noreply.github.com> Date: Wed, 10 Mar 2021 06:19:47 -0600 Subject: [PATCH 009/102] Handle color control sequences (#911) * Handle color control sequences Is: `less` outputs the raw ascii of the $chartfile, which includes escape characters to change output colors. This does not resemble a graph. Should be: Adding -n flag to have `less` create colored output properly. * typo changed to -Srf to reflect proposed change --- .local/bin/statusbar/sb-price | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price index 45b01adb..35b072fa 100755 --- a/.local/bin/statusbar/sb-price +++ b/.local/bin/statusbar/sb-price @@ -21,7 +21,7 @@ updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 && updateprice "$1" case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;; + 1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;; 2) notify-send -u low "$3 Updating..." "Updating $2 price..." updateprice "$1" && notify-send "$3 Update complete." "$2 price is now \$$(cat "$pricefile")" ;; From 12d6d5ec80fd0dc9f113f6b91a3373857fcac014 Mon Sep 17 00:00:00 2001 From: skrrtskrrtman <50763036+skrrtskrrtman@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:30:01 +0800 Subject: [PATCH 010/102] add display off option (#920) mostly for laptops to save power --- .local/bin/sysact | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 9dc398bd..62fdd61a 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -14,7 +14,8 @@ cmds="\ ♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$") 🐻 hibernate slock ${hib:-systemctl suspend-then-hibernate -i} 🔃 reboot ${reb:-sudo -A reboot} -🖥 shutdown ${shut:-sudo -A shutdown -h now}" +🖥 shutdown ${shut:-sudo -A shutdown -h now} +📺 display off xset dpms force off" choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 From 622252cd3778b48ecb1bcebde4ecff86118f9e8b Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Mon, 29 Mar 2021 22:32:42 -0300 Subject: [PATCH 011/102] Extract, Set Hidden shortcuts (#910) --- .config/lf/lfrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index c5717243..b05d5114 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -29,6 +29,15 @@ cmd open ${{ cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" +cmd extract ${{ + clear; tput cup $(($(tput lines)/3)); tput bold + set -f + printf "%s\n\t" "$fx" + printf "extract?[y/N]" + read ans + [ $ans = "y" ] && ext $fx +}} + cmd delete ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f @@ -69,10 +78,12 @@ map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config} map gh map g top map D delete +map E extract map C copyto map M moveto map push :mkdir map reload +map set hidden! map shell map x $$f map X !$f From 2c7a3344693503a97195d3b637acb9b8e912d562 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 29 Mar 2021 21:36:47 -0400 Subject: [PATCH 012/102] neurtral default font --- .local/bin/slider | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/slider b/.local/bin/slider index cb9a8812..674781a4 100755 --- a/.local/bin/slider +++ b/.local/bin/slider @@ -35,7 +35,7 @@ while getopts "hvrpi:c:a:o:d:f:t:e:x:" o; do case "${o}" in -c color of background (use html names, black is default) -t text color for text slides (white is default) -s text font size for text slides (150 is default) - -f text font for text slides (FreeSans is default) + -f text font for text slides (sans serif is default) -o output video file -e if no audio given, the time in seconds that the last slide will be shown (5 is default) -x resolution (1920x1080 is default) @@ -98,7 +98,7 @@ do convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" else { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && - convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-FreeSans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" + convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" fi # If the first line, do not write yet. From b5821a2308a20de5ad867456a3e8a02b4681bdfd Mon Sep 17 00:00:00 2001 From: Roberto Polverelli Monti Date: Tue, 30 Mar 2021 01:39:55 +0000 Subject: [PATCH 013/102] `rssadd` improvement: additionally extract from xml files, not just urls (#885) * additionally extract from xml files Before this, rssadd only accepted a URL as argument. Now, if given an xml file, it will parse it and extract the proper url. This lets it be used in conjunction with firefox for quickly adding RSS feeds (as firefox would give it the file rather than its origin URL). This works on a majority of RSS feeds, but fails on some that miss the proper link tags. The original behaviour is still mantained alongside the new. * remove surplus `exit` * more performant grepping --- .local/bin/rssadd | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.local/bin/rssadd b/.local/bin/rssadd index 2ce421bd..fb60be88 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -1,10 +1,18 @@ #!/bin/sh -! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && - notify-send "That doesn't look like a full URL." && exit +if echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null; then + url="$1" +else + url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" | + sed -E 's_^.*href="(https?://[^"]+)".*$_\1_')" + + ! grep "https*://\S\+\.[A-Za-z]\+\S*" <<<"$url" && + notify-send "That doesn't look like a full URL." && exit 1 +fi + RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls" -if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then +if awk '{print $1}' "$RSSFILE" | grep "^$url$" >/dev/null; then notify-send "You already have this RSS feed." else - echo "$1" >> "$RSSFILE" && notify-send "RSS feed added." + echo "$url" >> "$RSSFILE" && notify-send "RSS feed added." fi From 9c5faeeb9541fb558fe317ffd3afecd4a7fbcd11 Mon Sep 17 00:00:00 2001 From: "M.Zeinali" Date: Tue, 30 Mar 2021 06:10:40 +0430 Subject: [PATCH 014/102] Add a noise reduction script (using sox and ffmpeg) (#850) * Create noisereduce * Update noisereduce * Update noisereduce --- .local/bin/noisereduce | 81 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .local/bin/noisereduce diff --git a/.local/bin/noisereduce b/.local/bin/noisereduce new file mode 100644 index 00000000..8d9598cd --- /dev/null +++ b/.local/bin/noisereduce @@ -0,0 +1,81 @@ +#!/usr/bin/sh + +usage () +{ + printf "Usage : noisereduce \n" + exit +} + +# Tests for requirements +ffmpeg -version >/dev/null || { echo >&2 "We require 'ffmpeg' but it's not installed. Install it by 'sudo apt-get install ffmpeg' Aborting."; exit 1; } +sox --version >/dev/null || { echo >&2 "We require 'sox' but it's not installed. Install it by 'sudo apt-get install sox' Aborting."; exit 1; } + +if [ "$#" -ne 2 ] +then + usage +fi + +if [ ! -e "$1" ] +then + printf "File not found: %s\n" "$1" + exit +fi + +if [ -e "$2" ] +then + printf "File %s already exists, overwrite? [y/N]\n: " "$2" + read -r yn + case $yn in + [Yy]* ) ;; + * ) exit;; + esac +fi + +inBasename=$(basename "$1") +inExt="${inBasename##*.}" + +isVideoStr=$(ffprobe -v warning -show_streams "$1" | grep codec_type=video) +if [ -n "$isVideoStr" ] +then + isVideo=1 + printf "Detected %s as a video file\n" "$inBasename" +else + isVideo=0 + printf "Detected %s as an audio file\n" "$inBasename" +fi + +printf "Sample noise start time [00:00:00]: " +read -r sampleStart +if [ -z "$sampleStart" ] ; then sampleStart="00:00:00"; fi +printf "Sample noise end time [00:00:00.900]: " +read -r sampleEnd +if [ -z "$sampleEnd" ] ; then sampleEnd="00:00:00.900"; fi +printf "Noise reduction amount [0.21]: " +read -r sensitivity +if [ -z "$sensitivity" ] ; then sensitivity="0.21"; fi + + +tmpVidFile="/tmp/noiseclean_tmpvid.$inExt" +tmpAudFile="/tmp/noiseclean_tmpaud.wav" +noiseAudFile="/tmp/noiseclean_noiseaud.wav" +noiseProfFile="/tmp/noiseclean_noise.prof" +tmpAudCleanFile="/tmp/noiseclean_tmpaud-clean.wav" + +printf "Cleaning noise on %s...\n" "$1" + +if [ $isVideo -eq "1" ]; then + ffmpeg -v warning -y -i "$1" -qscale:v 0 -vcodec copy -an "$tmpVidFile" + ffmpeg -v warning -y -i "$1" -qscale:a 0 "$tmpAudFile" +else + cp "$1" "$tmpAudFile" +fi +ffmpeg -v warning -y -i "$1" -vn -ss "$sampleStart" -t "$sampleEnd" "$noiseAudFile" +sox "$noiseAudFile" -n noiseprof "$noiseProfFile" +sox "$tmpAudFile" "$tmpAudCleanFile" noisered "$noiseProfFile" "$sensitivity" +if [ $isVideo -eq "1" ]; then + ffmpeg -v warning -y -i "$tmpAudCleanFile" -i "$tmpVidFile" -vcodec copy -qscale:v 0 -qscale:a 0 "$2" +else + cp "$tmpAudCleanFile" "$2" +fi + +printf "Done" From 8e144b60ffc531b427367bb2cebe7b52e74ef20b Mon Sep 17 00:00:00 2001 From: Eike Flath Date: Tue, 30 Mar 2021 18:09:33 +0200 Subject: [PATCH 015/102] Specified shutdown time (0 seconds) for openrc shutdown option (#925) If you don't specify it, it won't work: $ sudo -A openrc-shutdown -p * openrc-shutdown: No shutdown time specified --- .local/bin/sysact | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 62fdd61a..5e3acf52 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -5,7 +5,7 @@ # For non-systemd init systems. case "$(readlink -f /sbin/init)" in *runit*) hib="sudo -A zzz" ;; - *openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p" ;; + *openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;; esac cmds="\ From f05cb5e1bb2315e89baaa70b40ee82c72019d8ec Mon Sep 17 00:00:00 2001 From: Francesco <55460785+BachoSeven@users.noreply.github.com> Date: Wed, 31 Mar 2021 14:29:57 +0200 Subject: [PATCH 016/102] newsboat: fix non-posix here-string for clipboard macro(fixes #921) (#926) --- .config/newsboat/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/newsboat/config b/.config/newsboat/config index e9179910..69d8960c 100644 --- a/.config/newsboat/config +++ b/.config/newsboat/config @@ -36,7 +36,7 @@ macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best" ; ope macro v set browser "setsid -f mpv" ; open-in-browser ; set browser linkhandler macro w set browser "lynx" ; open-in-browser ; set browser linkhandler macro d set browser "dmenuhandler" ; open-in-browser ; set browser linkhandler -macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler +macro c set browser "echo %u | xclip -r -sel c" ; open-in-browser ; set browser linkhandler macro C set browser "youtube-viewer --comments=%u" ; open-in-browser ; set browser linkhandler macro p set browser "peertubetorrent %u 480" ; open-in-browser ; set browser linkhandler macro P set browser "peertubetorrent %u 1080" ; open-in-browser ; set browser linkhandler From 56046c5cda411447b0cb6cb5451e3d69d6c35690 Mon Sep 17 00:00:00 2001 From: Janik Kemnade Date: Tue, 6 Apr 2021 20:52:18 +0200 Subject: [PATCH 017/102] Create and source bookmarks for/by lf (#917) Co-authored-by: Kemmojo --- .config/lf/lfrc | 3 +++ .local/bin/shortcuts | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index b05d5114..b7e8a3c4 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -101,3 +101,6 @@ map b $setbg $f map down map up map V push :!nvim + +# Source Bookmarks +source "~/.config/lf/shortcutrc" \ No newline at end of file diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 8f459af1..5497345c 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -6,13 +6,14 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files" # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" +lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc" ranger_shortcuts="/dev/null" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" vifm_shortcuts="/dev/null" # Remove, prepare files -rm -f "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null +rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null printf "# vim: filetype=sh\\n" > "$fish_shortcuts" printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" @@ -25,7 +26,8 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); 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\" }" + 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\" ; + printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" # Format the `files` file in the correct syntax and sent it to both configs. eval "echo \"$(cat "$bmfiles")\"" | \ @@ -34,4 +36,5 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; 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\" }" + printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" ; + printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" From ea99abf1fa2bf04d88524693c3895e715ad60722 Mon Sep 17 00:00:00 2001 From: Alireza Date: Tue, 6 Apr 2021 23:23:19 +0430 Subject: [PATCH 018/102] Paths fixed (#928) shortcutrc is created on shell directory with shortcuts script same for zshnameddirrc --- .config/shell/aliasrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 107ecb8c..1f048eda 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -46,5 +46,5 @@ alias \ alias \ magit="nvim -c MagitOnly" \ - ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" \ + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ From 53602957686f362a027e455a796e3c0c26f694df Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 6 Apr 2021 17:17:32 -0400 Subject: [PATCH 019/102] profile no longer for non-zsh close #938 --- .profile | 1 - 1 file changed, 1 deletion(-) delete mode 120000 .profile diff --git a/.profile b/.profile deleted file mode 120000 index 8486fcaf..00000000 --- a/.profile +++ /dev/null @@ -1 +0,0 @@ -.config/shell/profile \ No newline at end of file From afaca0a0b66eada1ba3662946d1c2866ae7d2ed8 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 7 Apr 2021 11:46:50 -0400 Subject: [PATCH 020/102] here string removed --- .local/bin/rssadd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/rssadd b/.local/bin/rssadd index fb60be88..910fca31 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -1,12 +1,12 @@ #!/bin/sh -if echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null; then +if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ; then url="$1" else url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" | - sed -E 's_^.*href="(https?://[^"]+)".*$_\1_')" + grep -o "https?://[^\" ]")" - ! grep "https*://\S\+\.[A-Za-z]\+\S*" <<<"$url" && + echo "$url" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" || notify-send "That doesn't look like a full URL." && exit 1 fi From 2440ad83e9e9cf2f927efbaef618513e0df3cbda Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 16 Apr 2021 14:38:41 -0400 Subject: [PATCH 021/102] doppler RADAR statusbar module for Americans --- .local/bin/statusbar/sb-doppler | 206 ++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100755 .local/bin/statusbar/sb-doppler diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler new file mode 100755 index 00000000..dc93db08 --- /dev/null +++ b/.local/bin/statusbar/sb-doppler @@ -0,0 +1,206 @@ +#!/bin/sh + +# Show a Doppler RADAR of an American user's preferred location. + +secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds. +radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar" +doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif" + +pickloc() { chosen="$(echo "Northeast +Southeast +PacNorthWest +PacSouthWest +UpperMissVly +SouthMissVly +SouthPlains +NorthRockies +SouthRockies +Alaska +Carib +Hawaii +CentGrLakes +Conus-Large +KABR: Aberdeen, SD +KBIS: Bismarck, ND +KFTG: Denver/Boulder, CO +KDMX: Des Moines, IA +KDTX: Detroit, MI +KDDC: Dodge City, KS +KDLH: Duluth, MN +KCYS: Cheyenne, WY +KLOT: Chicago, IL +KGLD: Goodland, KS +KUEX: Hastings, NE +KGJX: Grand Junction, CO +KGRR: Grand Rapids, MI +KMVX: Fargo/Grand Forks, ND +KGRB: Green Bay, WI +KIND: Indianapolis, IN +KJKL: Jackson, KY +KARX: La Crosse, WI +KILX: Lincoln/Central Illinois, IL +KLVX: Louisville, KY +KMQT: Marquette +KMKX: Milwaukee, WI +KMPX: Minneapolis, MN +KAPX: Gaylord/Alpena, MI +KLNX: North Platte, NE +KIWX: N. Webster/Northern, IN +KOAX: Omaha, NE +KPAH: Paducah, KY +KEAX: Pleasant Hill, MO +KPUX: Pueblo, CO +KDVN: Quad Cities, IA +KUDX: Rapid City, SD +KRIW: Riverton, WY +KSGF: Springfield, MO +KLSX: St. LOUIS, MO +KFSD: Sioux Falls, IA +KTWX: Topeka, KS +KICT: Wichita, KS +KVWX: Paducah, KY +ICAO: Responsible Wfo +KLTX: WILMINGTON, NC +KCCX: State College/Central, PA +KLWX: Sterling, VA +KFCX: Blacksburg/Roanoke, VA +KRAX: Raleigh/Durham, NC +KGYX: Portland, ME +KDIX: Mt Holly/Philadelphia, PA +KPBZ: Pittsburgh, PA +KAKQ: Wakefield, VA +KMHX: Morehead City, NC +KGSP: Greer/Greenville/Sprtbg, SC +KILN: Wilmington/Cincinnati, OH +KCLE: Cleveland, OH +KCAE: Columbia, SC +KBGM: Binghamton, NY +KENX: Albany, NY +KBUF: Buffalo, NY +KCXX: Burlington, VT +KCBW: Caribou, ME +KBOX: Boston /Taunton, MA +KOKX: New York City, NY +KCLX: Charleston, SC +KRLX: Charleston, WV +ICAO: Responsible WFO +KBRO: Brownsville, TX +KABX: Albuquerque, NM +KAMA: Amarillo, TX +KFFC: Peachtree City/Atlanta, GA +KEWX: Austin/Sanantonio, TX +KBMX: Birmingham, AL +KCRP: Corpus Christi, TX +KFWS: Dallas / Ft. Worth, TX +KEPZ: El Paso, TX +KHGX: Houston/ Galveston, TX +KJAX: Jacksonville, FL +KBYX: Key West, FL +KMRX: Morristown/knoxville, TN +KLBB: Lubbock, TX +KLZK: Little Rock, AR +KLCH: Lake Charles, LA +KOHX: Nashville, TN +KMLB: Melbourne, FL +KNQA: Memphis, TN +KAMX: Miami, FL +KMAF: Midland/odessa, TX +KTLX: Norman, OK +KHTX: Huntsville, AL +KMOB: Mobile, AL +KTLH: Tallahassee, FL +KTBW: Tampa Bay Area, FL +KSJT: San Angelo, TX +KINX: Tulsa, OK +KSRX: Tulsa, OK +KLIX: New Orleans/slidell, LA +KDGX: Jackson, MS +KSHV: Shreveport, LA +ICAO: Responsible WFO +KLGX: Seattle / Tacoma, WA +KOTX: Spokane, WA +KEMX: Tucson, AZ +KYUX: Phoenix, AZ +KNKX: San Diego, CA +KMUX: Monterey/san Francisco, CA +KHNX: San Joaquin/hanford, CA +KSOX: San Diego, CA +KATX: Seattle / Tacoma, WA +KIWA: Phoenix, AZ +KRTX: Portland, OR +KSFX: Pocatello, ID +KRGX: Reno, NV +KDAX: Sacramento, CA +KMTX: Salt Lake City, UT +KPDT: Pendleton, OR +KMSX: Missoula, MT +KESX: Las Vegas, NV +KVTX: Los Angeles, CA +KMAX: Medford, OR +KFSX: Flagstaff, AZ +KGGW: Glasgow, MT +KLRX: Elko, NV +KBHX: Eureka, CA +KTFX: Great Falls, MT +KCBX: Boise, ID +KBLX: Billings, MT +KICX: Salt Lake City, UT +ICAO: Responsible Wfo W/ MSCF +PABC: Anchorage, AK +PAPD: Fairbanks, AK +PHKM: Honolulu, HI +PAHG: Anchorage, AK +PAKC: Anchorage, AK +PAIH: Anchorage, AK +PHMO: Honolulu, HI +PAEC: Fairbanks, AK +TJUA: San Juan, PR +PACG: Juneau, AK +PHKI: Honolulu, HI +PHWA: Honolulu, HI +ICAO: Responsible Wfo W/ MSCF +KFDR: Norman, OK +PGUA: Guam +KBBX: Sacramento, CA +KFDX: Albuquerque, NM +KGWX: Jackson, MS +KDOX: Wakefield, VA +KDYX: San Angelo, TX +KEYX: Las Vegas, NV +KEVX: Mobile, AL +KHPX: Paducah, KY +KTYX: Burlington, VT +KGRK: Dallas / Ft. Worth, TX +KPOE: Lake Charles, LA +KEOX: Tallahassee, FL +KHDX: El Paso, TX +KDFX: San Antonio, TX +KMXX: Birmingham, AL +KMBX: Bismarck, ND +KVAX: Jacksonville, FL +KJGX: Peachtree City/atlanta, GA +KVNX: Norman, OK +KVBX: Vandenberg Afb: Orcutt, CA" | dmenu -r -i -l 50 -p "Select a National Weather Service radar to use as default:" | sed "s/:.*//" | tr "[:lower:]" "[:upper:]")" + +# Sanity check of selection and ensure user did not escape. +echo "$chosen" | grep -q "^[A-Z]\+$" && echo "$chosen" > "$radarloc" ;} + +getdoppler() { + loc="$(cat "$radarloc")" + notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc." + curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;} + +showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;} + +case $BLOCK_BUTTON in + 1) [ ! -f "$radarloc" ] && pickloc && getdoppler + [ $(($(date '+%s') - $(stat -c %Y "$doppler"))) -gt "$secs" ] && getdoppler + showdoppler ;; + 2) pickloc && getdoppler && showdoppler ;; + 3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR. +- Middle click to update change RADAR location. +After $secs seconds, new clicks will also automatically update the doppler RADAR." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +echo 🗺️ From 5e53f5f467829c742586d38eb17a1c3efd18f6bf Mon Sep 17 00:00:00 2001 From: bboudreaux28 <72909044+bboudreaux28@users.noreply.github.com> Date: Sat, 24 Apr 2021 16:40:33 -0500 Subject: [PATCH 022/102] fixed typo (#940) changed "tranmission" to "transmission" --- .local/bin/td-toggle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/td-toggle b/.local/bin/td-toggle index d2ba76ae..3c20ea19 100755 --- a/.local/bin/td-toggle +++ b/.local/bin/td-toggle @@ -7,6 +7,6 @@ then [ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon disabled." else ifinstalled transmission-cli || exit - [ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon enabled." + [ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "transmission-daemon enabled." fi sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" From 3d439e1c08ac6b7bc6bf87e7585019034e02aebe Mon Sep 17 00:00:00 2001 From: "M. Yas. Davoodeh" <30480116+Davoodeh@users.noreply.github.com> Date: Thu, 27 May 2021 16:36:56 +0430 Subject: [PATCH 023/102] Suppress sb-music errors (#953) --- .local/bin/statusbar/sb-music | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index 75043133..7ea70320 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -1,6 +1,6 @@ #!/bin/sh -filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ' -;} +filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;} pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & From 9dec1225a493eface0146e4a35d6cf558e875129 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 30 May 2021 20:55:28 -0400 Subject: [PATCH 024/102] fix #956 --- .config/lf/lfrc | 1 + .config/shell/aliasrc | 6 +++--- .config/shell/bm-dirs | 1 + .local/bin/shortcuts | 20 ++++++++++---------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index b7e8a3c4..57a80ca3 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -23,6 +23,7 @@ cmd open ${{ 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 ;; + application/pgp-encrypted) $EDITOR $fx ;; *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; esac }} diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 1f048eda..5122d08d 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -7,9 +7,9 @@ [ -f "$XINITRC" ] && alias startx="startx $XINITRC" # sudo not required for some system commands -for x in mount umount sv pacman updatedb su ; do - alias $x="sudo $x" -done +for command in mount umount sv pacman updatedb su ; do + alias $command="sudo $command" +done; unset command # Verbosity and settings that you pretty much just always are going to want. alias \ diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs index b3807cd1..b204215c 100644 --- a/.config/shell/bm-dirs +++ b/.config/shell/bm-dirs @@ -4,6 +4,7 @@ cf ${XDG_CONFIG_HOME:-$HOME/.config} D ${XDG_DOWNLOAD_DIR:-$HOME/Downloads} d ${XDG_DOCUMENTS_DIR:-$HOME/Documents} dt ${XDG_DATA_HOME:-$HOME/.local/share} +rr ${XDG_DATA_HOME:-$HOME/.local/src} h $HOME m ${XDG_MUSIC_DIR:-$HOME/Music} mn /mnt diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 5497345c..253aff05 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -21,20 +21,20 @@ printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. eval "echo \"$(cat "$bmdirs")\"" | \ 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\" ; - 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\" ; - printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_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\" ; + printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" # Format the `files` file in the correct syntax and sent it to both configs. eval "echo \"$(cat "$bmfiles")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); - printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; + printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; 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\" ; - printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" + printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }" From 1e957b7f901c2bb98f7265d2862d8bc9acdc2f79 Mon Sep 17 00:00:00 2001 From: 7ze Date: Mon, 31 May 2021 06:32:36 +0530 Subject: [PATCH 025/102] Update: dmenumount -Make empty string check more consistent (#955) * Make empty string check more consistent Replace explicit empty string check condition with inbuilt POSIX compliant empty string check flag, in adherence with the rest of the script. * Update test expression --- .local/bin/dmenumount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index b98b6a3a..3cb1f814 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -9,7 +9,7 @@ getmount() { \ [ -z "$chosen" ] && exit 1 # shellcheck disable=SC2086 mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1 - [ "$mp" = "" ] && exit 1 + test -z "$mp" && exit 1 if [ ! -d "$mp" ]; then mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1 [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") From 14336d0a3c2ce8ecc432b1e335078adb4e6ff19b Mon Sep 17 00:00:00 2001 From: Carlos de la Torre <48769508+c-torre@users.noreply.github.com> Date: Mon, 31 May 2021 01:03:36 +0000 Subject: [PATCH 026/102] deprecate backticks (#949) --- .local/bin/sysact | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 5e3acf52..a8201587 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -19,4 +19,4 @@ cmds="\ choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 -`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-` +eval "$(echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-)" From f16713bcf7135f29f0812a425f92755d12a448a7 Mon Sep 17 00:00:00 2001 From: Gavin Thornhill <45498991+GavinThornhill@users.noreply.github.com> Date: Sun, 30 May 2021 18:04:27 -0700 Subject: [PATCH 027/102] Fix mail syncing on the status bar (#947) --- .local/bin/statusbar/sb-mailbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox index 5a674287..2132184c 100755 --- a/.local/bin/statusbar/sb-mailbox +++ b/.local/bin/statusbar/sb-mailbox @@ -5,7 +5,7 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e neomutt ;; - 2) setsid -f mw sync >/dev/null ;; + 2) setsid -f mw -Y >/dev/null ;; 3) notify-send "📬 Mail module" "\- Shows unread mail - Shows 🔃 if syncing mail - Left click opens neomutt From 4231d6bd33d484624293662dd6c40c768dc89875 Mon Sep 17 00:00:00 2001 From: Hekuran Date: Mon, 31 May 2021 03:07:27 +0200 Subject: [PATCH 028/102] improved `ifinstalled` and made `noisereduce` use it (#930) * made noisereduce executable * improved `ifinstalled` script * made `noisereduce` use `ifinstalled` script * quoting for quiet shellcheck --- .local/bin/ifinstalled | 6 ++++-- .local/bin/noisereduce | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) mode change 100644 => 100755 .local/bin/noisereduce diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled index be3ac245..7a53b18c 100755 --- a/.local/bin/ifinstalled +++ b/.local/bin/ifinstalled @@ -6,6 +6,8 @@ # various other scripts for clarity's sake. for x in "$@";do - pacman -Qq "$x" >/dev/null 2>&1 || - { notify-send "📦 $x" "must be installed for this function." && exit 1 ;} + notify() { notify-send "📦 $x" "must be installed for this function." && exit 1 ;} + which_out="$( /usr/bin/which "$x" >/dev/null 2>&1 )" && exit 0 #you might have compiled the prog, and not install the repo pkg... + pkgname="$(pacman -Qqo "$which_out" >/dev/null 2>&1 )" #...thats why two variables. + pacman -Qq "$pkgname" >/dev/null 2>&1 || notify done diff --git a/.local/bin/noisereduce b/.local/bin/noisereduce old mode 100644 new mode 100755 index 8d9598cd..c344760e --- a/.local/bin/noisereduce +++ b/.local/bin/noisereduce @@ -7,8 +7,8 @@ usage () } # Tests for requirements -ffmpeg -version >/dev/null || { echo >&2 "We require 'ffmpeg' but it's not installed. Install it by 'sudo apt-get install ffmpeg' Aborting."; exit 1; } -sox --version >/dev/null || { echo >&2 "We require 'sox' but it's not installed. Install it by 'sudo apt-get install sox' Aborting."; exit 1; } +ifinstalled ffmpeg || { echo >&2 "We require 'ffmpeg' but it's not installed."; exit 1; } +ifinstalled sox || { echo >&2 "We require 'ffmpeg' but it's not installed."; exit 1; } if [ "$#" -ne 2 ] then @@ -50,7 +50,7 @@ if [ -z "$sampleStart" ] ; then sampleStart="00:00:00"; fi printf "Sample noise end time [00:00:00.900]: " read -r sampleEnd if [ -z "$sampleEnd" ] ; then sampleEnd="00:00:00.900"; fi -printf "Noise reduction amount [0.21]: " +printf "Noise reduction amount [0.21]: " read -r sensitivity if [ -z "$sensitivity" ] ; then sensitivity="0.21"; fi From 542c4ab18d94a7ce98dd9b3a0d2a0cc6e631d8c5 Mon Sep 17 00:00:00 2001 From: Adriel Benati <80481479+abenatim@users.noreply.github.com> Date: Thu, 24 Jun 2021 21:49:54 -0300 Subject: [PATCH 029/102] Change tutorialvids links to PeerTube due to potential YT deletion (#929) --- .local/bin/tutorialvids | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.local/bin/tutorialvids b/.local/bin/tutorialvids index 4a35db94..91ad5b0f 100755 --- a/.local/bin/tutorialvids +++ b/.local/bin/tutorialvids @@ -5,22 +5,22 @@ # add/remove videos from this list as I go on. vidlist=" -dwm (window manager) https://www.youtube.com/watch?v=xnREqY-oyzM -pacman (installing/managing programs) https://www.youtube.com/watch?v=-dEuXTMzRKs -status bar https://www.youtube.com/watch?v=UP2QpHmcgyk -sxiv (image viewer) https://www.youtube.com/watch?v=GYW9i_u5PYs -st (terminal) https://www.youtube.com/watch?v=9H75enWM22k -i3 (old window manager) https://www.youtube.com/watch?v=GKviflL9XeI -neomutt (email) https://www.youtube.com/watch?v=2U3vRbF7v5A -ncmpcpp (music player) https://www.youtube.com/watch?v=sZIEdI9TS2U -newsboat (RSS reader) https://www.youtube.com/watch?v=dUFCRqs822w -ranger (file manager) https://www.youtube.com/watch?v=L6Vu7WPkoJo -zathura (pdf viewer) https://www.youtube.com/watch?v=V_Iz4zdyRM4 -gpg keys https://www.youtube.com/watch?v=DMGIlj7u7Eo -calcurse (calendar) https://www.youtube.com/watch?v=hvc-pHjbhdE -urlview https://www.youtube.com/watch?v=IgzpAjFgbCw -colorschemes with pywal https://www.youtube.com/watch?v=Es79N_9BblE -vi mode in shell https://www.youtube.com/watch?v=GqoJQft5R2E -pass (password manager) https://www.youtube.com/watch?v=sVkURNfxPd4 +dwm (window manager) https://videos.lukesmith.xyz/videos/watch/f6b78db7-b368-4647-bc64-28c08fff1988 +pacman (installing/managing programs) https://videos.lukesmith.xyz/videos/watch/8e7cadb9-0fed-47ce-a2a8-6635fa48614b +status bar https://videos.lukesmith.xyz/videos/watch/a4d5326b-0aac-496e-bfc3-5acd5cee89f0 +sxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2 +st (terminal) https://videos.lukesmith.xyz/videos/watch/efddd39d-bac5-4599-b572-177beb4ce6e8 +i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-40ee-a2bb-b5e1ffe0f48b +neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e +ncmpcpp (music player) https://videos.lukesmith.xyz/videos/watch/b5ac6f0d-a220-4433-88e3-e98fc791dc0a +newsboat (RSS reader) https://videos.lukesmith.xyz/videos/watch/bd2c3fff-40fa-47ea-aa98-5b1ec0c903b6 +ranger (file manager) https://videos.lukesmith.xyz/videos/watch/785d914f-8cbd-4a3d-a1f6-d75675fc7549 +zathura (pdf viewer) https://videos.lukesmith.xyz/videos/watch/c780f75a-11f6-48a9-a191-d079ebc36ea4 +gpg keys https://videos.lukesmith.xyz/videos/watch/040f5530-4830-4583-9ddc-2080b421531b +calcurse (calendar) https://videos.lukesmith.xyz/videos/watch/4b937e8b-7654-46e3-8d01-79392ec5b3d1 +urlview https://videos.lukesmith.xyz/videos/watch/31a4918f-633b-4bd6-b08e-956ac75d0324 +colorschemes with pywal https://videos.lukesmith.xyz/videos/watch/1b476003-61b2-4609-ac4b-820c3d128643 +vi mode in shell https://videos.lukesmith.xyz/videos/watch/228aa50c-836f-456f-9f0d-a45157fe4313 +pass (password manager) https://videos.lukesmith.xyz/videos/watch/432fc942-5e28-4682-9beb-f5cb237a1dd6 " echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 20 | awk '{print $1}')\s" | sed 's/.*\t//' | xargs -r mpv From 693c4317f57bfa3776ecd0d17b9486cca25250b4 Mon Sep 17 00:00:00 2001 From: Kipras Melnikovas Date: Fri, 25 Jun 2021 03:52:27 +0300 Subject: [PATCH 030/102] Add `Braille` font family to `monospace` @ fontconfig (#901) Some programs like `gotop` [1] or `bottom` / `btm` [2] weren't displaying properly, and I was able to fix the glyphs with the Braille font (don't recall where I found the recommendation). Don't forget to ```sh fc-cache -fv --really-force ``` Also beware of stuff like [4]. needs `ttf-ubraille` [3] so an update in LARBS progs.csv would be needed aswell [1] https://aur.archlinux.org/packages/gotop [2] https://aur.archlinux.org/packages/bottom-bin [3] https://aur.archlinux.org/packages/ttf-ubraille [4] https://wiki.archlinux.org/index.php/Font_configuration#Disable_scaling_of_bitmap_fonts --- .config/fontconfig/fonts.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 2d58803c..be47e011 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -30,6 +30,7 @@ Noto Sans Mono Liberation Mono + Braille From d728436150e94f2979348891aca403f41742ada7 Mon Sep 17 00:00:00 2001 From: Hekuran Date: Fri, 25 Jun 2021 02:54:49 +0200 Subject: [PATCH 031/102] for passmenu to use gtk3 box (#931) --- pinentry/preexec | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 pinentry/preexec diff --git a/pinentry/preexec b/pinentry/preexec new file mode 100755 index 00000000..93603c7c --- /dev/null +++ b/pinentry/preexec @@ -0,0 +1,5 @@ +#!/hint/sh + +# Define additional functionality for pinentry. For example +test -e /usr/lib/libgcr-base-3.so.1 && exec /usr/bin/pinentry-gnome3 "$@" +#test -e /usr/lib/libQt5Widgets.so.5 && exec /usr/bin/pinentry-qt "$@" From d67a55771c8b9f49d0e0c63beb2a5e1dfe4afe28 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 26 Jun 2021 14:43:15 -0400 Subject: [PATCH 032/102] switch from yay to paru --- .config/shell/profile | 2 +- .local/bin/statusbar/sb-popupgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/shell/profile b/.config/shell/profile index 9515179d..10576778 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -148,7 +148,7 @@ if pacman -Qs libxft-bgra >/dev/null 2>&1; then else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: - \033[32myay -S libxft-bgra-git\033[0m + \033[32mparu -S libxft-bgra-git\033[0m and replace \`libxft\`. Afterwards, you may start the graphical server by running \`startx\`." fi diff --git a/.local/bin/statusbar/sb-popupgrade b/.local/bin/statusbar/sb-popupgrade index 29d62309..dd5322fb 100755 --- a/.local/bin/statusbar/sb-popupgrade +++ b/.local/bin/statusbar/sb-popupgrade @@ -2,7 +2,7 @@ printf "Beginning upgrade.\\n" -yay -Syu +paru -Syu pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" printf "\\nUpgrade complete.\\nPress to exit window.\\n\\n" From 091d7e54c5c1ed77201ce1254aa2623a2801c9f2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 30 Jun 2021 23:00:19 -0400 Subject: [PATCH 033/102] landchad.net added to default/example rss --- .config/newsboat/urls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/newsboat/urls b/.config/newsboat/urls index 9a762a8a..77497a94 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -1,4 +1,6 @@ https://lukesmith.xyz/rss.xml https://notrelated.libsyn.com/rss https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)" +https://landchad.net/rss.xml +http://based.cooking/rss.xml https://www.archlinux.org/feeds/news/ "tech" From 661c9f53dba1a2c2241fd3c4c3554ec1ae380b51 Mon Sep 17 00:00:00 2001 From: viviansamuel <77439769+viviaaan@users.noreply.github.com> Date: Sun, 18 Jul 2021 18:42:48 +0530 Subject: [PATCH 034/102] use just awk without grep (#974) --- .local/bin/dmenurecord | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index b1a034a3..b83a7c52 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -31,7 +31,7 @@ screencast() { \ ffmpeg -y \ -f x11grab \ -framerate 60 \ - -s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \ + -s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \ -i "$DISPLAY" \ -f alsa -i default \ -r 30 \ @@ -43,7 +43,7 @@ screencast() { \ video() { ffmpeg \ -f x11grab \ - -s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \ + -s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \ -i "$DISPLAY" \ -c:v libx264 -qp 0 -r 30 \ "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & From 1df8bcd8feffde0361726c5b70d5deb0bc183f60 Mon Sep 17 00:00:00 2001 From: Thomas Voss <57815710+Mango0x45@users.noreply.github.com> Date: Wed, 21 Jul 2021 18:09:53 +0200 Subject: [PATCH 035/102] Minor performance improvements (#975) * Skip head and grep and do it all in sed * Replace echo and awk with a parameter expansion --- .local/bin/compiler | 2 +- .local/bin/queueandnotify | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index 39e149ed..faf37c9e 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -53,5 +53,5 @@ case "$ext" in scad) openscad -o "$base".stl "$file" ;; sent) setsid -f sent "$file" 2>/dev/null ;; tex) textype "$file" ;; - *) head -n1 "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; + *) sed -n '/^#!/s/^#!//p; q' "$file" | xargs -r -I % "$file" ;; esac diff --git a/.local/bin/queueandnotify b/.local/bin/queueandnotify index a54b13e9..54b2c2a9 100755 --- a/.local/bin/queueandnotify +++ b/.local/bin/queueandnotify @@ -7,7 +7,7 @@ queuefile="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue" while read -r line; do [ -z "$line" ] && continue - url="$(echo "$line" | awk '{print $1}')" + url="${line%%[ ]*}" qndl "$url" "curl -LO" done < "$queuefile" From 2363526b67ea8b27fc999415d3ba67b2efa5dbfa Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Sat, 31 Jul 2021 08:36:45 -0300 Subject: [PATCH 036/102] Odysee to linkhandler (#977) --- .local/bin/linkhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 04934e58..fa74cafb 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -10,7 +10,7 @@ [ -z "$1" ] && { "$BROWSER"; exit; } case "$1" in - *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*) + *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*) setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif) curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; From e424c8ba8ea59ed229466544b0b4a6a56e3ccecd Mon Sep 17 00:00:00 2001 From: Jonatan Schneevoigt Date: Wed, 4 Aug 2021 22:17:05 +0200 Subject: [PATCH 037/102] Change links to https (#978) --- .config/newsboat/urls | 2 +- .local/bin/getbib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/newsboat/urls b/.config/newsboat/urls index 77497a94..d675d973 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -2,5 +2,5 @@ https://lukesmith.xyz/rss.xml https://notrelated.libsyn.com/rss https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)" https://landchad.net/rss.xml -http://based.cooking/rss.xml +https://based.cooking/rss.xml https://www.archlinux.org/feeds/news/ "tech" diff --git a/.local/bin/getbib b/.local/bin/getbib index ed441c56..8675aae8 100755 --- a/.local/bin/getbib +++ b/.local/bin/getbib @@ -11,4 +11,4 @@ else fi # Check crossref.org for the bib citation. -curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n" +curl -s "https://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n" From 418c00cbc459c456ab489d093561d3a3e127aa2b Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Sat, 7 Aug 2021 19:10:36 +0000 Subject: [PATCH 038/102] Update peertubetorrent due to changed URL format (#979) --- .local/bin/peertubetorrent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/peertubetorrent b/.local/bin/peertubetorrent index 56f2476e..7a7a4839 100755 --- a/.local/bin/peertubetorrent +++ b/.local/bin/peertubetorrent @@ -3,5 +3,5 @@ # first argument is the video link, second is the quality (480 or 1080) # 13/07/20 - Arthur Bais -link="$(echo "$1" | sed "s/videos\/watch/download\/torrents/")""-$2.torrent" +link="$(echo "$1" | sed "s/w/download\/torrents/")""-$2.torrent" transadd "$link" From 32f91e223d2cc3ce734939fe5a1f8ad5578e5e25 Mon Sep 17 00:00:00 2001 From: Rafael Date: Fri, 13 Aug 2021 12:20:53 +0000 Subject: [PATCH 039/102] vim-airline repo changed its ownership from bling to vim-airline (#982) github automatically redirects to vim-airline, so this is not a problem when installing, but updating just for the sake of explicitness and having the correct username/repo --- .config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ce0db87f..f93eed4d 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -14,7 +14,7 @@ Plug 'junegunn/goyo.vim' Plug 'jreybert/vimagit' Plug 'lukesmithxyz/vimling' Plug 'vimwiki/vimwiki' -Plug 'bling/vim-airline' +Plug 'vim-airline/vim-airline' Plug 'tpope/vim-commentary' Plug 'ap/vim-css-color' call plug#end() From ebadf06c5abe7b887c3c9d089f39b48940b9134f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 14 Aug 2021 13:09:51 -0400 Subject: [PATCH 040/102] credit desktop art --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0ea1a8c0..1594423b 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,7 @@ curl -LO larbs.xyz/larbs.sh or clone the repo files directly to your home directory and install the [dependencies](https://github.com/LukeSmithxyz/LARBS/blob/master/progs.csv). + +## Default Desktop Artwork + +Thomas Thiemeyer's *The Road to Samarkand* ([fb](https://www.facebook.com/t.thiemeyer/), [insta](https://www.instagram.com/tthiemeyer/), [shop](https://www.redbubble.com/de/people/TThiemeyer/shop)) From 46b7d3f0c104880b161951e971146b92fe254175 Mon Sep 17 00:00:00 2001 From: Hector Canizales Date: Sun, 15 Aug 2021 20:04:07 -0500 Subject: [PATCH 041/102] add /efi to exceptions in unmount script (#983) --- .local/bin/dmenuumount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount index 26612efe..52dd7ff3 100755 --- a/.local/bin/dmenuumount +++ b/.local/bin/dmenuumount @@ -26,7 +26,7 @@ asktype() { \ esac } -drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') +drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') if ! grep simple-mtpfs /etc/mtab; then [ -z "$drives" ] && echo "No drives to unmount." && exit From f36f2fe539c21b05e06ea83aadc732ee44d785f6 Mon Sep 17 00:00:00 2001 From: cronidea <86153674+cronidea@users.noreply.github.com> Date: Wed, 18 Aug 2021 13:35:04 +0100 Subject: [PATCH 042/102] Change sb-price to allow custom currency (#963) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e.g: price price btc Bitcoin "" gbp --- .local/bin/statusbar/sb-price | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price index 35b072fa..a3fb4573 100755 --- a/.local/bin/statusbar/sb-price +++ b/.local/bin/statusbar/sb-price @@ -1,19 +1,22 @@ #!/bin/sh # Usage: -# price +# price # price bat "Basic Attention Token" 🦁 # When the name of the currency is multi-word, put it in quotes. [ -z "$3" ] && exit 1 + +# use $4 as currency, if not passed in use "usd" as default +currency="${4:-usd}" interval="@14d" # History contained in chart preceded by '@' (7d = 7 days) dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" pricefile="$dir/$1" chartfile="$dir/$1-chart" updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 && - curl -s "rate.sx/1$1" > "$pricefile" && - curl -s "rate.sx/$1$interval" > "$chartfile" ;} + curl -s "$currency.rate.sx/1$1" > "$pricefile" && + curl -s "$currency.rate.sx/$1$interval" > "$chartfile" ;} [ -d "$dir" ] || mkdir -p "$dir" @@ -35,4 +38,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -printf "$3$%0.2f" "$(cat "$pricefile")" +printf "$3%0.2f$currency" "$(cat "$pricefile")" From 0a6982f1e11a2a528ea110def6fc10da6574a595 Mon Sep 17 00:00:00 2001 From: Hekuran Date: Thu, 19 Aug 2021 13:56:44 +0200 Subject: [PATCH 043/102] update `ext` script (#986) Arch & Artix already have the `libarchive` pkg, which contains `bsdtar`. So lets just use it, since its superior, faster, it also has easier syntax, and it auto-detects the compression. btw the .tar.zst was wrong anyhow, so if u wont merge this, dont forget to fix that. from the manual: ``` -I, --use-compress-program=COMMAND Filter data through COMMAND. It must accept the -d option, for decompression. The argument can contain command line options. ..... --zstd Filter the archive through zstd(1). ``` --- .local/bin/ext | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/ext b/.local/bin/ext index 927fb5b5..6950ff63 100755 --- a/.local/bin/ext +++ b/.local/bin/ext @@ -24,15 +24,15 @@ fi if [ -f "$archive" ] ; then case "$archive" in - *.tar.bz2|*.tbz2) tar xvjf "$archive" ;; - *.tar.xz) tar -xf "$archive" ;; - *.tar.gz|*.tgz) tar xvzf "$archive" ;; - *.tar.zst) tar -I zstd -xf "$archive" ;; + *.tar.bz2|*.tbz2) bsdtar -xf "$archive" ;; + *.tar.xz) bsdtar -xf "$archive" ;; + *.tar.gz|*.tgz) bsdtar -xf "$archive" ;; + *.tar.zst) bsdtar -xf "$archive" ;; + *.tar) bsdtar -xf "$archive" ;; *.lzma) unlzma "$archive" ;; *.bz2) bunzip2 "$archive" ;; *.rar) unrar x -ad "$archive" ;; *.gz) gunzip "$archive" ;; - *.tar) tar xvf "$archive" ;; *.zip) unzip "$archive" ;; *.Z) uncompress "$archive" ;; *.7z) 7z x "$archive" ;; From 2eb02268b6054d99e5f8012e07f4c5d83e95e94f Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Tue, 24 Aug 2021 19:09:07 +0000 Subject: [PATCH 044/102] Changed paru to yay due to new LARBS changes (#987) --- .local/bin/statusbar/sb-popupgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-popupgrade b/.local/bin/statusbar/sb-popupgrade index dd5322fb..29d62309 100755 --- a/.local/bin/statusbar/sb-popupgrade +++ b/.local/bin/statusbar/sb-popupgrade @@ -2,7 +2,7 @@ printf "Beginning upgrade.\\n" -paru -Syu +yay -Syu pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" printf "\\nUpgrade complete.\\nPress to exit window.\\n\\n" From 1c676c7cf2efe877260132888a88a2b918855785 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 25 Aug 2021 08:02:39 -0400 Subject: [PATCH 045/102] close #971 --- .config/lf/lfrc | 2 +- .config/newsboat/urls | 1 + .config/shell/aliasrc | 3 +-- .config/shell/bm-dirs | 2 +- .local/bin/statusbar/sb-battery | 7 ++++--- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 57a80ca3..92567e66 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -104,4 +104,4 @@ map up map V push :!nvim # Source Bookmarks -source "~/.config/lf/shortcutrc" \ No newline at end of file +source "~/.config/lf/shortcutrc" diff --git a/.config/newsboat/urls b/.config/newsboat/urls index d675d973..1da07023 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -3,4 +3,5 @@ https://notrelated.libsyn.com/rss https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)" https://landchad.net/rss.xml https://based.cooking/rss.xml +https://artixlinux.org/feed.php "tech" https://www.archlinux.org/feeds/news/ "tech" diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 5122d08d..235fc045 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -7,7 +7,7 @@ [ -f "$XINITRC" ] && alias startx="startx $XINITRC" # sudo not required for some system commands -for command in mount umount sv pacman updatedb su ; do +for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do alias $command="sudo $command" done; unset command @@ -38,7 +38,6 @@ alias \ sdn="sudo shutdown -h now" \ e="$EDITOR" \ v="$EDITOR" \ - p="sudo pacman" \ xi="sudo xbps-install" \ xr="sudo xbps-remove -R" \ xq="xbps-query" \ diff --git a/.config/shell/bm-dirs b/.config/shell/bm-dirs index b204215c..9d212ec5 100644 --- a/.config/shell/bm-dirs +++ b/.config/shell/bm-dirs @@ -4,7 +4,7 @@ cf ${XDG_CONFIG_HOME:-$HOME/.config} D ${XDG_DOWNLOAD_DIR:-$HOME/Downloads} d ${XDG_DOCUMENTS_DIR:-$HOME/Documents} dt ${XDG_DATA_HOME:-$HOME/.local/share} -rr ${XDG_DATA_HOME:-$HOME/.local/src} +rr $HOME/.local/src h $HOME m ${XDG_MUSIC_DIR:-$HOME/Music} mn /mnt diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 382b31bb..93cbe088 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -21,16 +21,17 @@ for battery in /sys/class/power_supply/BAT?*; do # If non-first battery, print a space separator. [ -n "${capacity+x}" ] && printf " " # Sets up the status and capacity - case "$(cat "$battery/status")" in + case "$(cat "$battery/status" 2>&1)" in "Full") status="⚡" ;; "Discharging") status="🔋" ;; "Charging") status="🔌" ;; "Not charging") status="🛑" ;; "Unknown") status="♻️" ;; + *) exit 1 ;; esac - capacity=$(cat "$battery/capacity") + capacity="$(cat "$battery/capacity" 2>&1)" # Will make a warn variable if discharging and low [ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗" # Prints the info printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn -done && exit 0 +done && printf "\\n" From 9b6005292c74bfb93bd486e1af0591966319595b Mon Sep 17 00:00:00 2001 From: Hekuran Date: Wed, 25 Aug 2021 15:51:52 +0200 Subject: [PATCH 046/102] lapsus calami (#988) don't remove the whole thing, just sudo --- .config/shell/aliasrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 235fc045..0890ccd6 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -38,6 +38,7 @@ alias \ sdn="sudo shutdown -h now" \ e="$EDITOR" \ v="$EDITOR" \ + p="pacman" \ xi="sudo xbps-install" \ xr="sudo xbps-remove -R" \ xq="xbps-query" \ From 05aa7d11827e26a619df5b277607245ca4e045f1 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Tue, 31 Aug 2021 15:28:33 +0200 Subject: [PATCH 047/102] Fix & improve lf's moveto, copyto and cd to bm-dir (#994) * Changed paru to yay due to new LARBS changes * Fix & improve lf's moveto, copyto and cd to bm-dir When using any of the above functions they returned exit code 1. This was due to the cut command having tab as the delimiter, but spaces are used in the bm-dirs file. As an improvement comments are now automatically removed from the fzf options, because selecting those wouldn't work anyway. The final sed command substituting "~" for "$HOME" is also removed because that doesn't seem to do anything looking at the current structure of the bm-dirs file. The J bind needed more parsing and environment variable substitution because cd didn't work by default with values from a subshell. --- .config/lf/lfrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 92567e66..870ae324 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -52,7 +52,7 @@ cmd moveto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Move to where?" - dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|' )" && + dest="$(awk '{ gsub(/#.*/, ""); } !/^$/ { print $2 }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" && for x in $fx; do eval mv -iv \"$x\" \"$dest\" done && @@ -63,7 +63,7 @@ cmd copyto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Copy to where?" - dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|' )" && + dest="$(awk '{ gsub(/#.*/, ""); } !/^$/ { print $2 }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" && for x in $fx; do eval cp -ivr \"$x\" \"$dest\" done && @@ -75,7 +75,7 @@ cmd bulkrename $vidir # Bindings map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" +map J $lf -remote "send $id cd $(awk '{ gsub(/#.*/, ""); } !/^$/ { print $2 }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/\${.*-// ; s/}//" | envsubst)" map gh map g top map D delete From 9a2dc2618e4875b59a19709ec810402ce7d5df28 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Tue, 31 Aug 2021 23:00:23 +0200 Subject: [PATCH 048/102] Return dunst and zathura color schemes to normal if python-pywal is uninstalled. (#995) * Changed paru to yay due to new LARBS changes * Fix & improve lf's moveto, copyto and cd to bm-dir When using any of the above functions they returned exit code 1. This was due to the cut command having tab as the delimiter, but spaces are used in the bm-dirs file. As an improvement comments are now automatically removed from the fzf options, because selecting those wouldn't work anyway. The final sed command substituting "~" for "$HOME" is also removed because that doesn't seem to do anything looking at the current structure of the bm-dirs file. The J bind needed more parsing and environment variable substitution because cd didn't work by default with values from a subshell. * Automatically backup existing config files * Return by pywal edited config files to normal if pywal is uninstalled. --- .config/wal/postrun | 2 ++ .local/bin/setbg | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.config/wal/postrun b/.config/wal/postrun index 74d551b5..85d9e3fa 100755 --- a/.config/wal/postrun +++ b/.config/wal/postrun @@ -4,6 +4,8 @@ source "${HOME}/.cache/wal/colors.sh" mkdir -p "${HOME}/.config/dunst" mkdir -p "${HOME}/.config/zathura" +mv -n "${HOME}/.config/dunst/dunstrc" "${HOME}/.config/dunst/dunstrc.bak" +mv -n "${HOME}/.config/zathura/zathurarc" "${HOME}/.config/zathura/zathurarc.bak" ln -sf "${HOME}/.cache/wal/dunstrc" "${HOME}/.config/dunst/dunstrc" ln -sf "${HOME}/.cache/wal/zathurarc" "${HOME}/.config/zathura/zathurarc" diff --git a/.local/bin/setbg b/.local/bin/setbg index 8112bcda..7f997b7d 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -17,8 +17,13 @@ case "$(file --mime-type -b "$trueloc")" in esac # If pywal is installed, use it. -command -v wal >/dev/null 2>&1 && - wal -i "$trueloc" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 && - pidof dwm >/dev/null && xdotool key super+F12 +if command -v wal >/dev/null 2>&1 ; then + wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 && + pidof dwm >/dev/null && xdotool key super+F12 +# If pywal is removed, return config files to normal. +else + [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" + [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" +fi xwallpaper --zoom "$bgloc" From f1814b3690d61cc122c83381ed013eaf20a33971 Mon Sep 17 00:00:00 2001 From: Wis Date: Mon, 13 Sep 2021 17:17:29 +0300 Subject: [PATCH 049/102] mpv: fix error on launch by removing directories inside mpv's scripts directory (#1004) * remove dirs from mpv scripts dir * remove submodule dir from mpv scripts dir * add script_modules directory outside scripts direcoty * load modules/plugins from script_modules, outside mpv's script-files-only directory * rename variable --- .config/mpv/script_modules/mpvSockets | 1 + .config/mpv/scripts/modules.lua | 4 ++-- .config/mpv/scripts/mpvSockets | 1 - .gitmodules | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) create mode 160000 .config/mpv/script_modules/mpvSockets delete mode 160000 .config/mpv/scripts/mpvSockets diff --git a/.config/mpv/script_modules/mpvSockets b/.config/mpv/script_modules/mpvSockets new file mode 160000 index 00000000..be9b7ca8 --- /dev/null +++ b/.config/mpv/script_modules/mpvSockets @@ -0,0 +1 @@ +Subproject commit be9b7ca84456466e54331bab59441ac207659c1c diff --git a/.config/mpv/scripts/modules.lua b/.config/mpv/scripts/modules.lua index 37b69b30..703f372d 100644 --- a/.config/mpv/scripts/modules.lua +++ b/.config/mpv/scripts/modules.lua @@ -1,3 +1,3 @@ -local mpv_scripts_dir_path = os.getenv("HOME") .. "/.config/mpv/scripts/" -function load(relative_path) dofile(mpv_scripts_dir_path .. relative_path) end +local mpv_config_dir_path = require("mp").command_native({"expand-path", "~~/"}) +function load(relative_path) dofile(mpv_config_dir_path .. "/script_modules/" .. relative_path) end load("mpvSockets/mpvSockets.lua") diff --git a/.config/mpv/scripts/mpvSockets b/.config/mpv/scripts/mpvSockets deleted file mode 160000 index 8415a08d..00000000 --- a/.config/mpv/scripts/mpvSockets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8415a08d99a46213c918613cfe1e088071018db9 diff --git a/.gitmodules b/.gitmodules index 4f7c5dd1..c8bf5faf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule ".config/mpv/scripts/mpvSockets"] - path = .config/mpv/scripts/mpvSockets +[submodule ".config/mpv/script_modules/mpvSockets"] + path = .config/mpv/script_modules/mpvSockets url = https://github.com/wis/mpvSockets.git From 347716361b06108788ce1c3d72d59caa06e89aa0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 23 Sep 2021 11:30:23 -0400 Subject: [PATCH 050/102] close #1002 --- .config/lf/lfrc | 2 ++ .config/newsboat/urls | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 870ae324..7ef819d1 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -103,5 +103,7 @@ map down map up map V push :!nvim +map W $setsid -f $TERMINAL >/dev/null 2>&1 + # Source Bookmarks source "~/.config/lf/shortcutrc" diff --git a/.config/newsboat/urls b/.config/newsboat/urls index 1da07023..e8384781 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -1,5 +1,5 @@ https://lukesmith.xyz/rss.xml -https://notrelated.libsyn.com/rss +https://notrelated.xyz/rss https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)" https://landchad.net/rss.xml https://based.cooking/rss.xml From 93a9e978dadf0a855dd78b3e4b88c4c9640d39ee Mon Sep 17 00:00:00 2001 From: Richard Halford <63303646+rsHalford@users.noreply.github.com> Date: Thu, 23 Sep 2021 16:48:58 +0100 Subject: [PATCH 051/102] Add partition label to dmenuumount script (#999) If a partition doesn't have a label, it results in a double space that awk ignores. Which is why the changes include a pipe into sed. --- .local/bin/dmenuumount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount index 52dd7ff3..f7d07473 100755 --- a/.local/bin/dmenuumount +++ b/.local/bin/dmenuumount @@ -26,7 +26,7 @@ asktype() { \ esac } -drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') +drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | sed 's/ /:/g' | awk -F':' '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}') if ! grep simple-mtpfs /etc/mtab; then [ -z "$drives" ] && echo "No drives to unmount." && exit From fb8923b841e03b99b14e5f94f27e988f30628147 Mon Sep 17 00:00:00 2001 From: Arjun Karangiya Date: Thu, 23 Sep 2021 21:32:51 +0530 Subject: [PATCH 052/102] Here program name should be given not package name (#973) This can be known from ifinstalled code --- .local/bin/torwrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/torwrap b/.local/bin/torwrap index 4f94053e..8b20ad4f 100755 --- a/.local/bin/torwrap +++ b/.local/bin/torwrap @@ -1,6 +1,6 @@ #!/bin/sh -ifinstalled tremc-git transmission-cli || exit +ifinstalled tremc transmission-cli || exit ! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." From dd8da1765a78117219e8b81d0945baa1e66c3a67 Mon Sep 17 00:00:00 2001 From: Future is FOSS <79040025+futureisfoss@users.noreply.github.com> Date: Thu, 23 Sep 2021 21:45:42 +0530 Subject: [PATCH 053/102] show red cross if wifi is disabled (#898) show a red cross mark if wifi is disabled/turned off. --- .local/bin/statusbar/sb-internet | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index ee1a1607..d3948d7c 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -7,6 +7,7 @@ case $BLOCK_BUTTON in 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; 3) notify-send "🌐 Internet module" "\- Click to connect +❌: wifi disabled 📡: no wifi connection 📶: wifi connection with quality ❎: no ethernet @@ -17,7 +18,7 @@ case $BLOCK_BUTTON in esac case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in - down) wifiicon="📡 " ;; + down) [ "$(cat /sys/class/net/w*/flags)" = "0x1002" ] && wifiicon="❌ " || wifiicon="📡 " ;; up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;; esac From f42cb321f09e44c00213e186f0208abf51088d33 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 23 Sep 2021 12:40:12 -0400 Subject: [PATCH 054/102] close #996 --- .config/lf/lfrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 7ef819d1..ebf6d309 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -52,7 +52,7 @@ cmd moveto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Move to where?" - dest="$(awk '{ gsub(/#.*/, ""); } !/^$/ { print $2 }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" && + dest="$(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && for x in $fx; do eval mv -iv \"$x\" \"$dest\" done && @@ -63,7 +63,7 @@ cmd copyto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Copy to where?" - dest="$(awk '{ gsub(/#.*/, ""); } !/^$/ { print $2 }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" && + dest="$(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && for x in $fx; do eval cp -ivr \"$x\" \"$dest\" done && @@ -75,7 +75,7 @@ cmd bulkrename $vidir # Bindings map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(awk '{ gsub(/#.*/, ""); } !/^$/ { print $2 }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/\${.*-// ; s/}//" | envsubst)" +map J $lf -remote "send $id cd $(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" map gh map g top map D delete From 15d09bac36f1a5845c87d6c5f4edb64634407546 Mon Sep 17 00:00:00 2001 From: Hekuran Date: Thu, 23 Sep 2021 20:54:58 +0200 Subject: [PATCH 055/102] sysact rewrite and minor stuff (#1000) * minor forgoten stuff we already have shutdown in sudo loop * why was this still here? it belongs in ~/.config/ * what the actual phucc * implemented loginctl and fixed shebang --- {pinentry => .config/pinentry}/preexec | 0 .config/shell/aliasrc | 2 +- .local/bin/sysact | 30 +++++++++++--------------- 3 files changed, 14 insertions(+), 18 deletions(-) rename {pinentry => .config/pinentry}/preexec (100%) diff --git a/pinentry/preexec b/.config/pinentry/preexec similarity index 100% rename from pinentry/preexec rename to .config/pinentry/preexec diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 0890ccd6..ad716955 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -35,7 +35,7 @@ alias \ g="git" \ trem="transmission-remote" \ YT="youtube-viewer" \ - sdn="sudo shutdown -h now" \ + sdn="shutdown -h now" \ e="$EDITOR" \ v="$EDITOR" \ p="pacman" \ diff --git a/.local/bin/sysact b/.local/bin/sysact index a8201587..451815df 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -1,22 +1,18 @@ #!/bin/sh - # A dmenu wrapper script for system functions. - -# For non-systemd init systems. case "$(readlink -f /sbin/init)" in - *runit*) hib="sudo -A zzz" ;; - *openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;; + *systemd*) ctl='systemctl' ;; + *) ctl='loginctl' ;; esac -cmds="\ -🔒 lock slock -🚪 leave dwm kill -TERM $(pgrep -u $USER "\bdwm$") -♻ renew dwm kill -HUP $(pgrep -u $USER "\bdwm$") -🐻 hibernate slock ${hib:-systemctl suspend-then-hibernate -i} -🔃 reboot ${reb:-sudo -A reboot} -🖥 shutdown ${shut:-sudo -A shutdown -h now} -📺 display off xset dpms force off" - -choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 - -eval "$(echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-)" +case "$(printf "🔒 lock\n🚪 leave dwm\n♻️ renew dwm\n🐻 hibernate\n💤 sleep\n🔃 reboot\n🖥️shutdown\n📺 display off" | dmenu -i -p 'Action: ')" in + '🔒 lock') slock ;; + '🚪 leave dwm') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;; + '♻️ renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;; + '🐻 hibernate') slock $ctl hibernate ;; + '💤 sleep') slock $ctl suspend ;; + '🔃 reboot') $ctl reboot ;; + '🖥️shutdown') $ctl poweroff ;; + '📺 display off') xset dpms force off ;; + *) exit 1 ;; +esac From 60e61287543dfbbff58bd1ef79d627cf3ca5113d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 24 Sep 2021 09:50:24 -0400 Subject: [PATCH 056/102] no ping and other tweaks --- .local/bin/cron/checkup | 2 -- .local/bin/cron/newsup | 2 -- .local/bin/statusbar/sb-price | 21 +++++++++++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup index 4cfb856a..bd3c6345 100755 --- a/.local/bin/cron/checkup +++ b/.local/bin/cron/checkup @@ -2,8 +2,6 @@ # Syncs repositories and downloads updates, meant to be run as a cronjob. -ping -q -c 1 example.org > /dev/null || exit - notify-send "📦 Repository Sync" "Checking for package updates..." sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates. diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index 29f2b3c9..cc50e78c 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -3,8 +3,6 @@ # Set as a cron job to check for new RSS entries for newsboat. # If newsboat is open, sends it an "R" key to refresh. -ping -q -c 1 example.org > /dev/null || exit - /usr/bin/notify-send "📰 Updating RSS feeds..." pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price index a3fb4573..42c84c11 100755 --- a/.local/bin/statusbar/sb-price +++ b/.local/bin/statusbar/sb-price @@ -11,12 +11,14 @@ currency="${4:-usd}" interval="@14d" # History contained in chart preceded by '@' (7d = 7 days) dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" -pricefile="$dir/$1" -chartfile="$dir/$1-chart" +pricefile="$dir/$1-$currency" +chartfile="$dir/$1-$currency-chart" -updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 && - curl -s "$currency.rate.sx/1$1" > "$pricefile" && - curl -s "$currency.rate.sx/$1$interval" > "$chartfile" ;} +updateprice() { temp="$(mktemp)" + curl -s "$currency.rate.sx/1$1" > "$temp" && + mv -f "$temp" "$pricefile" && + curl -s "$currency.rate.sx/$1$interval" > "$temp" && + mv -f "$temp" "$chartfile" ;} [ -d "$dir" ] || mkdir -p "$dir" @@ -38,4 +40,11 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -printf "$3%0.2f$currency" "$(cat "$pricefile")" +case "$currency" in + usd) symb="$" ;; + gbp) symb="£" ;; + eur) symb="€" ;; + btc) symb="₿" ;; +esac + +printf "$3$symb%0.2f$after" "$(cat "$pricefile")" From 828c05218408908331397e5e3609b7a28f49aa0b Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Fri, 24 Sep 2021 16:35:49 +0200 Subject: [PATCH 057/102] We don't need sed here (#1006) --- .local/bin/dmenuumount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount index f7d07473..946d12c3 100755 --- a/.local/bin/dmenuumount +++ b/.local/bin/dmenuumount @@ -26,7 +26,7 @@ asktype() { \ esac } -drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | sed 's/ /:/g' | awk -F':' '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}') +drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}') if ! grep simple-mtpfs /etc/mtab; then [ -z "$drives" ] && echo "No drives to unmount." && exit From 162ed8889b9893b790ca529e564d976f8190e3f3 Mon Sep 17 00:00:00 2001 From: Future is FOSS <79040025+futureisfoss@users.noreply.github.com> Date: Mon, 27 Sep 2021 19:18:53 +0530 Subject: [PATCH 058/102] fix sb-internet problems with multiple wifi cards (#1008) --- .local/bin/statusbar/sb-internet | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index d3948d7c..94b7da27 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -17,9 +17,10 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in - down) [ "$(cat /sys/class/net/w*/flags)" = "0x1002" ] && wifiicon="❌ " || wifiicon="📡 " ;; - up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;; -esac +if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then + wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" +elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then + grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ " +fi printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)" From a3a630a3e839a730d26a137f35cce2065bbbb16f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 2 Oct 2021 11:53:16 -0400 Subject: [PATCH 059/102] avoid the lf/sxiv resize bug by not swallowing --- .config/lf/lfrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index ebf6d309..41013384 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -19,7 +19,7 @@ cmd open ${{ text/*) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; - image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | sxiv -aio 2>/dev/null | lf-select ;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | setsid -f 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 a3e76f32b868ab11550417cbfd81dc9eab7a4c28 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Mon, 4 Oct 2021 20:56:57 +0200 Subject: [PATCH 060/102] Make sb-doppler work for Europe and Africa --- .local/bin/statusbar/sb-doppler | 414 ++++++++++++++++++-------------- 1 file changed, 234 insertions(+), 180 deletions(-) diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index dc93db08..edbc88a1 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -1,194 +1,248 @@ #!/bin/sh -# Show a Doppler RADAR of an American user's preferred location. +# Show a Doppler RADAR of a user's preferred location. secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds. radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar" doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif" -pickloc() { chosen="$(echo "Northeast -Southeast -PacNorthWest -PacSouthWest -UpperMissVly -SouthMissVly -SouthPlains -NorthRockies -SouthRockies -Alaska -Carib -Hawaii -CentGrLakes -Conus-Large -KABR: Aberdeen, SD -KBIS: Bismarck, ND -KFTG: Denver/Boulder, CO -KDMX: Des Moines, IA -KDTX: Detroit, MI -KDDC: Dodge City, KS -KDLH: Duluth, MN -KCYS: Cheyenne, WY -KLOT: Chicago, IL -KGLD: Goodland, KS -KUEX: Hastings, NE -KGJX: Grand Junction, CO -KGRR: Grand Rapids, MI -KMVX: Fargo/Grand Forks, ND -KGRB: Green Bay, WI -KIND: Indianapolis, IN -KJKL: Jackson, KY -KARX: La Crosse, WI -KILX: Lincoln/Central Illinois, IL -KLVX: Louisville, KY -KMQT: Marquette -KMKX: Milwaukee, WI -KMPX: Minneapolis, MN -KAPX: Gaylord/Alpena, MI -KLNX: North Platte, NE -KIWX: N. Webster/Northern, IN -KOAX: Omaha, NE -KPAH: Paducah, KY -KEAX: Pleasant Hill, MO -KPUX: Pueblo, CO -KDVN: Quad Cities, IA -KUDX: Rapid City, SD -KRIW: Riverton, WY -KSGF: Springfield, MO -KLSX: St. LOUIS, MO -KFSD: Sioux Falls, IA -KTWX: Topeka, KS -KICT: Wichita, KS -KVWX: Paducah, KY -ICAO: Responsible Wfo -KLTX: WILMINGTON, NC -KCCX: State College/Central, PA -KLWX: Sterling, VA -KFCX: Blacksburg/Roanoke, VA -KRAX: Raleigh/Durham, NC -KGYX: Portland, ME -KDIX: Mt Holly/Philadelphia, PA -KPBZ: Pittsburgh, PA -KAKQ: Wakefield, VA -KMHX: Morehead City, NC -KGSP: Greer/Greenville/Sprtbg, SC -KILN: Wilmington/Cincinnati, OH -KCLE: Cleveland, OH -KCAE: Columbia, SC -KBGM: Binghamton, NY -KENX: Albany, NY -KBUF: Buffalo, NY -KCXX: Burlington, VT -KCBW: Caribou, ME -KBOX: Boston /Taunton, MA -KOKX: New York City, NY -KCLX: Charleston, SC -KRLX: Charleston, WV -ICAO: Responsible WFO -KBRO: Brownsville, TX -KABX: Albuquerque, NM -KAMA: Amarillo, TX -KFFC: Peachtree City/Atlanta, GA -KEWX: Austin/Sanantonio, TX -KBMX: Birmingham, AL -KCRP: Corpus Christi, TX -KFWS: Dallas / Ft. Worth, TX -KEPZ: El Paso, TX -KHGX: Houston/ Galveston, TX -KJAX: Jacksonville, FL -KBYX: Key West, FL -KMRX: Morristown/knoxville, TN -KLBB: Lubbock, TX -KLZK: Little Rock, AR -KLCH: Lake Charles, LA -KOHX: Nashville, TN -KMLB: Melbourne, FL -KNQA: Memphis, TN -KAMX: Miami, FL -KMAF: Midland/odessa, TX -KTLX: Norman, OK -KHTX: Huntsville, AL -KMOB: Mobile, AL -KTLH: Tallahassee, FL -KTBW: Tampa Bay Area, FL -KSJT: San Angelo, TX -KINX: Tulsa, OK -KSRX: Tulsa, OK -KLIX: New Orleans/slidell, LA -KDGX: Jackson, MS -KSHV: Shreveport, LA -ICAO: Responsible WFO -KLGX: Seattle / Tacoma, WA -KOTX: Spokane, WA -KEMX: Tucson, AZ -KYUX: Phoenix, AZ -KNKX: San Diego, CA -KMUX: Monterey/san Francisco, CA -KHNX: San Joaquin/hanford, CA -KSOX: San Diego, CA -KATX: Seattle / Tacoma, WA -KIWA: Phoenix, AZ -KRTX: Portland, OR -KSFX: Pocatello, ID -KRGX: Reno, NV -KDAX: Sacramento, CA -KMTX: Salt Lake City, UT -KPDT: Pendleton, OR -KMSX: Missoula, MT -KESX: Las Vegas, NV -KVTX: Los Angeles, CA -KMAX: Medford, OR -KFSX: Flagstaff, AZ -KGGW: Glasgow, MT -KLRX: Elko, NV -KBHX: Eureka, CA -KTFX: Great Falls, MT -KCBX: Boise, ID -KBLX: Billings, MT -KICX: Salt Lake City, UT -ICAO: Responsible Wfo W/ MSCF -PABC: Anchorage, AK -PAPD: Fairbanks, AK -PHKM: Honolulu, HI -PAHG: Anchorage, AK -PAKC: Anchorage, AK -PAIH: Anchorage, AK -PHMO: Honolulu, HI -PAEC: Fairbanks, AK -TJUA: San Juan, PR -PACG: Juneau, AK -PHKI: Honolulu, HI -PHWA: Honolulu, HI -ICAO: Responsible Wfo W/ MSCF -KFDR: Norman, OK -PGUA: Guam -KBBX: Sacramento, CA -KFDX: Albuquerque, NM -KGWX: Jackson, MS -KDOX: Wakefield, VA -KDYX: San Angelo, TX -KEYX: Las Vegas, NV -KEVX: Mobile, AL -KHPX: Paducah, KY -KTYX: Burlington, VT -KGRK: Dallas / Ft. Worth, TX -KPOE: Lake Charles, LA -KEOX: Tallahassee, FL -KHDX: El Paso, TX -KDFX: San Antonio, TX -KMXX: Birmingham, AL -KMBX: Bismarck, ND -KVAX: Jacksonville, FL -KJGX: Peachtree City/atlanta, GA -KVNX: Norman, OK -KVBX: Vandenberg Afb: Orcutt, CA" | dmenu -r -i -l 50 -p "Select a National Weather Service radar to use as default:" | sed "s/:.*//" | tr "[:lower:]" "[:upper:]")" +pickloc() { chosen="$(echo "US: Northeast +US: Southeast +US: PacNorthWest +US: PacSouthWest +US: UpperMissVly +US: SouthMissVly +US: SouthPlains +US: NorthRockies +US: SouthRockies +US: Alaska +US: Carib +US: Hawaii +US: CentGrLakes +US: Conus-Large +US: KABR: Aberdeen, SD +US: KBIS: Bismarck, ND +US: KFTG: Denver/Boulder, CO +US: KDMX: Des Moines, IA +US: KDTX: Detroit, MI +US: KDDC: Dodge City, KS +US: KDLH: Duluth, MN +US: KCYS: Cheyenne, WY +US: KLOT: Chicago, IL +US: KGLD: Goodland, KS +US: KUEX: Hastings, NE +US: KGJX: Grand Junction, CO +US: KGRR: Grand Rapids, MI +US: KMVX: Fargo/Grand Forks, ND +US: KGRB: Green Bay, WI +US: KIND: Indianapolis, IN +US: KJKL: Jackson, KY +US: KARX: La Crosse, WI +US: KILX: Lincoln/Central Illinois, IL +US: KLVX: Louisville, KY +US: KMQT: Marquette +US: KMKX: Milwaukee, WI +US: KMPX: Minneapolis, MN +US: KAPX: Gaylord/Alpena, MI +US: KLNX: North Platte, NE +US: KIWX: N. Webster/Northern, IN +US: KOAX: Omaha, NE +US: KPAH: Paducah, KY +US: KEAX: Pleasant Hill, MO +US: KPUX: Pueblo, CO +US: KDVN: Quad Cities, IA +US: KUDX: Rapid City, SD +US: KRIW: Riverton, WY +US: KSGF: Springfield, MO +US: KLSX: St. LOUIS, MO +US: KFSD: Sioux Falls, IA +US: KTWX: Topeka, KS +US: KICT: Wichita, KS +US: KVWX: Paducah, KY +US: ICAO: Responsible Wfo +US: KLTX: WILMINGTON, NC +US: KCCX: State College/Central, PA +US: KLWX: Sterling, VA +US: KFCX: Blacksburg/Roanoke, VA +US: KRAX: Raleigh/Durham, NC +US: KGYX: Portland, ME +US: KDIX: Mt Holly/Philadelphia, PA +US: KPBZ: Pittsburgh, PA +US: KAKQ: Wakefield, VA +US: KMHX: Morehead City, NC +US: KGSP: Greer/Greenville/Sprtbg, SC +US: KILN: Wilmington/Cincinnati, OH +US: KCLE: Cleveland, OH +US: KCAE: Columbia, SC +US: KBGM: Binghamton, NY +US: KENX: Albany, NY +US: KBUF: Buffalo, NY +US: KCXX: Burlington, VT +US: KCBW: Caribou, ME +US: KBOX: Boston /Taunton, MA +US: KOKX: New York City, NY +US: KCLX: Charleston, SC +US: KRLX: Charleston, WV +US: ICAO: Responsible WFO +US: KBRO: Brownsville, TX +US: KABX: Albuquerque, NM +US: KAMA: Amarillo, TX +US: KFFC: Peachtree City/Atlanta, GA +US: KEWX: Austin/Sanantonio, TX +US: KBMX: Birmingham, AL +US: KCRP: Corpus Christi, TX +US: KFWS: Dallas / Ft. Worth, TX +US: KEPZ: El Paso, TX +US: KHGX: Houston/ Galveston, TX +US: KJAX: Jacksonville, FL +US: KBYX: Key West, FL +US: KMRX: Morristown/knoxville, TN +US: KLBB: Lubbock, TX +US: KLZK: Little Rock, AR +US: KLCH: Lake Charles, LA +US: KOHX: Nashville, TN +US: KMLB: Melbourne, FL +US: KNQA: Memphis, TN +US: KAMX: Miami, FL +US: KMAF: Midland/odessa, TX +US: KTLX: Norman, OK +US: KHTX: Huntsville, AL +US: KMOB: Mobile, AL +US: KTLH: Tallahassee, FL +US: KTBW: Tampa Bay Area, FL +US: KSJT: San Angelo, TX +US: KINX: Tulsa, OK +US: KSRX: Tulsa, OK +US: KLIX: New Orleans/slidell, LA +US: KDGX: Jackson, MS +US: KSHV: Shreveport, LA +US: ICAO: Responsible WFO +US: KLGX: Seattle / Tacoma, WA +US: KOTX: Spokane, WA +US: KEMX: Tucson, AZ +US: KYUX: Phoenix, AZ +US: KNKX: San Diego, CA +US: KMUX: Monterey/san Francisco, CA +US: KHNX: San Joaquin/hanford, CA +US: KSOX: San Diego, CA +US: KATX: Seattle / Tacoma, WA +US: KIWA: Phoenix, AZ +US: KRTX: Portland, OR +US: KSFX: Pocatello, ID +US: KRGX: Reno, NV +US: KDAX: Sacramento, CA +US: KMTX: Salt Lake City, UT +US: KPDT: Pendleton, OR +US: KMSX: Missoula, MT +US: KESX: Las Vegas, NV +US: KVTX: Los Angeles, CA +US: KMAX: Medford, OR +US: KFSX: Flagstaff, AZ +US: KGGW: Glasgow, MT +US: KLRX: Elko, NV +US: KBHX: Eureka, CA +US: KTFX: Great Falls, MT +US: KCBX: Boise, ID +US: KBLX: Billings, MT +US: KICX: Salt Lake City, UT +US: ICAO: Responsible Wfo W/ MSCF +US: PABC: Anchorage, AK +US: PAPD: Fairbanks, AK +US: PHKM: Honolulu, HI +US: PAHG: Anchorage, AK +US: PAKC: Anchorage, AK +US: PAIH: Anchorage, AK +US: PHMO: Honolulu, HI +US: PAEC: Fairbanks, AK +US: TJUA: San Juan, PR +US: PACG: Juneau, AK +US: PHKI: Honolulu, HI +US: PHWA: Honolulu, HI +US: ICAO: Responsible Wfo W/ MSCF +US: KFDR: Norman, OK +US: PGUA: Guam +US: KBBX: Sacramento, CA +US: KFDX: Albuquerque, NM +US: KGWX: Jackson, MS +US: KDOX: Wakefield, VA +US: KDYX: San Angelo, TX +US: KEYX: Las Vegas, NV +US: KEVX: Mobile, AL +US: KHPX: Paducah, KY +US: KTYX: Burlington, VT +US: KGRK: Dallas / Ft. Worth, TX +US: KPOE: Lake Charles, LA +US: KEOX: Tallahassee, FL +US: KHDX: El Paso, TX +US: KDFX: San Antonio, TX +US: KMXX: Birmingham, AL +US: KMBX: Bismarck, ND +US: KVAX: Jacksonville, FL +US: KJGX: Peachtree City/atlanta, GA +US: KVNX: Norman, OK +US: KVBX: Vandenberg Afb: Orcutt, CA +EU: Europe +EU: GB: Great Brittain +EU: SCAN: Scandinavia +EU: ALPS: The Alps +EU: NL: The Netherlands +EU: DE: Germany +EU: SP: Spain +EU: FR: France +EU: IT: Italy +EU: PL: Poland +EU: GR: Greece +EU: TU: Turkey +EU: RU: Russia +EU: BA: Bahrain +EU: BC: Botswana +EU: SE: Republic of Seychelles +EU: HU: Hungary +EU: UK: Ukraine +AF: AF: Africa +AF: WA: West Africa +AF: ZA: South Africa +AF: DZ: Algeria +AF: CE: Canary Islands +AF: NG: Nigeria +AF: TD: Chad +AF: CG: Democratic Republic of Congo +AF: EG: Egypt +AF: ET: Ethiopia +AF: CM: Cameroon +AF: IS: Israel +AF: LY: Libya +AF: MG: Madagascar +AF: MO: Morocco +AF: BW: Namibia +AF: SA: Saudi Arabia +AF: SO: Somalia +AF: SD: Sudan +AF: TZ: Tanzania +AF: TN: Tunisia +AF: ZM: Zambia +AF: KE: Kenya +AF: AO: Angola" | dmenu -r -i -l 50 -p "Select a radar to use as default:" | tr "[:lower:]" "[:upper:]")" + +# Set continent code and radar code. +continentcode=$(echo "$chosen" | sed "s/:.*//") +radarcode=$(echo "$chosen" | sed "s/..: // ; s/:.*//") # Sanity check of selection and ensure user did not escape. -echo "$chosen" | grep -q "^[A-Z]\+$" && echo "$chosen" > "$radarloc" ;} +echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "$continentcode,$radarcode" | cut -d' ' -f1 > "$radarloc" ;} getdoppler() { - loc="$(cat "$radarloc")" + cont="$(cat "$radarloc" | sed "s/,.*//")" + loc="$(cat "$radarloc" | cut -c 4-)" notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc." - curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;} + if [ $cont == "US" ] ; then + curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ; + elif [ $cont == "EU" ] ; then + curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ; + elif [ $cont == "AF" ] ; then + curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ; + fi +} showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;} @@ -198,7 +252,7 @@ case $BLOCK_BUTTON in showdoppler ;; 2) pickloc && getdoppler && showdoppler ;; 3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR. -- Middle click to update change RADAR location. +- Middle click to update RADAR location. After $secs seconds, new clicks will also automatically update the doppler RADAR." ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac From 9ad912fe4eaf8c1b9c844780829aaea693c1e6de Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:12:41 +0200 Subject: [PATCH 061/102] Cut isn't needed here --- .local/bin/statusbar/sb-doppler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index edbc88a1..cf765f64 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -229,7 +229,7 @@ continentcode=$(echo "$chosen" | sed "s/:.*//") radarcode=$(echo "$chosen" | sed "s/..: // ; s/:.*//") # Sanity check of selection and ensure user did not escape. -echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "$continentcode,$radarcode" | cut -d' ' -f1 > "$radarloc" ;} +echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "%s,%s\\n" "$continentcode" "$radarcode" > "$radarloc" ;} getdoppler() { cont="$(cat "$radarloc" | sed "s/,.*//")" From 64f31bf86c9a96394194f54da77e9ae153b92dcb Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 14 Oct 2021 20:44:40 +0200 Subject: [PATCH 062/102] Add some variables --- .config/wal/postrun | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.config/wal/postrun b/.config/wal/postrun index 85d9e3fa..d9a91617 100755 --- a/.config/wal/postrun +++ b/.config/wal/postrun @@ -1,13 +1,16 @@ #!/bin/bash +dunstconf="${HOME}/.config/dunst/dunstrc" +zathuraconf="${HOME}/.config/zathura/zathurarc" + source "${HOME}/.cache/wal/colors.sh" -mkdir -p "${HOME}/.config/dunst" -mkdir -p "${HOME}/.config/zathura" -mv -n "${HOME}/.config/dunst/dunstrc" "${HOME}/.config/dunst/dunstrc.bak" -mv -n "${HOME}/.config/zathura/zathurarc" "${HOME}/.config/zathura/zathurarc.bak" -ln -sf "${HOME}/.cache/wal/dunstrc" "${HOME}/.config/dunst/dunstrc" -ln -sf "${HOME}/.cache/wal/zathurarc" "${HOME}/.config/zathura/zathurarc" +mkdir -p "$dunstconf" +mkdir -p "$zathuraconf" +mv -n "$dunstconf" "$dunstconf.bak" +mv -n "$zathuraconf" "$zathuraconf.bak" +ln -sf "${HOME}/.cache/wal/dunstrc" "$dunstconf" +ln -sf "${HOME}/.cache/wal/zathurarc" "$zathuraconf" fix_sequences() { e=$'\e' From 6faae93d1598e988c75086a36cc99c0eed834f2d Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 14 Oct 2021 20:46:07 +0200 Subject: [PATCH 063/102] Replicate tail functionality in awk --- .local/bin/displayselect | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index f9e80628..0b33f7bd 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -14,9 +14,9 @@ twoscreen() { # If multi-monitor is selected and there are two screens. internal=$(echo "$screens" | grep -v "$external") res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \ - tail -n 1 | awk '{print $1}') + awk 'END {print $1}') res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \ - tail -n 1 | awk '{print $1}') + awk 'END {print $1}') res_ext_x=$(echo "$res_external" | sed 's/x.*//') res_ext_y=$(echo "$res_external" | sed 's/.*x//') From 40af3ab99263ebbf6790659414d2db3771fc0ac4 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 14 Oct 2021 20:47:33 +0200 Subject: [PATCH 064/102] Use setsid --- .local/bin/samedir | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.local/bin/samedir b/.local/bin/samedir index 73facfd4..82397d32 100755 --- a/.local/bin/samedir +++ b/.local/bin/samedir @@ -2,7 +2,4 @@ # Open a terminal window in the same directory as the currently active window. -PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) -PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')" -cd "$(readlink /proc/"$PID"/cwd)" || return 1 -"$TERMINAL" +setsid -f $TERMINAL >/dev/null 2>&1 From 7dbc757a64d8d21db29b208a22b6165e32719fab Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 14 Oct 2021 20:50:00 +0200 Subject: [PATCH 065/102] Add some conf file variables --- .local/bin/setbg | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.local/bin/setbg b/.local/bin/setbg index 7f997b7d..b0938fd0 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -9,6 +9,10 @@ # Location of link to wallpaper link. bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" +# Configuration files of applications that have their themes changed by pywal. +dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" +zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" + trueloc="$(readlink -f "$1")" && case "$(file --mime-type -b "$trueloc")" in image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;; @@ -18,12 +22,12 @@ esac # If pywal is installed, use it. if command -v wal >/dev/null 2>&1 ; then - wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 && - pidof dwm >/dev/null && xdotool key super+F12 + wal -i "$(readlink -f $bgloc)" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 && + pidof dwm >/dev/null && xdotool key super+F12 # If pywal is removed, return config files to normal. else - [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" - [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" ] && unlink "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" && mv "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc.bak" "${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" + [ -f "$dunstconf.bak" ] && unlink "$dunstconf" && mv "$dunstconf.bak" "$dunstconf" + [ -f "$zathuraconf.bak" ] && unlink "$zathuraconf" && mv "$zathuraconf.bak" "$zathuraconf" fi xwallpaper --zoom "$bgloc" From 995cff49e6c1aca486ead9c1ced973d575d44e64 Mon Sep 17 00:00:00 2001 From: Colby Thomas Date: Sun, 17 Oct 2021 22:57:47 -0600 Subject: [PATCH 066/102] muting volume when 0%, space between icon and percentage --- .local/bin/statusbar/sb-volume | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index 61588c3f..dcfd0d62 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -19,10 +19,12 @@ vol="$(pamixer --get-volume)" if [ "$vol" -gt "70" ]; then icon="🔊" -elif [ "$vol" -lt "30" ]; then +elif [ "$vol" -gt "30" ]; then + icon="🔉" +elif [ "$vol" -gt "0" ]; then icon="🔈" else - icon="🔉" + echo 🔇 && exit fi -echo "$icon$vol%" +echo "$icon $vol%" From 96c782f5121d18896470582ead77dbeb8555265e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 18 Oct 2021 08:50:15 -0400 Subject: [PATCH 067/102] l --- .local/bin/statusbar/sb-volume | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index dcfd0d62..3cfdc457 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -27,4 +27,4 @@ else echo 🔇 && exit fi -echo "$icon $vol%" +echo "$icon$vol%" From 56caae7b0316eab26392090a62eb2bf4cd4887d5 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:53:06 +0200 Subject: [PATCH 068/102] Revert changes to displayselect (already best performance) --- .local/bin/displayselect | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 0b33f7bd..f9e80628 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -14,9 +14,9 @@ twoscreen() { # If multi-monitor is selected and there are two screens. internal=$(echo "$screens" | grep -v "$external") res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \ - awk 'END {print $1}') + tail -n 1 | awk '{print $1}') res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \ - awk 'END {print $1}') + tail -n 1 | awk '{print $1}') res_ext_x=$(echo "$res_external" | sed 's/x.*//') res_ext_y=$(echo "$res_external" | sed 's/.*x//') From 7c6b8a85b69dbc3dca55b28f4078ac86fc01cf48 Mon Sep 17 00:00:00 2001 From: Ethan Marshall Date: Wed, 20 Oct 2021 15:24:29 +0100 Subject: [PATCH 069/102] Small newsup fix (#1023) Only update titles which *exactly* match the title "newsboat" --- .local/bin/cron/newsup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index cc50e78c..ed266d73 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -5,7 +5,7 @@ /usr/bin/notify-send "📰 Updating RSS feeds..." -pgrep -f 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}" From 714aa92a9596352d4f70e35d212fe922c23348b4 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:27:40 +0200 Subject: [PATCH 070/102] ext: Remove in favor of atool (#1013) * ext: Give the ability to extract multiple files and wildcards * Variable renaming * Make user get prompted if extracted file overwrites another file * Deleted ext We have atool * Replace ext with aunpack --- .config/lf/lfrc | 2 +- .local/bin/ext | 45 --------------------------------------------- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100755 .local/bin/ext diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 41013384..9ec68303 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -36,7 +36,7 @@ cmd extract ${{ printf "%s\n\t" "$fx" printf "extract?[y/N]" read ans - [ $ans = "y" ] && ext $fx + [ $ans = "y" ] && aunpack $fx }} cmd delete ${{ diff --git a/.local/bin/ext b/.local/bin/ext deleted file mode 100755 index 6950ff63..00000000 --- a/.local/bin/ext +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -# A general, all-purpose extraction script. Not all extraction programs here -# are installed by LARBS automatically. -# -# Default behavior: Extract archive into new directory -# Behavior with `-c` option: Extract contents into current directory - -while getopts "hc" o; do case "${o}" in - c) extracthere="True" ;; - *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit 1 ;; -esac done - -if [ -z "$extracthere" ]; then - archive="$(readlink -f "$*")" && - directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" && - mkdir -p "$directory" && - cd "$directory" || exit 1 -else - archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)" 2>/dev/null)" -fi - -[ -z "$archive" ] && printf "Give archive to extract as argument.\\n" && exit 1 - -if [ -f "$archive" ] ; then - case "$archive" in - *.tar.bz2|*.tbz2) bsdtar -xf "$archive" ;; - *.tar.xz) bsdtar -xf "$archive" ;; - *.tar.gz|*.tgz) bsdtar -xf "$archive" ;; - *.tar.zst) bsdtar -xf "$archive" ;; - *.tar) bsdtar -xf "$archive" ;; - *.lzma) unlzma "$archive" ;; - *.bz2) bunzip2 "$archive" ;; - *.rar) unrar x -ad "$archive" ;; - *.gz) gunzip "$archive" ;; - *.zip) unzip "$archive" ;; - *.Z) uncompress "$archive" ;; - *.7z) 7z x "$archive" ;; - *.xz) unxz "$archive" ;; - *.exe) cabextract "$archive" ;; - *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; - esac -else - printf "File \"%s\" not found.\\n" "$archive" -fi From cb7879cd7ecc7d226bcb3f00c6cc0e343f03bff7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 20 Oct 2021 10:32:46 -0400 Subject: [PATCH 071/102] unbreak samedir --- .local/bin/samedir | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/samedir b/.local/bin/samedir index 82397d32..73facfd4 100755 --- a/.local/bin/samedir +++ b/.local/bin/samedir @@ -2,4 +2,7 @@ # Open a terminal window in the same directory as the currently active window. -setsid -f $TERMINAL >/dev/null 2>&1 +PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) +PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')" +cd "$(readlink /proc/"$PID"/cwd)" || return 1 +"$TERMINAL" From 18dad565fa03801f12bc010324e578d32a4883e0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 20 Oct 2021 10:50:13 -0400 Subject: [PATCH 072/102] inconsequential efficiency --- .local/bin/samedir | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.local/bin/samedir b/.local/bin/samedir index 73facfd4..0a19707e 100755 --- a/.local/bin/samedir +++ b/.local/bin/samedir @@ -2,7 +2,9 @@ # Open a terminal window in the same directory as the currently active window. -PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) -PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')" +PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p") +PID="$(pstree -lpA "$PID")" +PID="${PID##*(}" +PID="${PID%)}" cd "$(readlink /proc/"$PID"/cwd)" || return 1 "$TERMINAL" From 0cc1758b0219704cf5a72b8e06150c54041a98e5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 22 Oct 2021 16:50:26 -0400 Subject: [PATCH 073/102] ifinstalled better, close #1047 --- .local/bin/ifinstalled | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled index 7a53b18c..ff364666 100755 --- a/.local/bin/ifinstalled +++ b/.local/bin/ifinstalled @@ -5,9 +5,7 @@ # it informs the user that they need that command to continue. This is used in # various other scripts for clarity's sake. -for x in "$@";do - notify() { notify-send "📦 $x" "must be installed for this function." && exit 1 ;} - which_out="$( /usr/bin/which "$x" >/dev/null 2>&1 )" && exit 0 #you might have compiled the prog, and not install the repo pkg... - pkgname="$(pacman -Qqo "$which_out" >/dev/null 2>&1 )" #...thats why two variables. - pacman -Qq "$pkgname" >/dev/null 2>&1 || notify +for x in "$@"; do + { ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1 ;} && + notify-send "📦 $x" "must be installed for this function." && exit 1 ; done From 2ddfa7ab0f2597b26be9872e37d7374b75a72678 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 23 Oct 2021 10:27:45 -0400 Subject: [PATCH 074/102] better fix --- .local/bin/ifinstalled | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled index ff364666..c192eba0 100755 --- a/.local/bin/ifinstalled +++ b/.local/bin/ifinstalled @@ -6,6 +6,7 @@ # various other scripts for clarity's sake. for x in "$@"; do - { ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1 ;} && - notify-send "📦 $x" "must be installed for this function." && exit 1 ; + if ! which "$x" >/dev/null 2>&1 && ! pacman -Qq "$x" >/dev/null 2>&1; then + notify-send "📦 $x" "must be installed for this function." && exit 1 ; + fi done From 90fa3d5b3be9a4c03150eb76d1dae94076f899f7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 11 Nov 2021 10:14:08 -0500 Subject: [PATCH 075/102] manually set dpi --- .config/x11/xprofile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/x11/xprofile b/.config/x11/xprofile index f7182e19..846cb226 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -1,5 +1,8 @@ #!/bin/sh +DPI=96 + +xrandr --dpi "$DPI" # This file runs when a DM logs you into a graphical session. # If you use startx/xinit like a Chad, this file will also be sourced. From ab8ab913dab74ba8e94066b495969b01ecc2efd3 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 11 Nov 2021 11:32:36 -0500 Subject: [PATCH 076/102] fix #1011 --- .config/x11/xprofile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.config/x11/xprofile b/.config/x11/xprofile index 846cb226..6e95b158 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -1,19 +1,18 @@ #!/bin/sh -DPI=96 - -xrandr --dpi "$DPI" # This file runs when a DM logs you into a graphical session. # If you use startx/xinit like a Chad, this file will also be sourced. +xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger screens. setbg & # set the background with the `setbg` script -#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Uncomment to use Xresources colors/settings on startup -mpd & # music player daemon-you might prefer it as a service though +#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup remaps & # run the remaps script, switching caps/esc and more; check it for more info -xcompmgr & # xcompmgr for transparency -dunst & # dunst for notifications -xset r rate 300 50 & # Speed xrate up -unclutter & # Remove mouse when idle + +autostart="mpd xcompmgr dunst unclutter" + +for program in $autostart; do + pidof -s "$program" || setsid -f "$program" +done >/dev/null 2>&1 # This line autostarts an instance of Pulseaudio that does not exit on idle. # This is "necessary" on Artix due to a current bug between PA and @@ -21,3 +20,6 @@ unclutter & # Remove mouse when idle pidof -s runit && ! pidof -s pulseaudio >/dev/null 2>&1 && setsid -f pulseaudio --start --exit-idle-time=-1 >/dev/null 2>&1 + +# Ensure that xrdb has finished running before moving on to start the WM/DE. +[ -n "$xrdbpid" ] && wait "$xrdbpid" From 11b7fb7b45cdd9af8d3ea3d570986dc03779ba2e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 11 Nov 2021 12:47:17 -0500 Subject: [PATCH 077/102] some dunst and wal fixes, fix #1029 --- .config/dunst/dunstrc | 157 ++++------------------------------ .config/wal/postrun | 34 ++++---- .config/wal/templates/dunstrc | 157 ++++------------------------------ 3 files changed, 49 insertions(+), 299 deletions(-) diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index abf55860..3752b6e6 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -1,152 +1,27 @@ [global] monitor = 0 follow = keyboard - geometry = "350x5-0+24" - indicate_hidden = yes - shrink = yes - transparency = 20 - notification_height = 0 - separator_height = 2 - padding = 0 - horizontal_padding = 8 - frame_width = 3 - frame_color = "#282828" - - # Define a color for the separator. - # possible values are: - # * auto: dunst tries to find a color fitting to the background; - # * foreground: use the same color as the foreground; - # * frame: use the same color as the frame; - # * anything else will be interpreted as a X color. - separator_color = frame - - # Sort messages by urgency. - sort = yes - - idle_threshold = 120 - font = Monospace 14 - line_height = 0 - markup = full - - # The format of the message. Possible variables are: - # %a appname - # %s summary - # %b body - # %i iconname (including its path) - # %I iconname (without its path) - # %p progress value if set ([ 0%] to [100%]) or nothing - # %n progress value if set without any extra characters - # %% Literal % - # Markup is allowed + width = 370 + height = 350 + offset = 0x19 + padding = 2 + horizontal_padding = 2 + transparency = 25 + font = Monospace 12 format = "%s\n%b" - alignment = left - show_age_threshold = 60 - word_wrap = yes - ellipsize = middle - ignore_newline = no - stack_duplicates = true - hide_duplicate_count = true - show_indicators = yes - icon_position = left - max_icon_size = 40 - #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/Adwaita/256x256/status/ - sticky_history = yes - history_length = 20 - dmenu = /usr/bin/dmenu -p dunst: - browser = /usr/bin/firefox -new-tab - - # Always run rule-defined scripts, even if the notification is suppressed - always_run_script = true - - title = Dunst - class = Dunst - startup_notification = false - force_xinerama = false -[experimental] - per_monitor_dpi = false - -[shortcuts] - close = ctrl+space - close_all = ctrl+shift+space - history = ctrl+grave - context = ctrl+shift+period - [urgency_low] - # IMPORTANT: colors have to be defined in quotation marks. - # Otherwise the "#" and following would be interpreted as a comment. - background = "#282828" - foreground = "#928374" - timeout = 5 - # Icon for notifications with low urgency, uncomment to enable - #icon = /path/to/icon + background = "#040509" + foreground = "#70896e" + timeout = 3 [urgency_normal] - background = "#458588" - foreground = "#ebdbb2" + foreground = "#a0c49e" + background = "#545069" timeout = 5 [urgency_critical] - background = "#cc2421" - foreground = "#ebdbb2" - frame_color = "#fabd2f" - timeout = 0 - -# Every section that isn't one of the above is interpreted as a rules to -# override settings for certain messages. -# Messages can be matched by "appname", "summary", "body", "icon", "category", -# "msg_urgency" and you can override the "timeout", "urgency", "foreground", -# "background", "new_icon" and "format". -# Shell-like globbing will get expanded. -# -# SCRIPTING -# You can specify a script that gets run when the rule matches by -# setting the "script" option. -# The script will be called as follows: -# script appname summary body icon urgency -# where urgency can be "LOW", "NORMAL" or "CRITICAL". -# -# NOTE: if you don't want a notification to be displayed, set the format -# to "". -# NOTE: It might be helpful to run dunst -print in a terminal in order -# to find fitting options for rules. - -#[espeak] -# summary = "*" -# script = dunst_espeak.sh - -#[script-test] -# summary = "*script*" -# script = dunst_test.sh - -#[ignore] -# # This notification will not be displayed -# summary = "foobar" -# format = "" - -#[history-ignore] -# # This notification will not be saved in history -# summary = "foobar" -# history_ignore = yes - -#[signed_on] -# appname = Pidgin -# summary = "*signed on*" -# urgency = low -# -#[signed_off] -# appname = Pidgin -# summary = *signed off* -# urgency = low -# -#[says] -# appname = Pidgin -# summary = *says* -# urgency = critical -# -#[twitter] -# appname = Pidgin -# summary = *twitter.com* -# urgency = normal -# -# vim: ft=cfg + background = "#4D314E" + foreground = "#a0c49e" + frame_color = "#544858" + timeout = 10 diff --git a/.config/wal/postrun b/.config/wal/postrun index d9a91617..7eb8d117 100755 --- a/.config/wal/postrun +++ b/.config/wal/postrun @@ -1,16 +1,17 @@ #!/bin/bash -dunstconf="${HOME}/.config/dunst/dunstrc" -zathuraconf="${HOME}/.config/zathura/zathurarc" +dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" +zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" -source "${HOME}/.cache/wal/colors.sh" +source "${XDG_CACHE_HOME:-$HOME/.cache}/wal/colors.sh" -mkdir -p "$dunstconf" -mkdir -p "$zathuraconf" -mv -n "$dunstconf" "$dunstconf.bak" -mv -n "$zathuraconf" "$zathuraconf.bak" -ln -sf "${HOME}/.cache/wal/dunstrc" "$dunstconf" -ln -sf "${HOME}/.cache/wal/zathurarc" "$zathuraconf" +mkdir -p "${dunstconf##*/}" "${zathuraconf##*/}" + +mv -n "$dunstconf" "$dunstconf.bak" +mv -n "$zathuraconf" "$zathuraconf.bak" + +ln -sf "${XDG_CACHE_HOME:-$HOME/.cache}/wal/dunstrc" "$dunstconf" +ln -sf "${XDG_CACHE_HOME:-$HOME/.cache}/wal/zathurarc" "$zathuraconf" fix_sequences() { e=$'\e' @@ -19,14 +20,13 @@ fix_sequences() { background_color="$(echo -e "${sequences}\c" | grep --color=never -Eo "${e}]11[^${e}\\\\]*?${e}\\\\" | grep --color=never -Eo "#[0-9A-Fa-f]{6}")" cursor_color="$(echo -e "${sequences}\c" | grep --color=never -Eo "${e}]12[^${e}\\\\]*?${e}\\\\" | grep --color=never -Eo "#[0-9A-Fa-f]{6}")" -for term in /dev/pts/{0..9}* -do -echo -e "\e]4;256;${cursor_color}\a\c" > "${term}" 2>/dev/null -echo -e "\e]4;258;${background_color}\a\c" > "${term}" 2>/dev/null -echo -e "\e]4;259;${foreground_color}\a\c" > "${term}" 2>/dev/null -done + for term in /dev/pts/{0..9}*; do + echo -e "\e]4;256;${cursor_color}\a\c" > "${term}" 2>/dev/null + echo -e "\e]4;258;${background_color}\a\c" > "${term}" 2>/dev/null + echo -e "\e]4;259;${foreground_color}\a\c" > "${term}" 2>/dev/null + done } -fix_sequences <"${HOME}/.cache/wal/sequences" +fix_sequences <"${XDG_CACHE_HOME:-$HOME/.cache}/wal/sequences" -pkill dunst; dunst & +pkill dunst; setsid -f dunst diff --git a/.config/wal/templates/dunstrc b/.config/wal/templates/dunstrc index 9a625006..5a2e0205 100644 --- a/.config/wal/templates/dunstrc +++ b/.config/wal/templates/dunstrc @@ -1,152 +1,27 @@ [global] monitor = 0 follow = keyboard - geometry = "350x5-0+24" - indicate_hidden = yes - shrink = yes - transparency = 20 - notification_height = 0 - separator_height = 2 - padding = 0 - horizontal_padding = 8 - frame_width = 3 - frame_color = "{color4}" - - # Define a color for the separator. - # possible values are: - # * auto: dunst tries to find a color fitting to the background; - # * foreground: use the same color as the foreground; - # * frame: use the same color as the frame; - # * anything else will be interpreted as a X color. - separator_color = frame - - # Sort messages by urgency. - sort = yes - - idle_threshold = 120 - font = Monospace 14 - line_height = 0 - markup = full - - # The format of the message. Possible variables are: - # %a appname - # %s summary - # %b body - # %i iconname (including its path) - # %I iconname (without its path) - # %p progress value if set ([ 0%] to [100%]) or nothing - # %n progress value if set without any extra characters - # %% Literal % - # Markup is allowed + width = 370 + height = 350 + offset = 0x19 + padding = 2 + horizontal_padding = 2 + transparency = 25 + font = Monospace 12 format = "%s\n%b" - alignment = left - show_age_threshold = 60 - word_wrap = yes - ellipsize = middle - ignore_newline = no - stack_duplicates = true - hide_duplicate_count = true - show_indicators = yes - icon_position = left - max_icon_size = 40 - #icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/:/usr/share/icons/Adwaita/256x256/status/ - sticky_history = yes - history_length = 20 - dmenu = /usr/bin/dmenu -p dunst: - browser = /usr/bin/firefox -new-tab - - # Always run rule-defined scripts, even if the notification is suppressed - always_run_script = true - - title = Dunst - class = Dunst - startup_notification = false - force_xinerama = false -[experimental] - per_monitor_dpi = false - -[shortcuts] - close = ctrl+space - close_all = ctrl+shift+space - history = ctrl+grave - context = ctrl+shift+period - [urgency_low] - # IMPORTANT: colors have to be defined in quotation marks. - # Otherwise the "#" and following would be interpreted as a comment. - background = "{background}" - foreground = "{foreground}" - timeout = 5 - # Icon for notifications with low urgency, uncomment to enable - #icon = /path/to/icon + background = "{color0}" # color0 + foreground = "{color8}" # color8 + timeout = 3 [urgency_normal] - background = "{background}" - foreground = "{foreground}" + foreground = "{color15}" # color15 + background = "{color4}" # color4 timeout = 5 [urgency_critical] - background = "{background}" - foreground = "{foreground}" - frame_color = "#fabd2f" - timeout = 0 - -# Every section that isn't one of the above is interpreted as a rules to -# override settings for certain messages. -# Messages can be matched by "appname", "summary", "body", "icon", "category", -# "msg_urgency" and you can override the "timeout", "urgency", "foreground", -# "background", "new_icon" and "format". -# Shell-like globbing will get expanded. -# -# SCRIPTING -# You can specify a script that gets run when the rule matches by -# setting the "script" option. -# The script will be called as follows: -# script appname summary body icon urgency -# where urgency can be "LOW", "NORMAL" or "CRITICAL". -# -# NOTE: if you don't want a notification to be displayed, set the format -# to "". -# NOTE: It might be helpful to run dunst -print in a terminal in order -# to find fitting options for rules. - -#[espeak] -# summary = "*" -# script = dunst_espeak.sh - -#[script-test] -# summary = "*script*" -# script = dunst_test.sh - -#[ignore] -# # This notification will not be displayed -# summary = "foobar" -# format = "" - -#[history-ignore] -# # This notification will not be saved in history -# summary = "foobar" -# history_ignore = yes - -#[signed_on] -# appname = Pidgin -# summary = "*signed on*" -# urgency = low -# -#[signed_off] -# appname = Pidgin -# summary = *signed off* -# urgency = low -# -#[says] -# appname = Pidgin -# summary = *says* -# urgency = critical -# -#[twitter] -# appname = Pidgin -# summary = *twitter.com* -# urgency = normal -# -# vim: ft=cfg + background = "{color1}" # color1 + foreground = "{color15}" # color15 + frame_color = "{color11}" # color11 + timeout = 10 From 6d805941def8ba2cf6589858dd87407f97c4abab Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 11 Nov 2021 12:49:57 -0500 Subject: [PATCH 078/102] postrun fix --- .config/wal/postrun | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/wal/postrun b/.config/wal/postrun index 7eb8d117..61d8a419 100755 --- a/.config/wal/postrun +++ b/.config/wal/postrun @@ -5,7 +5,7 @@ zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" source "${XDG_CACHE_HOME:-$HOME/.cache}/wal/colors.sh" -mkdir -p "${dunstconf##*/}" "${zathuraconf##*/}" +mkdir -p "${dunstconf%/*}" "${zathuraconf%/*}" mv -n "$dunstconf" "$dunstconf.bak" mv -n "$zathuraconf" "$zathuraconf.bak" From 18de46de1a9888073969973b56442ad4766071cf Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 11 Nov 2021 13:08:29 -0500 Subject: [PATCH 079/102] colors fix --- .config/dunst/dunstrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index 3752b6e6..d03af62c 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -11,17 +11,17 @@ format = "%s\n%b" [urgency_low] - background = "#040509" - foreground = "#70896e" + background = "#1d2021" + foreground = "#928374" timeout = 3 [urgency_normal] - foreground = "#a0c49e" - background = "#545069" + foreground = "#ebdbb2" + background = "#458588" timeout = 5 [urgency_critical] - background = "#4D314E" - foreground = "#a0c49e" - frame_color = "#544858" + background = "#1cc24d" + foreground = "#ebdbb2" + frame_color = "#fabd2f" timeout = 10 From ee0203f2ac5931bd87e07dc6d0105d62a8417367 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 12 Nov 2021 17:02:41 -0500 Subject: [PATCH 080/102] lf tweaks --- .config/lf/lfrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 9ec68303..ebe16fb5 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -15,7 +15,7 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" # cmds/functions cmd open ${{ case $(file --mime-type $f -b) in - image/vnd.djvu|application/pdf|application/octet-stream) setsid -f zathura $fx >/dev/null 2>&1 ;; + image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; @@ -52,7 +52,7 @@ cmd moveto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Move to where?" - dest="$(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && + dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && for x in $fx; do eval mv -iv \"$x\" \"$dest\" done && @@ -63,7 +63,7 @@ cmd copyto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Copy to where?" - dest="$(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && + dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && for x in $fx; do eval cp -ivr \"$x\" \"$dest\" done && @@ -75,7 +75,7 @@ cmd bulkrename $vidir # Bindings map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(sed -e 's/#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" +map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" map gh map g top map D delete From 5b31e04513b3dbf88d9137bff7ec4642250921d5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 14 Nov 2021 14:39:04 -0500 Subject: [PATCH 081/102] pulseaudio replaced with pipewire --- .config/pipewire/pipewire.conf | 247 +++++++++++++++++++++++++++++++++ .config/x11/xprofile | 9 +- .local/bin/opout | 2 +- 3 files changed, 249 insertions(+), 9 deletions(-) create mode 100644 .config/pipewire/pipewire.conf diff --git a/.config/pipewire/pipewire.conf b/.config/pipewire/pipewire.conf new file mode 100644 index 00000000..c06a84cc --- /dev/null +++ b/.config/pipewire/pipewire.conf @@ -0,0 +1,247 @@ +# Daemon config file for PipeWire version "0.3.40" # +# +# Copy and edit this file in /etc/pipewire for system-wide changes +# or in ~/.config/pipewire for local changes. + +context.properties = { + ## Configure properties in the system. + #library.name.system = support/libspa-support + #context.data-loop.library.name.system = support/libspa-support + #support.dbus = true + #link.max-buffers = 64 + link.max-buffers = 16 # version < 3 clients can't handle more + #mem.warn-mlock = false + #mem.allow-mlock = true + #mem.mlock-all = false + #clock.power-of-two-quantum = true + #log.level = 2 + #cpu.zero.denormals = true + + core.daemon = true # listening for socket connections + core.name = pipewire-0 # core name and socket name + + ## Properties for the DSP configuration. + #default.clock.rate = 48000 + #default.clock.allowed-rates = [ 48000 ] + #default.clock.quantum = 1024 + #default.clock.min-quantum = 32 + #default.clock.max-quantum = 8192 + #default.video.width = 640 + #default.video.height = 480 + #default.video.rate.num = 25 + #default.video.rate.denom = 1 + # + # These overrides are only applied when running in a vm. + vm.overrides = { + default.clock.min-quantum = 1024 + } +} + +context.spa-libs = { + # = + # + # Used to find spa factory names. It maps an spa factory name + # regular expression to a library name that should contain + # that factory. + # + audio.convert.* = audioconvert/libspa-audioconvert + api.alsa.* = alsa/libspa-alsa + api.v4l2.* = v4l2/libspa-v4l2 + api.libcamera.* = libcamera/libspa-libcamera + api.bluez5.* = bluez5/libspa-bluez5 + api.vulkan.* = vulkan/libspa-vulkan + api.jack.* = jack/libspa-jack + support.* = support/libspa-support + #videotestsrc = videotestsrc/libspa-videotestsrc + #audiotestsrc = audiotestsrc/libspa-audiotestsrc +} + +context.modules = [ + #{ name = + # [ args = { = ... } ] + # [ flags = [ [ ifexists ] [ nofail ] ] + #} + # + # Loads a module with the given parameters. + # If ifexists is given, the module is ignored when it is not found. + # If nofail is given, module initialization failures are ignored. + # + + # Uses RTKit to boost the data thread priority. + { name = libpipewire-module-rtkit + args = { + #nice.level = -11 + #rt.prio = 88 + #rt.time.soft = 2000000 + #rt.time.hard = 2000000 + } + flags = [ ifexists nofail ] + } + + # Set thread priorities without using RTKit. + #{ name = libpipewire-module-rt + # args = { + # nice.level = -11 + # rt.prio = 88 + # rt.time.soft = 2000000 + # rt.time.hard = 2000000 + # } + # flags = [ ifexists nofail ] + #} + + # The native communication protocol. + { name = libpipewire-module-protocol-native } + + # The profile module. Allows application to access profiler + # and performance data. It provides an interface that is used + # by pw-top and pw-profiler. + { name = libpipewire-module-profiler } + + # Allows applications to create metadata objects. It creates + # a factory for Metadata objects. + { name = libpipewire-module-metadata } + + # Creates a factory for making devices that run in the + # context of the PipeWire server. + { name = libpipewire-module-spa-device-factory } + + # Creates a factory for making nodes that run in the + # context of the PipeWire server. + { name = libpipewire-module-spa-node-factory } + + # Allows creating nodes that run in the context of the + # client. Is used by all clients that want to provide + # data to PipeWire. + { name = libpipewire-module-client-node } + + # Allows creating devices that run in the context of the + # client. Is used by the session manager. + { name = libpipewire-module-client-device } + + # The portal module monitors the PID of the portal process + # and tags connections with the same PID as portal + # connections. + { name = libpipewire-module-portal + flags = [ ifexists nofail ] + } + + # The access module can perform access checks and block + # new clients. + { name = libpipewire-module-access + args = { + # access.allowed to list an array of paths of allowed + # apps. + #access.allowed = [ + # /usr/bin/pipewire-media-session + #] + + # An array of rejected paths. + #access.rejected = [ ] + + # An array of paths with restricted access. + #access.restricted = [ ] + + # Anything not in the above lists gets assigned the + # access.force permission. + #access.force = flatpak + } + } + + # Makes a factory for wrapping nodes in an adapter with a + # converter and resampler. + { name = libpipewire-module-adapter } + + # Makes a factory for creating links between ports. + { name = libpipewire-module-link-factory } + + # Provides factories to make session manager objects. + { name = libpipewire-module-session-manager } +] + +context.objects = [ + #{ factory = + # [ args = { = ... } ] + # [ flags = [ [ nofail ] ] + #} + # + # Creates an object from a PipeWire factory with the given parameters. + # If nofail is given, errors are ignored (and no object is created). + # + #{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc Spa:Pod:Object:Param:Props:patternType = 1 } } + #{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] } + #{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } } + #{ factory = spa-node-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } } + #{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test } } + #{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } } + + # A default dummy driver. This handles nodes marked with the "node.always-driver" + # property when no other driver is currently active. JACK clients need this. + { factory = spa-node-factory + args = { + factory.name = support.node.driver + node.name = Dummy-Driver + node.group = pipewire.dummy + priority.driver = 20000 + } + } + { factory = spa-node-factory + args = { + factory.name = support.node.driver + node.name = Freewheel-Driver + priority.driver = 19000 + node.group = pipewire.freewheel + node.freewheel = true + } + } + # This creates a new Source node. It will have input ports + # that you can link, to provide audio for this source. + #{ factory = adapter + # args = { + # factory.name = support.null-audio-sink + # node.name = "my-mic" + # node.description = "Microphone" + # media.class = "Audio/Source/Virtual" + # audio.position = "FL,FR" + # } + #} + + # This creates a single PCM source device for the given + # alsa device path hw:0. You can change source to sink + # to make a sink in the same way. + #{ factory = adapter + # args = { + # factory.name = api.alsa.pcm.source + # node.name = "alsa-source" + # node.description = "PCM Source" + # media.class = "Audio/Source" + # api.alsa.path = "hw:0" + # api.alsa.period-size = 1024 + # api.alsa.headroom = 0 + # api.alsa.disable-mmap = false + # api.alsa.disable-batch = false + # audio.format = "S16LE" + # audio.rate = 48000 + # audio.channels = 2 + # audio.position = "FL,FR" + # } + #} +] + +context.exec = [ + #{ path = [ args = "" ] } + # + # Execute the given program with arguments. + # + # You can optionally start the session manager here, + # but it is better to start it as a systemd service. + # Run the session manager with -h for options. + # + #{ path = "/usr/bin/pipewire-media-session" args = "" } + # + # You can optionally start the pulseaudio-server here as well + # but it is better to start it as a systemd service. + # It can be interesting to start another daemon here that listens + # on another address with the -a option (eg. -a tcp:4713). + # + #{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" } +] diff --git a/.config/x11/xprofile b/.config/x11/xprofile index 6e95b158..72d6b338 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -8,18 +8,11 @@ setbg & # set the background with the `setbg` script #xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup remaps & # run the remaps script, switching caps/esc and more; check it for more info -autostart="mpd xcompmgr dunst unclutter" +autostart="mpd xcompmgr dunst unclutter pipewire" for program in $autostart; do pidof -s "$program" || setsid -f "$program" done >/dev/null 2>&1 -# This line autostarts an instance of Pulseaudio that does not exit on idle. -# This is "necessary" on Artix due to a current bug between PA and -# Chromium-based browsers where they fail to start PA and use dummy output. -pidof -s runit && - ! pidof -s pulseaudio >/dev/null 2>&1 && - setsid -f pulseaudio --start --exit-idle-time=-1 >/dev/null 2>&1 - # Ensure that xrdb has finished running before moving on to start the WM/DE. [ -n "$xrdbpid" ] && wait "$xrdbpid" diff --git a/.local/bin/opout b/.local/bin/opout index 7f452df0..faf65753 100755 --- a/.local/bin/opout +++ b/.local/bin/opout @@ -4,7 +4,7 @@ # usually the pdf of a compiled document. I find this useful especially # running from vim. -basename="$(echo "${*}" | sed 's/\.[^\/.]*$//')" +basename="${1%.*}" case "${*}" in *.tex|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) setsid -f xdg-open "$basename".pdf >/dev/null 2>&1 ;; From 499aeaed3a3d09e7fe2522ca561be95f42d09ef3 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 14 Nov 2021 19:52:19 -0500 Subject: [PATCH 082/102] fix #1037 --- .config/pipewire/pipewire.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/pipewire/pipewire.conf b/.config/pipewire/pipewire.conf index c06a84cc..ae5c76e9 100644 --- a/.config/pipewire/pipewire.conf +++ b/.config/pipewire/pipewire.conf @@ -236,12 +236,12 @@ context.exec = [ # but it is better to start it as a systemd service. # Run the session manager with -h for options. # - #{ path = "/usr/bin/pipewire-media-session" args = "" } + { path = "/usr/bin/pipewire-media-session" args = "" } # # You can optionally start the pulseaudio-server here as well # but it is better to start it as a systemd service. # It can be interesting to start another daemon here that listens # on another address with the -a option (eg. -a tcp:4713). # - #{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" } + { path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" } ] From ed9a67ed6dbd408032f51f34a471362264c47e1c Mon Sep 17 00:00:00 2001 From: Future is FOSS <79040025+futureisfoss@users.noreply.github.com> Date: Sat, 4 Dec 2021 13:47:35 +0000 Subject: [PATCH 083/102] follow symlinks when detecting filetype in lf (#1052) fix bug in lf where symlinked files don't open in the expected program --- .config/lf/lfrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index ebe16fb5..9d6cebaf 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -14,7 +14,7 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" # cmds/functions cmd open ${{ - case $(file --mime-type $f -b) in + case $(file --mime-type "$(readlink -f $f)" -b) in image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; From a01c9f967b8801b9917be0f270f1cf9b9655e770 Mon Sep 17 00:00:00 2001 From: Fabian <58243358+FabianPaci@users.noreply.github.com> Date: Tue, 21 Dec 2021 02:11:17 +1100 Subject: [PATCH 084/102] Resets cursor position on file save (Issue #1040) (#1057) * Resets cursor position on file save (Issue #1040) * Resets cursor pos on save. (line and column) --- .config/nvim/init.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index f93eed4d..e32b8eb2 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -111,10 +111,12 @@ set noshowcmd autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x! autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! -" Automatically deletes all trailing whitespace and newlines at end of file on save. +" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position + autocmd BufWritePre * let currPos = getpos(".") autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\n\+\%$//e autocmd BufWritePre *.[ch] %s/\%$/\r/e + autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) " When shortcut files are updated, renew bash and ranger configs with new material: autocmd BufWritePost bm-files,bm-dirs !shortcuts From 58e1952ce22b364fc21763cc52e7a1418607db99 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 21 Dec 2021 13:03:43 -0500 Subject: [PATCH 085/102] otp script --- .local/bin/otp | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 .local/bin/otp diff --git a/.local/bin/otp b/.local/bin/otp new file mode 100755 index 00000000..3b313638 --- /dev/null +++ b/.local/bin/otp @@ -0,0 +1,53 @@ +#!/bin/sh + +# Get a one-time password, or add a OTP secret to your pass-otp store. + +# The assumption of this script is that all otp passwords are stored with the +# suffix `-otp`. This script automatically appends newly added otps as such. + +# For OTP passwords to be generated properly, it is important for the local +# computer to have its time properly synced. This can be done with the command +# below which requires the package `ntp`. + +ifinstalled pass pass-otp + +dir="${PASSWORD_STORE_DIR}" + +choice="$({ echo "🆕add" ; echo "🕙sync-time" ; ls ${dir}/*-otp.gpg ;} | sed "s/.*\///;s/-otp.gpg//" | dmenu -p "Pick a 2FA:")" + +case $choice in + 🆕add ) + ifinstalled maim zbar xclip || exit 1 + + temp="$dir/temp.png" + otp="otp-test-script" + trap 'shred -fu $temp; pass rm $otp' HUP INT QUIT TERM PWR EXIT + + notify-send "Scan the image." "Scan the OTP QR code." + + maim -s "$temp" || exit 1 + info="$(zbarimg -q "$temp")" + info="${info#QR-Code:}" + issuer="$(echo "$info" | grep -o "issuer=[A-z0-9]\+")" + name="${issuer#issuer=}" + + if echo "$info" | pass otp insert "$otp"; then + while true ; do + export name="$(prinf | dmenu -p "Give this One Time Password a one-word name:")" + echo "$name" | grep -q -- "^[A-z0-9-]\+$" && break + done + pass mv "$otp" "$name-otp" + notify-send "Successfully added." "$name-otp has been created." + else + notify-send "No OTP data found." "Try to scan the image again more precisely." + fi + + ;; + 🕙sync-time ) + ifinstalled ntp || exit 1 + notify-send -u low "🕙 Synchronizing Time..." "Synching time with remote NTP servers..." + updatedata="$(sudo ntpdate pool.ntp.org)" && + notify-send -u low "🕙 Synchronizing Time..." "Done. Time changed by ${updatedata#*offset }" + ;; + *) pass otp -c ${choice}-otp ;; +esac From ebcc52f1fb26304ad5adf0a6fd6c14f074f933c4 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Fri, 21 Jan 2022 23:17:21 +0100 Subject: [PATCH 086/102] otp script: Printf is not needed here (#1062) --- .local/bin/otp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/otp b/.local/bin/otp index 3b313638..1726b1a6 100755 --- a/.local/bin/otp +++ b/.local/bin/otp @@ -33,7 +33,7 @@ case $choice in if echo "$info" | pass otp insert "$otp"; then while true ; do - export name="$(prinf | dmenu -p "Give this One Time Password a one-word name:")" + export name="$(dmenu -p "Give this One Time Password a one-word name:")" echo "$name" | grep -q -- "^[A-z0-9-]\+$" && break done pass mv "$otp" "$name-otp" From c08c3a2fb0475472f2bfa74fad9ed4026afa2ef4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 21 Jan 2022 19:27:56 -0500 Subject: [PATCH 087/102] fix #936 --- .config/shell/profile | 2 +- .local/bin/compiler | 2 +- .local/bin/sysact | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.config/shell/profile b/.config/shell/profile index 10576778..9515179d 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -148,7 +148,7 @@ if pacman -Qs libxft-bgra >/dev/null 2>&1; then else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: - \033[32mparu -S libxft-bgra-git\033[0m + \033[32myay -S libxft-bgra-git\033[0m and replace \`libxft\`. Afterwards, you may start the graphical server by running \`startx\`." fi diff --git a/.local/bin/compiler b/.local/bin/compiler index faf37c9e..36177654 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -37,7 +37,7 @@ case "$ext" in java) javac -d classes "$file" && java -cp classes "${1%.*}" ;; m) octave "$file" ;; md) if [ -x "$(command -v lowdown)" ]; then - lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf + lowdown --parse-no-intraemph "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf elif [ -x "$(command -v groffdown)" ]; then groffdown -i "$file" | groff > "$base.pdf" else diff --git a/.local/bin/sysact b/.local/bin/sysact index 451815df..2df325c0 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -5,14 +5,14 @@ case "$(readlink -f /sbin/init)" in *) ctl='loginctl' ;; esac -case "$(printf "🔒 lock\n🚪 leave dwm\n♻️ renew dwm\n🐻 hibernate\n💤 sleep\n🔃 reboot\n🖥️shutdown\n📺 display off" | dmenu -i -p 'Action: ')" in +case "$(printf "🔒 lock\n🚪 leave dwm\n♻️ renew dwm\n🐻 hibernate\n🔃 reboot\n🖥️shutdown\n💤 sleep\n📺 display off" | dmenu -i -p 'Action: ')" in '🔒 lock') slock ;; '🚪 leave dwm') kill -TERM "$(pgrep -u "$USER" "\bdwm$")" ;; '♻️ renew dwm') kill -HUP "$(pgrep -u "$USER" "\bdwm$")" ;; '🐻 hibernate') slock $ctl hibernate ;; '💤 sleep') slock $ctl suspend ;; - '🔃 reboot') $ctl reboot ;; - '🖥️shutdown') $ctl poweroff ;; + '🔃 reboot') $ctl reboot -i ;; + '🖥️shutdown') $ctl powerof -if ;; '📺 display off') xset dpms force off ;; *) exit 1 ;; esac From 87fe81bb9e4a22280339879c43e9ad08a2eef494 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 22 Jan 2022 02:00:46 -0500 Subject: [PATCH 088/102] a --- .local/bin/sysact | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 2df325c0..b13690e4 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -12,7 +12,7 @@ case "$(printf "🔒 lock\n🚪 leave dwm\n♻️ renew dwm\n🐻 hibernate\n '🐻 hibernate') slock $ctl hibernate ;; '💤 sleep') slock $ctl suspend ;; '🔃 reboot') $ctl reboot -i ;; - '🖥️shutdown') $ctl powerof -if ;; + '🖥️shutdown') $ctl poweroff -i ;; '📺 display off') xset dpms force off ;; *) exit 1 ;; esac From 0d01624c592996e734e35894d24cea9dae3688d1 Mon Sep 17 00:00:00 2001 From: Ginner <26798615+Ginner@users.noreply.github.com> Date: Tue, 25 Jan 2022 15:23:59 +0100 Subject: [PATCH 089/102] Fix case-matching (#1066) Case sensitivity prevents dmenuhandler from copying the URL to the clipboard. --- .local/bin/dmenuhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index e5de8ef9..ce9159d9 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -5,7 +5,7 @@ feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}" case "$(printf "Copy URL\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dl\\nqueue yt-dl audio" | dmenu -i -p "Open it with?")" in - "copy url") echo "$feed" | xclip -selection clipboard ;; + "Copy URL") echo "$feed" | xclip -selection clipboard ;; mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;; "mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;; "mpv float") setsid -f "$TERMINAL" -e mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$feed" >/dev/null 2>&1 ;; From 07df38c057f397015d49f263d26b69d0e7837ced Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Wed, 26 Jan 2022 15:07:42 +0000 Subject: [PATCH 090/102] typos (#1067) --- .config/lf/lfrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 9d6cebaf..f87325d9 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -94,8 +94,8 @@ map O $mimeopen --ask $f map A rename # at the very end map c push A # new rename map I push A # at the very beginning -map i push A # before extention -map a push A # after extention +map i push A # before extension +map a push A # after extension map B bulkrename map b $setbg $f From 786cee9303fb434d37f5949c31eeb083eb178369 Mon Sep 17 00:00:00 2001 From: Fabian <58243358+FabianPaci@users.noreply.github.com> Date: Fri, 28 Jan 2022 09:16:37 +1100 Subject: [PATCH 091/102] vimwiki chages (#1068) changed path to `.config` instead of `~` to avoid a messy `~`. Also added a carriage return to the `VimwikiIndex` map. --- .config/nvim/init.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index e32b8eb2..6a962087 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -96,8 +96,8 @@ set noshowcmd " Ensure files are read as what I want: let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} - map v :VimwikiIndex - let g:vimwiki_list = [{'path': '~/vimwiki', 'syntax': 'markdown', 'ext': '.md'}] + map v :VimwikiIndex + let g:vimwiki_list = [{'path': '.config/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}] autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff autocmd BufRead,BufNewFile *.tex set filetype=tex From c28d25c15261e417fd9a2e3c0424aa777f9ffd6a Mon Sep 17 00:00:00 2001 From: Arjun Karangiya Date: Sat, 29 Jan 2022 20:21:52 +0530 Subject: [PATCH 092/102] Move to data folder and need absolute path here (#1069) Vimwiki is not config but it's data so ".local/share/nvim" is more proper location for it. Here relative path was given so it tries to create new vimwiki folder when launched from other than home dir or changing current dir using `:cd ` inside vim when launching vimwiki. --- .config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 6a962087..2fa101d4 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -97,7 +97,7 @@ set noshowcmd " Ensure files are read as what I want: let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} map v :VimwikiIndex - let g:vimwiki_list = [{'path': '.config/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}] + let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}] autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff autocmd BufRead,BufNewFile *.tex set filetype=tex From 82b70e3a8e3aed45998c38024e8c3e16f9680cff Mon Sep 17 00:00:00 2001 From: Arjun Karangiya Date: Wed, 2 Feb 2022 19:55:48 +0530 Subject: [PATCH 093/102] Bug: initial value is wrong; it should be false, 0 (#1074) This caused no effect for the first call to ToggleHiddenAll(). The second call works as value was set correctly inside ToggleHiddenAll() on the first call. --- .config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 2fa101d4..09610fde 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -132,7 +132,7 @@ if &diff endif " Function for toggling the bottom statusbar: -let s:hidden_all = 1 +let s:hidden_all = 0 function! ToggleHiddenAll() if s:hidden_all == 0 let s:hidden_all = 1 From c2f25befa94871c796e9051ad45a8eb6e5c54ee7 Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Thu, 17 Feb 2022 18:14:42 +0100 Subject: [PATCH 094/102] Make sb-doppler POSIX compliant --- .local/bin/statusbar/sb-doppler | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index cf765f64..dabf18b2 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -232,14 +232,14 @@ radarcode=$(echo "$chosen" | sed "s/..: // ; s/:.*//") echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "%s,%s\\n" "$continentcode" "$radarcode" > "$radarloc" ;} getdoppler() { - cont="$(cat "$radarloc" | sed "s/,.*//")" - loc="$(cat "$radarloc" | cut -c 4-)" + cont="$(sed "s/,.*//" "$radarloc")" + loc="$(cut -c 4- "$radarloc")" notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc." - if [ $cont == "US" ] ; then + if [ "$cont" = "US" ] ; then curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ; - elif [ $cont == "EU" ] ; then + elif [ "$cont" = "EU" ] ; then curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ; - elif [ $cont == "AF" ] ; then + elif [ "$cont" = "AF" ] ; then curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ; fi } From d9fb1ad73244b958ff143ea79b8bbd990b618478 Mon Sep 17 00:00:00 2001 From: Nacho-Dz <56203103+Nacho-Dz@users.noreply.github.com> Date: Wed, 2 Mar 2022 13:41:22 -0300 Subject: [PATCH 095/102] convert both $rx and $tx in one call to numfmt (#1082) see numfmt(1) for details --- .local/bin/statusbar/sb-nettraf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index eb7a73b3..c71d38e9 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -26,4 +26,4 @@ update() { rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) -printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx) +printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx $tx) From 148f1432e6763fe6aeef14589a8c8acce1984237 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 6 Mar 2022 13:19:51 -0500 Subject: [PATCH 096/102] lf tweaks included ueberzug images --- .config/lf/lfrc | 11 ++++++++--- .config/shell/aliasrc | 1 + .local/bin/lf-cleaner | 4 ++++ .local/bin/lfub | 24 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100755 .local/bin/lf-cleaner create mode 100755 .local/bin/lfub diff --git a/.config/lf/lfrc b/.config/lf/lfrc index f87325d9..3ea7f58a 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -8,6 +8,8 @@ set scrolloff 10 set icons set period 1 set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" +set ratios 1:2:3 +set cleaner ~/.local/bin/lf-cleaner # Vars that depend on environmental variables $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" @@ -15,8 +17,9 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" # cmds/functions cmd open ${{ case $(file --mime-type "$(readlink -f $f)" -b) in + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;; image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; - text/*) $EDITOR $fx;; + text/*|application/json|inode/x-empty) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | setsid -f sxiv -aio 2>/dev/null | lf-select & ;; @@ -94,8 +97,8 @@ map O $mimeopen --ask $f map A rename # at the very end map c push A # new rename map I push A # at the very beginning -map i push A # before extension -map a push A # after extension +map i push A # before extention +map a push A # after extention map B bulkrename map b $setbg $f @@ -105,5 +108,7 @@ map V push :!nvim map W $setsid -f $TERMINAL >/dev/null 2>&1 +map Y $printf "%s" "$fx" | xclip -selection clipboard + # Source Bookmarks source "~/.config/lf/shortcutrc" diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index ad716955..502f79f1 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -45,6 +45,7 @@ alias \ z="zathura" alias \ + lf="lfub" \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ diff --git a/.local/bin/lf-cleaner b/.local/bin/lf-cleaner new file mode 100755 index 00000000..a184d84b --- /dev/null +++ b/.local/bin/lf-cleaner @@ -0,0 +1,4 @@ +#!/bin/sh +if [ -n "$FIFO_UEBERZUG" ]; then + printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG" +fi diff --git a/.local/bin/lfub b/.local/bin/lfub new file mode 100755 index 00000000..2cf470a3 --- /dev/null +++ b/.local/bin/lfub @@ -0,0 +1,24 @@ +#!/bin/sh + +# This is a wrapper script for lb that allows it to create image previews with +# ueberzug. This works in concert with the lf configuration file and the +# lf-cleaner script. + +set -e + +cleanup() { + exec 3>&- + rm "$FIFO_UEBERZUG" +} + +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + lf "$@" +else + [ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf" + export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$" + mkfifo "$FIFO_UEBERZUG" + ueberzug layer -s <"$FIFO_UEBERZUG" -p json & + exec 3>"$FIFO_UEBERZUG" + trap cleanup EXIT + lf "$@" 3>&- +fi From 21bbe35ae3bdc2bce24499af61118a2b7ed1d382 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 6 Mar 2022 13:27:22 -0500 Subject: [PATCH 097/102] needed for lf images --- .config/lf/scope | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/.config/lf/scope b/.config/lf/scope index 45f9f338..d924019d 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -1,6 +1,6 @@ #!/bin/bash -set -C -f -u +set -C -f #IFS=$'\n' IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" @@ -18,41 +18,34 @@ IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # Script arguments FILE_PATH="${1}" # Full path of the highlighted file -HEIGHT="${2}" #FILE_EXTENSION="${FILE_PATH##*.}" #FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]') # Settings -HIGHLIGHT_SIZE_MAX=262143 # 256KiB -HIGHLIGHT_TABWIDTH=8 -HIGHLIGHT_STYLE='pablo' +export HIGHLIGHT_SIZE_MAX=262143 # 256KiB +export HIGHLIGHT_TABWIDTH=8 +export HIGHLIGHT_STYLE='pablo' +image() { + if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1; then + printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG" + exit 1 + else + mediainfo "$1" + fi +} +CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))" -handle_mime() { - local mimetype="${1}" - case "${mimetype}" in - text/html) w3m -dump "${FILE_PATH}" ;; +case "$(file --dereference --brief --mime-type -- "${FILE_PATH}")" in + image/*) image "$FILE_PATH" "$2" "$3" "$4" "$5" ;; + text/html) lynx -display_charset=utf-8 -dump "${FILE_PATH}" ;; text/troff) man ./ "${FILE_PATH}" | col -b ;; - text/* | */xml) - if [ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]; then - exit 2 - fi - if [ "$( tput colors )" -ge 256 ]; then - local highlight_format='xterm256' - else - local highlight_format='ansi' - fi - highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \ - --style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" ;; + text/* | */xml) bat -f "${FILE_PATH}" ;; application/zip) atool --list -- "${FILE_PATH}" ;; - image/*) chafa --fill=block --symbols=block -c 256 -s 80x"${HEIGHT}" "${FILE_PATH}" || exit 1;; - video/* | audio/*|application/octet-stream) mediainfo "${FILE_PATH}" || exit 1;; + video/* | audio/* | application/octet-stream) mediainfo "${FILE_PATH}" || exit 1;; */pdf) pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - ;; *opendocument*) odt2txt "${FILE_PATH}" ;; - esac -} - -MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )" -handle_mime "${MIMETYPE}" + application/pgp-encrypted) gpg -d -- "${FILE_PATH}" ;; +esac exit 1 From 42987c2d64b549df26de8f724590f01d1bec0ae1 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 11 Mar 2022 18:32:19 -0500 Subject: [PATCH 098/102] lf cleanup --- .local/bin/lf-cleaner => .config/lf/cleaner | 0 .config/lf/lfrc | 31 ++++++++++++++++----- .gtkrc-2.0 | 1 + .local/bin/lf-select | 9 ------ .local/bin/lfub | 2 +- 5 files changed, 26 insertions(+), 17 deletions(-) rename .local/bin/lf-cleaner => .config/lf/cleaner (100%) create mode 120000 .gtkrc-2.0 delete mode 100755 .local/bin/lf-select diff --git a/.local/bin/lf-cleaner b/.config/lf/cleaner similarity index 100% rename from .local/bin/lf-cleaner rename to .config/lf/cleaner diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 3ea7f58a..63ea24f8 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,18 +1,29 @@ # Luke's lf settings + +# Note on Image Previews +# For those wanting image previews, like this system, there are four steps to +# set it up. These are done automatically for LARBS users, but I will state +# them here for others doing it manually. +# +# 1. ueberzug must be installed. +# 2. The scope file (~/.config/lf/scope for me), must have a command similar to +# mine to generate ueberzug images. +# 3. A `set cleaner` line as below is a cleaner script. +# 4. lf should be started through a wrapper script (~/.local/bin/lfup for me) +# that creates the environment for ueberzug. This command can be be aliased +# in your shellrc (`alias lf="lfub") or if set to a binding, should be +# called directly instead of normal lf. + # Basic vars -set shell bash set shellopts '-eu' set ifs "\n" set scrolloff 10 set icons set period 1 set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" -set ratios 1:2:3 -set cleaner ~/.local/bin/lf-cleaner - -# Vars that depend on environmental variables -$lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" +set cleaner '~/.config/lf/cleaner' +set previewer '~/.config/lf/scope' # cmds/functions cmd open ${{ @@ -22,7 +33,13 @@ cmd open ${{ text/*|application/json|inode/x-empty) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; - image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | setsid -f sxiv -aio 2>/dev/null | lf-select & ;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | + setsid -f sxiv -aio 2>/dev/null | while read -r file; do + [ -z "$file" ] && continue + lf -remote "send select \"$file\"" + lf -remote "send toggle" + done & + ;; 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 ;; diff --git a/.gtkrc-2.0 b/.gtkrc-2.0 new file mode 120000 index 00000000..20593d73 --- /dev/null +++ b/.gtkrc-2.0 @@ -0,0 +1 @@ +.config/gtk-2.0/gtkrc-2.0 \ No newline at end of file diff --git a/.local/bin/lf-select b/.local/bin/lf-select deleted file mode 100755 index 3b2a17a5..00000000 --- a/.local/bin/lf-select +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Reads file names from stdin and selects them in lf. - -while read -r file; do - [ -z "$file" ] && continue - lf -remote "send select \"$file\"" - lf -remote "send toggle" -done diff --git a/.local/bin/lfub b/.local/bin/lfub index 2cf470a3..9012f506 100755 --- a/.local/bin/lfub +++ b/.local/bin/lfub @@ -19,6 +19,6 @@ else mkfifo "$FIFO_UEBERZUG" ueberzug layer -s <"$FIFO_UEBERZUG" -p json & exec 3>"$FIFO_UEBERZUG" - trap cleanup EXIT + trap cleanup HUP INT QUIT TERM PWR EXIT lf "$@" 3>&- fi From 20364cb9ef895694f30801fbd4673ec9b9748228 Mon Sep 17 00:00:00 2001 From: Coco <84296063+Co3co@users.noreply.github.com> Date: Sat, 12 Mar 2022 18:47:45 +0000 Subject: [PATCH 099/102] fixed typo (#1084) lfup -> lfub on line 13 --- .config/lf/lfrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 63ea24f8..80e1088b 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -10,7 +10,7 @@ # 2. The scope file (~/.config/lf/scope for me), must have a command similar to # mine to generate ueberzug images. # 3. A `set cleaner` line as below is a cleaner script. -# 4. lf should be started through a wrapper script (~/.local/bin/lfup for me) +# 4. lf should be started through a wrapper script (~/.local/bin/lfub for me) # that creates the environment for ueberzug. This command can be be aliased # in your shellrc (`alias lf="lfub") or if set to a binding, should be # called directly instead of normal lf. From af386acead88c05cc00b3139942e091be33ddd74 Mon Sep 17 00:00:00 2001 From: pakudev <92907920+pakudev@users.noreply.github.com> Date: Sun, 13 Mar 2022 01:16:17 +0530 Subject: [PATCH 100/102] replace ranger with lf in tutorialvids script (#1085) --- .local/bin/tutorialvids | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/tutorialvids b/.local/bin/tutorialvids index 91ad5b0f..6d4914bd 100755 --- a/.local/bin/tutorialvids +++ b/.local/bin/tutorialvids @@ -14,7 +14,7 @@ i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada- neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e ncmpcpp (music player) https://videos.lukesmith.xyz/videos/watch/b5ac6f0d-a220-4433-88e3-e98fc791dc0a newsboat (RSS reader) https://videos.lukesmith.xyz/videos/watch/bd2c3fff-40fa-47ea-aa98-5b1ec0c903b6 -ranger (file manager) https://videos.lukesmith.xyz/videos/watch/785d914f-8cbd-4a3d-a1f6-d75675fc7549 +lf (file manager) https://videos.lukesmith.xyz/w/rKeHsF5ZHDNDbR1buUKB1c zathura (pdf viewer) https://videos.lukesmith.xyz/videos/watch/c780f75a-11f6-48a9-a191-d079ebc36ea4 gpg keys https://videos.lukesmith.xyz/videos/watch/040f5530-4830-4583-9ddc-2080b421531b calcurse (calendar) https://videos.lukesmith.xyz/videos/watch/4b937e8b-7654-46e3-8d01-79392ec5b3d1 From a2d716606e1803eed0cf25dfc08d4c79ebdc8498 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 12 Mar 2022 16:44:11 -0500 Subject: [PATCH 101/102] scope-lol --- .config/lf/scope | 67 ++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/.config/lf/scope b/.config/lf/scope index d924019d..a6ff3db7 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -1,51 +1,44 @@ -#!/bin/bash +#!/bin/sh + +# File preview handler for lf. set -C -f -#IFS=$'\n' IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" -# ANSI color codes are supported. -# STDIN is disabled, so interactive scripts won't work properly - -# This script is considered a configuration file and must be updated manually. - -# Meanings of exit codes: -# code | meaning | action of ranger -# -----+------------+------------------------------------------- -# 0 | success | Display stdout as preview -# 1 | no preview | Display no preview at all -# 2 | plain text | Display the plain content of the file - -# Script arguments -FILE_PATH="${1}" # Full path of the highlighted file - -#FILE_EXTENSION="${FILE_PATH##*.}" -#FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]') - -# Settings -export HIGHLIGHT_SIZE_MAX=262143 # 256KiB -export HIGHLIGHT_TABWIDTH=8 -export HIGHLIGHT_STYLE='pablo' - image() { if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1; then printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG" - exit 1 else mediainfo "$1" fi } -CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))" -case "$(file --dereference --brief --mime-type -- "${FILE_PATH}")" in - image/*) image "$FILE_PATH" "$2" "$3" "$4" "$5" ;; - text/html) lynx -display_charset=utf-8 -dump "${FILE_PATH}" ;; - text/troff) man ./ "${FILE_PATH}" | col -b ;; - text/* | */xml) bat -f "${FILE_PATH}" ;; - application/zip) atool --list -- "${FILE_PATH}" ;; - video/* | audio/* | application/octet-stream) mediainfo "${FILE_PATH}" || exit 1;; - */pdf) pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - ;; - *opendocument*) odt2txt "${FILE_PATH}" ;; - application/pgp-encrypted) gpg -d -- "${FILE_PATH}" ;; +ifub() { + [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1 +} + +# Note that the cache file name is a function of file information, meaning if +# an image appears in multiple places across the machine, it will not have to +# be regenerated once seen. + +case "$(file --dereference --brief --mime-type -- "$1")" in + image/*) image "$1" "$2" "$3" "$4" "$5" ;; + text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;; + text/troff) man ./ "$1" | col -b ;; + text/* | */xml) bat --terminal-width "$4" -f "$1" ;; + application/zip) atool --list -- "$1" ;; + audio/* | application/octet-stream) mediainfo "$1" || exit 1;; + video/* ) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" + [ ! -f "$CACHE" ] && ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0 + image "$CACHE" "$2" "$3" "$4" "$5" + ;; + */pdf) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" + [ ! -f "$CACHE.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE" + image "$CACHE.jpg" "$2" "$3" "$4" "$5" + ;; + *opendocument*) odt2txt "$1" ;; + application/pgp-encrypted) gpg -d -- "$1" ;; esac exit 1 From 0daa4d345042b3c417ea9dab6927c9ce93bd9332 Mon Sep 17 00:00:00 2001 From: Oscar Lastra <56526315+lastra-dev@users.noreply.github.com> Date: Sun, 13 Mar 2022 13:52:08 -0600 Subject: [PATCH 102/102] feat(lf): Add JSON preview (#1090) --- .config/lf/scope | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/scope b/.config/lf/scope index a6ff3db7..71ab6285 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -25,7 +25,7 @@ case "$(file --dereference --brief --mime-type -- "$1")" in image/*) image "$1" "$2" "$3" "$4" "$5" ;; text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;; text/troff) man ./ "$1" | col -b ;; - text/* | */xml) bat --terminal-width "$4" -f "$1" ;; + text/* | */xml | application/json) bat --terminal-width "$4" -f "$1" ;; application/zip) atool --list -- "$1" ;; audio/* | application/octet-stream) mediainfo "$1" || exit 1;; video/* )