From 97cd22f7fc780e7753e72684380ae79d6069ef3b Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sun, 29 Mar 2020 12:42:13 +0000 Subject: [PATCH 001/142] for partial XDG supporting apps (#523) calcurse keeps creating new configs at ~/ without these two lines --- .config/user-dirs.dirs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index 5a28707c..f25c63a2 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -1 +1,3 @@ XDG_DESKTOP_DIR="$HOME/" +XDG_CONFIG_HOME="$HOME/.config" +XDG_DATA_HOME="$HOME/.local/share" From 49247875e0cdd9de5019090ab525c0d700ba178a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 29 Mar 2020 12:02:15 -0400 Subject: [PATCH 002/142] lmc can run mixer --- .local/bin/lmc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/lmc b/.local/bin/lmc index bbe99a56..6d64b649 100755 --- a/.local/bin/lmc +++ b/.local/bin/lmc @@ -10,11 +10,13 @@ if [ "$PULSE" ]; then mute() { pulsemixer --mute ;} up() { pulsemixer --change-volume +"$NUM" ;} down() { pulsemixer --change-volume -"$NUM" ;} + control() { pulsemixer ;} else toggle() { amixer sset Master toggle ;} mute() { amixer sset Master mute ;} up() { amixer sset Master "$NUM"%+ ;} down() { amixer sset Master "$NUM"%- ;} + control() { alsamixer ;} fi case "$1" in @@ -22,6 +24,7 @@ case "$1" in mute) mute ;; up) up ;; down) down ;; -esac >/dev/null + control) control ;; +esac pkill -RTMIN+10 "${STATUSBAR:?}" & From 326ed6b56d71a9b689819256c9d85a2a5ece4b8f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 29 Mar 2020 14:16:07 -0400 Subject: [PATCH 003/142] battery minor imporvements --- .local/bin/statusbar/battery | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 69da3f5e..82e8450f 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -1,7 +1,7 @@ #!/bin/sh # Prints all batteries, their percentage remaining and an emoji corresponding -# to charge status (🔌 for pluged up, 🔋 for discharging on battery, etc.). +# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.). case $BLOCK_BUTTON in 3) pgrep -x dunst >/dev/null && notify-send "🔋 Battery module" "🔋: discharging @@ -16,15 +16,12 @@ esac for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. - capacity=$(cat "$battery"/capacity) || exit - status=$(cat "$battery"/status) + capacity=$(cat "$battery"/capacity) + status=$(sed "s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. - [ "$status" = "Discharging" ] && [ "$capacity" -le 25 ] && warn="❗" + [ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗" - # Print the battery status (replaced by a cooresponding emoji with - # sed), the percentage left and the warning if there is one. - printf "%s%s%s\n" "$(echo "$status" | sed "s/,//;s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" + printf "%s%s%s%%\n" "$status" "$warn" "$capacity" unset warn done - From d21d1f1be3f3f52d05e395c5d482876cad16c235 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 18:53:43 -0400 Subject: [PATCH 004/142] break to avoid % on desktops --- .local/bin/statusbar/battery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 82e8450f..395ad8d2 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -16,7 +16,7 @@ esac for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. - capacity=$(cat "$battery"/capacity) + capacity=$(cat "$battery"/capacity) || break status=$(sed "s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. From 581924c71c8890374d57164403b4634d4477b743 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 20:29:34 -0400 Subject: [PATCH 005/142] changes and simplifications to `disk` --- .local/bin/statusbar/disk | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index 2ca88059..269eba7e 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -1,18 +1,22 @@ #!/bin/sh # Status bar module for disk space -# $1 should be drive mountpoint -# $2 is optional icon, otherwise mountpoint will displayed +# $1 should be drive mountpoint, otherwise assumed /. -[ -z "$1" ] && exit +location=${1:-/} -icon="$2" -[ -z "$2" ] && icon="$1" +[ -d "$location" ] || exit case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; - 3) pgrep -x dunst >/dev/null && notify-send "💽 Disk module" "\- Shows used hard drive space. + 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; + 3) notify-send "💽 Disk module" "\- Shows used hard drive space. - Click to show all disk info." ;; esac -printf "%s: %s\n" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')" +case "$location" in + "/home"* ) icon="🏠" ;; + "/mnt"* ) icon="💾" ;; + *) icon="🖥 ";; +esac + +printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" From 86a5b350a7bf57aede15d7fe063a5af5878d7d7b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 20:30:19 -0400 Subject: [PATCH 006/142] labels moved to scripts for dwm compatibility --- .config/i3blocks/config | 4 +--- .local/bin/statusbar/cpu | 2 +- .local/bin/statusbar/memory | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index e4626545..457a9a2a 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -37,11 +37,9 @@ signal=12 #[memory] #interval=30 -#label=🧠 #[cpu] #interval=15 -#label=💻 [volume] interval=once @@ -53,7 +51,7 @@ signal=10 #[disk] #interval=60 -#command=disk /home 🏠 +#command=disk /home [battery] command=battery BAT0 diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index 3b1394af..5b5528e6 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -7,4 +7,4 @@ case $BLOCK_BUTTON in - % is of single core." ;; esac -sensors | awk '/Core 0/ {print $3}' +sensors | awk '/Core 0/ {print "🌡", $3}' diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index dfd3d7b0..c1f704fa 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -6,4 +6,4 @@ case $BLOCK_BUTTON in - Click to show memory hogs." ;; esac -free -h | awk '/^Mem:/ {print $3 "/" $2}' +free -h | awk '/^Mem:/ {print "🧠", $3 "/" $2}' From 3ae11f5969d614fd2afa8a24251fa9218aac47cc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 31 Mar 2020 20:30:42 -0400 Subject: [PATCH 007/142] statusbarinfo script for dwm --- .local/bin/statusbar/statusbarinfo | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 .local/bin/statusbar/statusbarinfo diff --git a/.local/bin/statusbar/statusbarinfo b/.local/bin/statusbar/statusbarinfo new file mode 100755 index 00000000..ae799e99 --- /dev/null +++ b/.local/bin/statusbar/statusbarinfo @@ -0,0 +1,33 @@ +#!/bin/sh + +echo " + ____ _ _ _ +/ ___|| |_ __ _| |_ _ _ ___| |__ __ _ _ __ +\___ \| __/ _\` | __| | | / __| '_ \ / _\` | '__| + ___) | || (_| | |_| |_| \__ \ |_) | (_| | | +|____/ \__\__,_|\__|\__,_|___/_.__/ \__,_|_| + +This is a list of the statusbar modules. + +📦5 pacpackages: updatable packages (must have pacman -Sy run in root cronjob to check). +📰 41 news: unread RSS entries in newsboat. +☔ 83% ❄️ 69° 🌞 80° weather: ☔ for precipitation, 🌞 and ❄ for daily high and low. +📬 20 mailbox: number of unread mail if mutt-wizard is active. +🔉 62% volume: master sink volume. +🔌83% battery: 🔌 for charging, 🔋 for discharging, ⚡ for full. +📶 80% ❎ internet: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none). + +Obviously the time and date are displayed as well. + +Optional script modules: + +Edit ~/.local/src/dwmblocks/config.h to add these or your own if you'd like (and recompile and restart dwmblocks). + +'memory' 🧠 559Mi/3.7Gi Current used memory/total memory. +'cpu' 🌡 +46.0°C CPU temperature. +'disk' 🖥 : 28G/30G Remaining disk space... +'disk ~' 🏠: 641G/850G ...can be given directory argument. +'moonphase' 🌕 39% Phase of the moon (requires \`pom-perl\`). +'iplocate' 🇺🇸 United States Your own or VPN location (requires \`geoiplookup\`). + +" | less From 22ff37646c3088dd2db78082fa175ae14f581cde Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Wed, 1 Apr 2020 14:38:03 +0000 Subject: [PATCH 008/142] =?UTF-8?q?=F0=9F=8C=9Cupdated=20moonphase?= =?UTF-8?q?=F0=9F=8C=9B=20(#532)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit right click to open notification left & middle to update fixes specific dates --- .local/bin/statusbar/moonphase | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index d2bbad61..09af87ba 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -1,17 +1,23 @@ #!/bin/sh mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') -prcnt=$(pom $1 | grep -o '[[:digit:]]*%') +prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' ) case "$mnphs" in - "New") icon="🌑" prcnt="0%" ;; + "New") icon="🌑" prcnt="0" ;; "Waxing Crescent") icon="🌒" ;; - "First Quarter") icon="🌓" prcnt="50%" ;; + "First Quarter") icon="🌓" prcnt="50" ;; "Waxing Gibbous") icon="🌔" ;; - "Full") icon="🌕" prcnt="100%" ;; + "Full") icon="🌕" prcnt="100" ;; "Waning Gibbous") icon="🌖" ;; - "Last Quarter") icon="🌗" prcnt="50%" ;; + "Last Quarter") icon="🌗" prcnt="50" ;; "Waning Crescent") icon="🌘" ;; *) echo errorrrr ;; esac -printf "%s %s\\n" "$icon" "$prcnt" +case $BLOCK_BUTTON in + 1) $mnphs ;; + 2) $mnphs ;; + 3) pgrep -x dunst >/dev/null && notify-send " 🌜$(pom)" ;; +esac + +echo "$icon" "$prcnt"% From 26d8e9e006260611cd1daa556b42194612be69f5 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Thu, 2 Apr 2020 13:09:54 +0200 Subject: [PATCH 009/142] memory statusbar with multilanguage support (#536) * for multilanguage support see issue number #535 * emoji --- .local/bin/statusbar/memory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index c1f704fa..25a29585 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -6,4 +6,4 @@ case $BLOCK_BUTTON in - Click to show memory hogs." ;; esac -free -h | awk '/^Mem:/ {print "🧠", $3 "/" $2}' +free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}' From 633db36d0938fbdc6db408b51fe2e49b2faabb75 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 2 Apr 2020 07:23:21 -0400 Subject: [PATCH 010/142] noto mono default if installed, inconsolata comted --- .config/fontconfig/fonts.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index cc435d5e..749a7cc8 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -28,8 +28,9 @@ monospace + Noto Sans Mono Liberation Mono - Inconsolata + Joy Pixels Noto Color Emoji From 5014b636817e8eb1d55c3935ae92ef86fde3862f Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Tue, 31 Mar 2020 11:51:30 -0700 Subject: [PATCH 011/142] clean up android, tmux --- .profile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.profile b/.profile index 1b5460a0..889dd8b7 100644 --- a/.profile +++ b/.profile @@ -23,6 +23,8 @@ export WGETRC="$HOME/.config/wget/wgetrc" export INPUTRC="$HOME/.config/inputrc" export ZDOTDIR="$HOME/.config/zsh" export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" +export TMUX_TMPDIR="$XDG_RUNTIME_DIR" +export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" # Other program settings: export DICS="/usr/share/stardict/dic/" From 4f496fa189d9b953a4ab487ea6b7a8eaccc0e9ee Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sat, 4 Apr 2020 12:32:21 -0700 Subject: [PATCH 012/142] clean up cargo --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index 889dd8b7..70e23fb4 100644 --- a/.profile +++ b/.profile @@ -25,6 +25,7 @@ export ZDOTDIR="$HOME/.config/zsh" export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" +export CARGO_HOME="$XDG_DATA_HOME/cargo" # Other program settings: export DICS="/usr/share/stardict/dic/" From fa67562835fc4cfd8f87c2abc622b9c1b4358ffe Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sat, 4 Apr 2020 12:45:33 -0700 Subject: [PATCH 013/142] substitute $HOME/.config with $XDG_CONFIG_HOME --- .config/zsh/.zshrc | 4 ++-- .local/bin/rssadd | 2 +- .local/bin/shortcuts | 10 +++++----- .profile | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 63c0049b..371d2192 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -4,8 +4,8 @@ autoload -U colors && colors PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " # Load aliases and shortcuts if existent. -[ -f "$HOME/.config/shortcutrc" ] && source "$HOME/.config/shortcutrc" -[ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" +[ -f "$XDG_CONFIG_HOME/shortcutrc" ] && source "$XDG_CONFIG_HOME/shortcutrc" +[ -f "$XDG_CONFIG_HOME/aliasrc" ] && source "$XDG_CONFIG_HOME/aliasrc" autoload -U compinit zstyle ':completion:*' menu select diff --git a/.local/bin/rssadd b/.local/bin/rssadd index 4ef31a4c..9dcdd7b3 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -2,7 +2,7 @@ ! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && notify-send "That doesn't look like a full URL." && exit -RSSFILE="$HOME/.config/newsboat/urls" +RSSFILE="$XDG_CONFIG_HOME/newsboat/urls" if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then notify-send "You already have this RSS feed." else diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 55ce30ae..112d1405 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,11 +1,11 @@ #!/usr/bin/env bash # Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="$HOME/.config/shortcutrc" -ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" +shell_shortcuts="$XDG_CONFIG_HOME/shortcutrc" +ranger_shortcuts="$XDG_CONFIG_HOME/ranger/shortcuts.conf" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" -vifm_shortcuts="$HOME/.config/vifm/vifmshortcuts" +vifm_shortcuts="$XDG_CONFIG_HOME/vifm/vifmshortcuts" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null @@ -14,14 +14,14 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$XDG_CONFIG_HOME/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ >(awk '{print "map g" $1, ":cd", $2 "\nmap t" $1, ":cd", $2 "\nmap M" $1, ":cd", $2 ":mo\nmap Y" $1, ":cd", $2 ":co" }' >> "$vifm_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" # Format the `files` file in the correct syntax and sent it to both configs. -sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$XDG_CONFIG_HOME/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ >(awk '{print "map", $1, ":e", $2 "" }' >> "$vifm_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" diff --git a/.profile b/.profile index 70e23fb4..51b737a6 100644 --- a/.profile +++ b/.profile @@ -16,12 +16,12 @@ export STATUSBAR="${LARBSWM}blocks" # ~/ Clean-up: #export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. -export NOTMUCH_CONFIG="$HOME/.config/notmuch-config" -export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" +export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config" +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" export LESSHISTFILE="-" -export WGETRC="$HOME/.config/wget/wgetrc" -export INPUTRC="$HOME/.config/inputrc" -export ZDOTDIR="$HOME/.config/zsh" +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" +export INPUTRC="$XDG_CONFIG_HOME/inputrc" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" From 2b572b2a89de8aca631de686e25f2f5d306a91bd Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sat, 4 Apr 2020 12:52:29 -0700 Subject: [PATCH 014/142] substitute $HOME/.local/share with $XDG_DATA_HOME --- .config/sxhkd/sxhkdrc | 4 ++-- .local/bin/i3cmds/toggle-welcome | 2 +- .local/bin/queueandnotify | 2 +- .local/bin/statusbar/weather | 10 +++++----- .profile | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 0b05a3df..c07d7809 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -137,10 +137,10 @@ XF86MyComputer # Function keys super + shift + F1 - grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "$HOME/.local/share/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) + grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "$XDG_DATA_HOME/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) # Show readme super + F1 - groff -mom $HOME/.local/share/larbs/readme.mom -Tpdf | zathura - + groff -mom $XDG_DATA_HOME/larbs/readme.mom -Tpdf | zathura - # F2 restarts either dwm or i3 and is bound in each. # Change display super + F3 diff --git a/.local/bin/i3cmds/toggle-welcome b/.local/bin/i3cmds/toggle-welcome index 715db09e..d8cc0eff 100755 --- a/.local/bin/i3cmds/toggle-welcome +++ b/.local/bin/i3cmds/toggle-welcome @@ -2,7 +2,7 @@ # Toggles the LARBS welcome message. -PIC="$HOME/.local/share/larbs/larbs.png" +PIC="$XDG_DATA_HOME/larbs/larbs.png" grep LARBSWELCOME "$HOME/.xprofile" && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || diff --git a/.local/bin/queueandnotify b/.local/bin/queueandnotify index 867b15e6..24746c8b 100755 --- a/.local/bin/queueandnotify +++ b/.local/bin/queueandnotify @@ -3,7 +3,7 @@ # Podboat sucks. This script replaces it. # It reads the newsboat queue, queuing downloads with taskspooler. # It also removes the junk from extentions. -queuefile="$HOME/.local/share/newsboat/queue" +queuefile="$XDG_DATA_HOME/newsboat/queue" while read -r line; do [ -z "$line" ] && continue diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 285ac917..bc9f20cd 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -1,13 +1,13 @@ #!/bin/sh getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 -curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} +curl -sf "wttr.in/$LOCATION" > "$XDG_DATA_HOME/weatherreport" || exit 1 ;} -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +showweather() { printf "%s" "$(sed '16q;d' "$XDG_DATA_HOME/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" +sed '13q;d' "$XDG_DATA_HOME/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} case $BLOCK_BUTTON in - 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; + 1) $TERMINAL -e less -Srf "$XDG_DATA_HOME/weatherreport" ;; 2) getforecast && showweather ;; 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. @@ -16,7 +16,7 @@ case $BLOCK_BUTTON in 🌞: Daily high" ;; esac -if [ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] +if [ "$(stat -c %y "$XDG_DATA_HOME/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] then getforecast && showweather else showweather fi diff --git a/.profile b/.profile index 51b737a6..0f4a835a 100644 --- a/.profile +++ b/.profile @@ -22,7 +22,7 @@ export LESSHISTFILE="-" export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" export INPUTRC="$XDG_CONFIG_HOME/inputrc" export ZDOTDIR="$XDG_CONFIG_HOME/zsh" -export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" export CARGO_HOME="$XDG_DATA_HOME/cargo" From 82cf021b78d235ca98df61d4ce55d4c0969c2e5f Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sat, 4 Apr 2020 12:55:06 -0700 Subject: [PATCH 015/142] substitute ~/.local/share with $XDG_DATA_HOME --- .config/aliasrc | 2 +- .config/i3/config | 2 +- .config/mimeapps.list | 2 +- .config/ncmpcpp/config | 2 +- .local/bin/dmenuunicode | 2 +- .local/bin/getkeys | 4 ++-- .local/bin/podentr | 2 +- .local/bin/statusbar/help | 2 +- .local/bin/statusbar/mailbox | 2 +- .profile | 6 +++--- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index e07ee7a8..1806d50e 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -43,4 +43,4 @@ alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ~/.config/shortcutrc" \ - weath="less -S ~/.local/share/weatherreport" \ + weath="less -S $XDG_DATA_HOME/weatherreport" \ diff --git a/.config/i3/config b/.config/i3/config index a22fe8ec..e965b7cc 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -222,7 +222,7 @@ for_window [title="mpvfloat"] border pixel 0 no_focus [title="mpvfloat"] # #---Function Buttons---# # -bindsym $mod+F1 exec --no-startup-id groff -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - +bindsym $mod+F1 exec --no-startup-id groff -mom $XDG_DATA_HOME/larbs/readme.mom -Tpdf | zathura - bindsym $mod+F2 restart bindsym $mod+F3 exec --no-startup-id displayselect bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 30988ccf..5c1c093e 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,7 +1,7 @@ [Default Applications] # xdg-open will use these settings to determine how to open filetypes. -# These .desktop entries can also be seen and changed in ~/.local/share/applications/ +# These .desktop entries can also be seen and changed in $XDG_DATA_HOME/applications/ text/x-shellscript=text.desktop; x-scheme-handler/magnet=torrent.desktop; diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 2c9eda4c..40fcbc6f 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -10,7 +10,7 @@ ncmpcpp_directory = ~/.config/ncmpcpp ## MPD clients (eg. ncmpc) also use that location. ## # -lyrics_directory = ~/.local/share/lyrics +lyrics_directory = $XDG_DATA_HOME/lyrics # ##### connection settings ##### # diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode index 12240e74..df8c7a03 100755 --- a/.local/bin/dmenuunicode +++ b/.local/bin/dmenuunicode @@ -5,7 +5,7 @@ # Must have xclip installed to even show menu. xclip -h 2>/dev/null || exit 1 -chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") +chosen=$(cut -d ';' -f1 $XDG_DATA_HOME/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") [ "$chosen" != "" ] || exit diff --git a/.local/bin/getkeys b/.local/bin/getkeys index 8871d414..0a12d22d 100755 --- a/.local/bin/getkeys +++ b/.local/bin/getkeys @@ -1,5 +1,5 @@ #!/bin/sh -cat ~/.local/share/larbs/getkeys/"$1" 2>/dev/null && exit +cat $XDG_DATA_HOME/larbs/getkeys/"$1" 2>/dev/null && exit echo "Run command with one of the following arguments for info about that program:" -ls ~/.local/share/larbs/getkeys +ls $XDG_DATA_HOME/larbs/getkeys diff --git a/.local/bin/podentr b/.local/bin/podentr index e765c584..5bdc0ca3 100755 --- a/.local/bin/podentr +++ b/.local/bin/podentr @@ -4,4 +4,4 @@ [ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit -echo ~/.local/share/newsboat/queue | entr -p queueandnotify 2>/dev/null +echo $XDG_DATA_HOME/newsboat/queue | entr -p queueandnotify 2>/dev/null diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help index d7345dc9..d58f5cca 100755 --- a/.local/bin/statusbar/help +++ b/.local/bin/statusbar/help @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) groff -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - ;; + 1) groff -mom $XDG_DATA_HOME/larbs/readme.mom -Tpdf | zathura - ;; 2) i3 restart ;; 3) pgrep -x dunst >/dev/null && notify-send "❓ Help module" "\- Left click to open LARBS guide. - Middle click to refresh i3.";; diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 3ace5f5b..72d45111 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -13,7 +13,7 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -unread="$(find ~/.local/share/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" +unread="$(find $XDG_DATA_HOME/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" icon="$(cat "/tmp/imapsyncicon_$USER")" diff --git a/.profile b/.profile index 0f4a835a..74a99bfa 100644 --- a/.profile +++ b/.profile @@ -3,8 +3,8 @@ # Adds `~/.local/bin` to $PATH export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" -# Get default LARBS WM from ~/.local/share/larbs/wm -export LARBSWM="$(cat ~/.local/share/larbs/wm 2>/dev/null)" && +# Get default LARBS WM from $XDG_DATA_HOME/larbs/wm +export LARBSWM="$(cat $XDG_DATA_HOME/larbs/wm 2>/dev/null)" && [ "$LARBSWM" = "dwm" ] || export LARBSWM="i3" # Default programs: @@ -46,4 +46,4 @@ export LESS_TERMCAP_ue="$(printf '%b' '')" [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx # Switch escape and caps if tty and no passwd required: -sudo -n loadkeys ~/.local/share/larbs/ttymaps.kmap 2>/dev/null +sudo -n loadkeys $XDG_DATA_HOME/larbs/ttymaps.kmap 2>/dev/null From a29eaec506a7ce9e42d64a3ec1d17690387def30 Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sat, 4 Apr 2020 13:00:08 -0700 Subject: [PATCH 016/142] substitute ~/.config with $XDG_CONFIG_HOME --- .config/aliasrc | 2 +- .config/directories | 2 +- .config/files | 26 +++++++++++++------------- .config/lf/lfrc | 10 +++++----- .config/mpd/mpd.conf | 12 ++++++------ .config/ncmpcpp/config | 2 +- .config/nvim/init.vim | 8 ++++---- .config/ranger/commands.py | 2 +- .config/ranger/luke_ranger_readme.md | 6 +++--- .config/ranger/rc.conf | 4 ++-- .config/sxiv/exec/key-handler | 4 ++-- .config/vifm/vifmrc | 2 +- .local/bin/cron/crontog | 2 +- .local/bin/statusbar/clock | 2 +- .local/bin/statusbar/iplocate | 2 +- .local/bin/statusbar/news | 2 +- .local/share/larbs/getkeys/sxiv | 2 +- .local/share/larbs/readme.mom | 10 +++++----- .profile | 2 +- .xprofile | 2 +- README.md | 8 ++++---- 21 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index 1806d50e..34bf437b 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -42,5 +42,5 @@ alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" # Some other stuff alias \ magit="nvim -c MagitOnly" \ - ref="shortcuts >/dev/null; source ~/.config/shortcutrc" \ + ref="shortcuts >/dev/null; source $XDG_CONFIG_HOME/shortcutrc" \ weath="less -S $XDG_DATA_HOME/weatherreport" \ diff --git a/.config/directories b/.config/directories index 24bdd218..cd3aafb7 100644 --- a/.config/directories +++ b/.config/directories @@ -5,6 +5,6 @@ D ~/Downloads m ~/Music pp ~/Pictures vv ~/Videos -cf ~/.config +cf $XDG_CONFIG_HOME sc ~/.local/bin mn /mnt diff --git a/.config/files b/.config/files index b34f1849..6aee4602 100644 --- a/.config/files +++ b/.config/files @@ -1,15 +1,15 @@ -bf ~/.config/files -bd ~/.config/directories -bw ~/.config/bookmarks -cfa ~/.config/aliasrc +bf $XDG_CONFIG_HOME/files +bd $XDG_CONFIG_HOME/directories +bw $XDG_CONFIG_HOME/bookmarks +cfa $XDG_CONFIG_HOME/aliasrc cfz $ZDOTDIR/.zshrc -cfv ~/.config/nvim/init.vim -cfm ~/.config/mutt/muttrc +cfv $XDG_CONFIG_HOME/nvim/init.vim +cfm $XDG_CONFIG_HOME/mutt/muttrc cfd ~/.Xdefaults -cfu ~/.config/newsboat/urls -cfn ~/.config/newsboat/config -cfmb ~/.config/ncmpcpp/bindings -cfmc ~/.config/ncmpcpp/config -cfk ~/.config/sxhkd/sxhkdrc -cfi ~/.config/i3/config -cfb ~/.config/i3blocks/config +cfu $XDG_CONFIG_HOME/newsboat/urls +cfn $XDG_CONFIG_HOME/newsboat/config +cfmb $XDG_CONFIG_HOME/ncmpcpp/bindings +cfmc $XDG_CONFIG_HOME/ncmpcpp/config +cfk $XDG_CONFIG_HOME/sxhkd/sxhkdrc +cfi $XDG_CONFIG_HOME/i3/config +cfb $XDG_CONFIG_HOME/i3blocks/config diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 27900a1d..3b4cc14f 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -2,7 +2,7 @@ # Basic vars set shell sh -set previewer ~/.config/lf/scope +set previewer $XDG_CONFIG_HOME/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 @@ -36,7 +36,7 @@ cmd delete ${{ cmd moveto ${{ set -f clear; echo "Move to where?" - dest="$(cut -d' ' -f2- ~/.config/directories | fzf)" && + dest="$(cut -d' ' -f2- $XDG_CONFIG_HOME/directories | fzf)" && eval mv -iv $fx $dest && notify-send "🚚 File(s) moved." "File(s) moved to $dest." }} @@ -44,7 +44,7 @@ cmd moveto ${{ cmd copyto ${{ set -f clear; echo "Copy to where?" - dest="$(cut -d' ' -f2- ~/.config/directories | fzf)" && + dest="$(cut -d' ' -f2- $XDG_CONFIG_HOME/directories | fzf)" && eval cp -ivr $fx $dest && notify-send "📋 File(s) copied." "File(s) copies to $dest." }} @@ -54,9 +54,9 @@ cmd bulkrename ${{ }} # Bindings -map c $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)" +map c $lf -remote "send $id cd $(cut -d' ' -f2 $XDG_CONFIG_HOME/directories | fzf)" map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)" +map J $lf -remote "send $id cd $(cut -d' ' -f2 $XDG_CONFIG_HOME/directories | fzf)" map gh map g top map D delete diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index a0548ecd..8a30ca5f 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -1,10 +1,10 @@ -db_file "~/.config/mpd/database" -log_file "~/.config/mpd/log" +db_file "$XDG_CONFIG_HOME/mpd/database" +log_file "$XDG_CONFIG_HOME/mpd/log" music_directory "~/Music" -playlist_directory "~/.config/mpd/playlists" -pid_file "~/.config/mpd/pid" -state_file "~/.config/mpd/state" -sticker_file "~/.config/mpd/sticker.sql" +playlist_directory "$XDG_CONFIG_HOME/mpd/playlists" +pid_file "$XDG_CONFIG_HOME/mpd/pid" +state_file "$XDG_CONFIG_HOME/mpd/state" +sticker_file "$XDG_CONFIG_HOME/mpd/sticker.sql" auto_update "yes" diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 40fcbc6f..d2e11326 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -3,7 +3,7 @@ ## or $XDG_CONFIG_HOME/ncmpcpp/config and set up your preferences. ## ############################################################################## # -ncmpcpp_directory = ~/.config/ncmpcpp +ncmpcpp_directory = $XDG_CONFIG_HOME/ncmpcpp # ## ## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d8b0ba20..ae94ae1d 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,13 +1,13 @@ let mapleader ="," -if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) +if ! filereadable(expand('$XDG_CONFIG_HOME/nvim/autoload/plug.vim')) echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ~/.config/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim + silent !mkdir -p $XDG_CONFIG_HOME/nvim/autoload/ + silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > $XDG_CONFIG_HOME/nvim/autoload/plug.vim autocmd VimEnter * PlugInstall endif -call plug#begin('~/.config/nvim/plugged') +call plug#begin('$XDG_CONFIG_HOME/nvim/plugged') Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree' Plug 'junegunn/goyo.vim' diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py index 71fd2a24..5b1acd2d 100755 --- a/.config/ranger/commands.py +++ b/.config/ranger/commands.py @@ -60,7 +60,7 @@ class my_edit(Command): # https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf -# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf: map fzf_select +# Now, simply bind this function to a key, by adding this to your $XDG_CONFIG_HOME/ranger/rc.conf: map fzf_select class fzf_select(Command): """ :fzf_select diff --git a/.config/ranger/luke_ranger_readme.md b/.config/ranger/luke_ranger_readme.md index 51c5dd10..f6ee93fc 100644 --- a/.config/ranger/luke_ranger_readme.md +++ b/.config/ranger/luke_ranger_readme.md @@ -32,10 +32,10 @@ These "verbs" take "nouns" or "arguments," like these: + d -- "~/Documents" + D -- "~/Downloads" -+ cf -- "~/.config" ++ cf -- "$XDG_CONFIG_HOME" + And many others, including those you add to `~/.bmdirs`. -Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in ~/.config, etc. etc. +Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in $XDG_CONFIG_HOME, etc. etc. ## Many little additions! @@ -60,7 +60,7 @@ Press any "verb" followed by any "argument" to perform a folder operation. "gd" + Txs -- copy slideshow/beamer template to new file + Txh -- copy handout template to new file + Image commands: - + bg -- (for i3 users) makes an image your background (assuming i3 is looking at ~/.config/wall.png for your background) + + bg -- (for i3 users) makes an image your background (assuming i3 is looking at $XDG_CONFIG_HOME/wall.png for your background) + bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it. + C -- rotates an image (requires imagemagick) + F -- flips an image (requires imagemagick) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 89b4b8c2..ff0d5069 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -5,7 +5,7 @@ set column_ratios 1,3,4 set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ set show_hidden false set confirm_on_delete multiple -set preview_script ~/.config/ranger/scope.sh +set preview_script $XDG_CONFIG_HOME/ranger/scope.sh set use_preview_script true set automatically_count_files true set open_all_images true @@ -505,4 +505,4 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po #Downloading map ytv console shell youtube-dl -ic%space map yta console shell youtube-dl -xic%space -source ~/.config/ranger/shortcuts.conf +source $XDG_CONFIG_HOME/ranger/shortcuts.conf diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index d9f18254..e096f6e4 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -4,12 +4,12 @@ do case "$1" in "w") setbg "$file" & ;; "c") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" $XDG_CONFIG_HOME/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & ;; "m") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" $XDG_CONFIG_HOME/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & ;; diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index b327786c..ed77ea83 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -1,5 +1,5 @@ " vim: filetype=vifm -source ~/.config/vifm/vifmshortcuts +source $XDG_CONFIG_HOME/vifm/vifmshortcuts set vicmd=$EDITOR set syscalls diff --git a/.local/bin/cron/crontog b/.local/bin/cron/crontog index 67f620b9..9889d769 100755 --- a/.local/bin/cron/crontog +++ b/.local/bin/cron/crontog @@ -3,4 +3,4 @@ # Toggles all cronjobs off/on. # Stores disabled crontabs in ~/.consaved until restored. -([ -f ~/.config/cronsaved ] && crontab - < ~/.config/cronsaved && rm ~/.config/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ~/.config/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") +([ -f $XDG_CONFIG_HOME/cronsaved ] && crontab - < $XDG_CONFIG_HOME/cronsaved && rm $XDG_CONFIG_HOME/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > $XDG_CONFIG_HOME/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index d17f3c63..f412bcb9 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -4,7 +4,7 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; - 2) $TERMINAL -e calcurse -D ~/.config/calcurse ;; + 2) $TERMINAL -e calcurse -D $XDG_CONFIG_HOME/calcurse ;; 3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate index 4ca4f107..6d1038cb 100755 --- a/.local/bin/statusbar/iplocate +++ b/.local/bin/statusbar/iplocate @@ -6,4 +6,4 @@ # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ ifinstalled "geoiplookup" || exit addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " ~/.config/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" +grep "flag: " $XDG_CONFIG_HOME/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index a8842ad8..e72ef570 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in Note: Only one instance of newsboat (including updates) may be running at a time." ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat $XDG_CONFIG_HOME/newsboat/.update 2>/dev/null)" diff --git a/.local/share/larbs/getkeys/sxiv b/.local/share/larbs/getkeys/sxiv index df5cb1e0..40310393 100644 --- a/.local/share/larbs/getkeys/sxiv +++ b/.local/share/larbs/getkeys/sxiv @@ -12,4 +12,4 @@ sxiv is the image viewer. r - Reload image if changed m - Mark/unmark image w - Zoom to fit window - ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options) + ctrl-x - Run external command (see $XDG_CONFIG_HOME/sxiv/exec/key-handler for options) diff --git a/.local/share/larbs/readme.mom b/.local/share/larbs/readme.mom index c46b1a82..03151a70 100644 --- a/.local/share/larbs/readme.mom +++ b/.local/share/larbs/readme.mom @@ -64,7 +64,7 @@ Below in this document, there is information about where to change programs/comp .PP Additionally, while this isn't a part of the desktop environment, the default editing mode in the shell is using vi bindings. If you want to learn more of this, run \f(CWMod+Shift+E\fP and type and select the option for "vi mode in shell". -This setting can be changed if you don't like it by deleting or commenting out the contents of \f(CW~/.config/inputrc\fP. +This setting can be changed if you don't like it by deleting or commenting out the contents of \f(CW$XDG_CONFIG_HOME/inputrc\fP. .HEADING 2 "The Status Bar" .PP To the left, you'll see the numbers of your current workspace/tag(s). @@ -73,7 +73,7 @@ Each module on the right of the status bar is a script located in \f(CW~/.local/ You can see what they do and modify them from there. I'm sure you can figure it out. .PP -In i3, the program i3blocks controls what modules appear in the statusbar; its config file is in \f(CW~/.config/i3blocks/config\fP. +In i3, the program i3blocks controls what modules appear in the statusbar; its config file is in \f(CW$XDG_CONFIG_HOME/i3blocks/config\fP. .HEADING 2 "Deeper Tutorials" .PP Press \f(CWmod+shift+e\fP at any time to get a menu of programs to watch videos about streaming directly from YouTube. @@ -252,7 +252,7 @@ buttons, screen brightness, email, web browsing buttons, etc.) to what you would expect. .HEADING 1 "Configuration" .PP -Dotfiles/settings files are located in \f(CW~/.config/\fP, note that dotfiles to programs not included in LARBS are there as well by requests of users. I do not necessarily maintain all these dotfiles, but they remain as legacy. +Dotfiles/settings files are located in \f(CW$XDG_CONFIG_HOME/\fP, note that dotfiles to programs not included in LARBS are there as well by requests of users. I do not necessarily maintain all these dotfiles, but they remain as legacy. .PP Suckless programs, st (the terminal) and dmenu among others do not have traditional config files, but have their source code location in \f(CW~/.local/src/\fP. There you can modify their \f(CWconfig.h\fP files, then \f(CWsudo make install\fP to reinstall. @@ -278,7 +278,7 @@ In the Linux terminal, those binds have other more important purposes, so you ca Additionally, I've set vim to use the clipboard as the default buffer, which means when you copy or delete something in vim, it will be in your system clipboard as well, so you can \f(CWctrl-v\fP it into your browser instance, etc. You can also paste material copied from other programs into vim with the typical vim bindings. .HEADING 2 "How do I change the background/wallpaper?" .PP -The system will always read the file \f(CW~/.config/wall.png\fP as the wallpaper. +The system will always read the file \f(CW$XDG_CONFIG_HOME/wall.png\fP as the wallpaper. The script \f(CWsetbg\fP, if run on an image will set it as the persistent background. When using the file manager, you can simply hover over an image name and type \f(CWbg\fP and this will run \f(CWsetbg\fP. .HEADING 2 "How I change the colorscheme?" @@ -296,7 +296,7 @@ You can sync your mail by pressing \f(CWMod+F8\fP and you can set a cronjob to s .HEADING 2 "How do I set up my music?" .PP By default, mpd, the music daemon assumes that \f(CW~/Music\fP is your music directory. -This can be changed in \f(CW~/.config/mpd/mpd.conf\fP. +This can be changed in \f(CW$XDG_CONFIG_HOME/mpd/mpd.conf\fP. When you add music to your music folder, you may have to run \f(CWmpc up\fP in the terminal to update the database. mpd is controlled by ncmpcpp, which is accessible by \f(CWMod+m\fP. .HEADING 2 "How do I update LARBS?" diff --git a/.profile b/.profile index 74a99bfa..b62ae218 100644 --- a/.profile +++ b/.profile @@ -40,7 +40,7 @@ export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" -[ ! -f ~/.config/shortcutrc ] && shortcuts >/dev/null 2>&1 +[ ! -f $XDG_CONFIG_HOME/shortcutrc ] && shortcuts >/dev/null 2>&1 # Start graphical server on tty1 if not already running. [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx diff --git a/.xprofile b/.xprofile index 677eff10..853aa584 100644 --- a/.xprofile +++ b/.xprofile @@ -10,7 +10,7 @@ dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XA 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 ~/.config/Xresources & # Uncomment to use Xresources colors/settings on startup +#xrdb $XDG_CONFIG_HOME/Xresources & # Uncomment to use Xresources colors/settings on startup xcompmgr & # xcompmgr for transparency $STATUSBAR & # start the statusbar dunst & # dunst for notifications diff --git a/README.md b/README.md index 069055d1..a7881481 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on [my - tmux - other stuff like xdg default programs, inputrc and more, etc. - I try to minimize what's directly in `~` so: - - All configs that can be in `~/.config/` are. - - Some environmental variables have been set in `~/.zprofile` to move configs into `~/.config/` + - All configs that can be in `$XDG_CONFIG_HOME/` are. + - Some environmental variables have been set in `~/.zprofile` to move configs into `$XDG_CONFIG_HOME/` - Bookmarks in text files used by various scripts (like `~/.local/bin/shortcuts`) - - File bookmarks in `~/.config/files` - - Directory bookmarks in `~/.config/directories` + - File bookmarks in `$XDG_CONFIG_HOME/files` + - Directory bookmarks in `$XDG_CONFIG_HOME/directories` ## Want even more? From 043c6253537a20875adbfd274c1c3a3377803095 Mon Sep 17 00:00:00 2001 From: Aleks Ozolins Date: Sun, 5 Apr 2020 09:19:53 -0400 Subject: [PATCH 017/142] Update .profile to export XDG base dirs (#526) Not every program will read them from ~/.config/user-dirs.dirs so might as well export them yourself... Also can now use them elsewhere. --- .profile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.profile b/.profile index 1b5460a0..890acde7 100644 --- a/.profile +++ b/.profile @@ -14,6 +14,9 @@ export BROWSER="brave" export READER="zathura" export STATUSBAR="${LARBSWM}blocks" +# Export XDG environmental variables from '~/.config/user-dirs.dirs' +eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" + # ~/ Clean-up: #export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. export NOTMUCH_CONFIG="$HOME/.config/notmuch-config" From 2135dbdc4a4efe4337aacbba183968cbf0bd3c54 Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sun, 5 Apr 2020 09:50:58 -0700 Subject: [PATCH 018/142] revert README.md to use hardcoded xdg paths --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a7881481..069055d1 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on [my - tmux - other stuff like xdg default programs, inputrc and more, etc. - I try to minimize what's directly in `~` so: - - All configs that can be in `$XDG_CONFIG_HOME/` are. - - Some environmental variables have been set in `~/.zprofile` to move configs into `$XDG_CONFIG_HOME/` + - All configs that can be in `~/.config/` are. + - Some environmental variables have been set in `~/.zprofile` to move configs into `~/.config/` - Bookmarks in text files used by various scripts (like `~/.local/bin/shortcuts`) - - File bookmarks in `$XDG_CONFIG_HOME/files` - - Directory bookmarks in `$XDG_CONFIG_HOME/directories` + - File bookmarks in `~/.config/files` + - Directory bookmarks in `~/.config/directories` ## Want even more? From 4da6d64600223bf8431416d944f0d1953ed01ef6 Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sun, 5 Apr 2020 09:51:46 -0700 Subject: [PATCH 019/142] revert readme.mom to use hardcoded xdg paths --- .local/share/larbs/readme.mom | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/share/larbs/readme.mom b/.local/share/larbs/readme.mom index 03151a70..c46b1a82 100644 --- a/.local/share/larbs/readme.mom +++ b/.local/share/larbs/readme.mom @@ -64,7 +64,7 @@ Below in this document, there is information about where to change programs/comp .PP Additionally, while this isn't a part of the desktop environment, the default editing mode in the shell is using vi bindings. If you want to learn more of this, run \f(CWMod+Shift+E\fP and type and select the option for "vi mode in shell". -This setting can be changed if you don't like it by deleting or commenting out the contents of \f(CW$XDG_CONFIG_HOME/inputrc\fP. +This setting can be changed if you don't like it by deleting or commenting out the contents of \f(CW~/.config/inputrc\fP. .HEADING 2 "The Status Bar" .PP To the left, you'll see the numbers of your current workspace/tag(s). @@ -73,7 +73,7 @@ Each module on the right of the status bar is a script located in \f(CW~/.local/ You can see what they do and modify them from there. I'm sure you can figure it out. .PP -In i3, the program i3blocks controls what modules appear in the statusbar; its config file is in \f(CW$XDG_CONFIG_HOME/i3blocks/config\fP. +In i3, the program i3blocks controls what modules appear in the statusbar; its config file is in \f(CW~/.config/i3blocks/config\fP. .HEADING 2 "Deeper Tutorials" .PP Press \f(CWmod+shift+e\fP at any time to get a menu of programs to watch videos about streaming directly from YouTube. @@ -252,7 +252,7 @@ buttons, screen brightness, email, web browsing buttons, etc.) to what you would expect. .HEADING 1 "Configuration" .PP -Dotfiles/settings files are located in \f(CW$XDG_CONFIG_HOME/\fP, note that dotfiles to programs not included in LARBS are there as well by requests of users. I do not necessarily maintain all these dotfiles, but they remain as legacy. +Dotfiles/settings files are located in \f(CW~/.config/\fP, note that dotfiles to programs not included in LARBS are there as well by requests of users. I do not necessarily maintain all these dotfiles, but they remain as legacy. .PP Suckless programs, st (the terminal) and dmenu among others do not have traditional config files, but have their source code location in \f(CW~/.local/src/\fP. There you can modify their \f(CWconfig.h\fP files, then \f(CWsudo make install\fP to reinstall. @@ -278,7 +278,7 @@ In the Linux terminal, those binds have other more important purposes, so you ca Additionally, I've set vim to use the clipboard as the default buffer, which means when you copy or delete something in vim, it will be in your system clipboard as well, so you can \f(CWctrl-v\fP it into your browser instance, etc. You can also paste material copied from other programs into vim with the typical vim bindings. .HEADING 2 "How do I change the background/wallpaper?" .PP -The system will always read the file \f(CW$XDG_CONFIG_HOME/wall.png\fP as the wallpaper. +The system will always read the file \f(CW~/.config/wall.png\fP as the wallpaper. The script \f(CWsetbg\fP, if run on an image will set it as the persistent background. When using the file manager, you can simply hover over an image name and type \f(CWbg\fP and this will run \f(CWsetbg\fP. .HEADING 2 "How I change the colorscheme?" @@ -296,7 +296,7 @@ You can sync your mail by pressing \f(CWMod+F8\fP and you can set a cronjob to s .HEADING 2 "How do I set up my music?" .PP By default, mpd, the music daemon assumes that \f(CW~/Music\fP is your music directory. -This can be changed in \f(CW$XDG_CONFIG_HOME/mpd/mpd.conf\fP. +This can be changed in \f(CW~/.config/mpd/mpd.conf\fP. When you add music to your music folder, you may have to run \f(CWmpc up\fP in the terminal to update the database. mpd is controlled by ncmpcpp, which is accessible by \f(CWMod+m\fP. .HEADING 2 "How do I update LARBS?" From 77ba6e73c64aebf9e4f35a217117fc3dafbde99c Mon Sep 17 00:00:00 2001 From: Spenser Truex Date: Sun, 5 Apr 2020 15:30:49 -0700 Subject: [PATCH 020/142] Prevent writing all marked imgs onto file (lossage) (#534) This fix issues a warning message and does nothing in that case. Running C-x c (copy) or C-x m (move) will copy/move all the marked files to a single location. If that location is not a directory, then creating that file and overwriting it several times results in complete loss of data in the case of moving, and unhelpful behaviour in the case of "copying". Only the last marked file remains in the file. --- .config/sxiv/exec/key-handler | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index d9f18254..73b572a0 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -6,11 +6,13 @@ do "c") [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit + [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & ;; "m") [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit + [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & ;; "r") From 6cb9c842c6691842d1bd34e495e84e12646d4991 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 5 Apr 2020 18:31:37 -0400 Subject: [PATCH 021/142] inc rmd --- .config/fontconfig/fonts.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 749a7cc8..1a4b4042 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -30,7 +30,6 @@ Noto Sans Mono Liberation Mono - Joy Pixels Noto Color Emoji From 4471100f17dcdf33fcaafab8cb7c4947473930a5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 5 Apr 2020 23:13:33 -0400 Subject: [PATCH 022/142] negatives fix --- .local/bin/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 285ac917..34cd2451 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -4,7 +4,7 @@ getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} case $BLOCK_BUTTON in 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; From d650aacb907a2458fc22d9a225f6fd3c4ab2ef28 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 5 Apr 2020 23:14:14 -0400 Subject: [PATCH 023/142] weather updates --- .local/bin/statusbar/weather | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 34cd2451..e98628e4 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -1,11 +1,22 @@ #!/bin/sh -getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 +# Displays todays precipication chance (☔) and daily low (❄) and high (🌞). +# Usually intended for the statusbar. + +# 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. +getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" +# Some very particular and terse stream manipulation. We get the maximum +# precipication chance and the daily high and low from the downloaded file and +# display them with coresponding emojis. +showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | + grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +# The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; 2) getforecast && showweather ;; @@ -16,7 +27,9 @@ case $BLOCK_BUTTON in 🌞: Daily high" ;; esac -if [ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] - then getforecast && showweather - else showweather -fi +# The test if our forcecast is updated to the day. If it isn't download a new +# weather report from wttr.in with the above function. +[ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || + getforecast + +showweather From 1316be8ec42fdbc8e8a9e2c41872d6e6e9402c1b Mon Sep 17 00:00:00 2001 From: Arjun Karangiya Date: Mon, 6 Apr 2020 11:29:58 +0530 Subject: [PATCH 024/142] New featuer: ZSH named dirs --- .config/aliasrc | 2 +- .config/zsh/.zshrc | 3 ++- .local/bin/shortcuts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index e07ee7a8..c1ae2a8c 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -42,5 +42,5 @@ alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" # Some other stuff alias \ magit="nvim -c MagitOnly" \ - ref="shortcuts >/dev/null; source ~/.config/shortcutrc" \ + ref="shortcuts >/dev/null; source ~/.config/shortcutrc; source ~/.config/zshnameddirrc" \ weath="less -S ~/.local/share/weatherreport" \ diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 63c0049b..eef425d4 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -3,9 +3,10 @@ autoload -U colors && colors PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " -# Load aliases and shortcuts if existent. +# Load aliases, shortcuts and nameddirs if existent. [ -f "$HOME/.config/shortcutrc" ] && source "$HOME/.config/shortcutrc" [ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" +[ -f "$HOME/.config/zshnameddirrc" ] && source "$HOME/.config/zshnameddirrc" autoload -U compinit zstyle ':completion:*' menu select diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 55ce30ae..26112068 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -2,19 +2,21 @@ # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="$HOME/.config/shortcutrc" +zsh_named_dirs="$HOME/.config/zshnameddirrc" ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" vifm_shortcuts="$HOME/.config/vifm/vifmshortcuts" # Remove, prepare files -rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null +rm -f "$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" # Format the `directories` file in the correct syntax and sent it to all three configs. sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ + >(awk '{print "hash -d "$1"="$2}' >> "$zsh_named_dirs") \ >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ >(awk '{print "map g" $1, ":cd", $2 "\nmap t" $1, ":cd", $2 "\nmap M" $1, ":cd", $2 ":mo\nmap Y" $1, ":cd", $2 ":co" }' >> "$vifm_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ From cd2a1633cf3c12f8f60cd9d05847b4b8e9e8096f Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Mon, 6 Apr 2020 10:39:36 -0700 Subject: [PATCH 025/142] use "~/.config" in .local/share/larbs/getkeys/sxiv --- .local/share/larbs/getkeys/sxiv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/share/larbs/getkeys/sxiv b/.local/share/larbs/getkeys/sxiv index 40310393..df5cb1e0 100644 --- a/.local/share/larbs/getkeys/sxiv +++ b/.local/share/larbs/getkeys/sxiv @@ -12,4 +12,4 @@ sxiv is the image viewer. r - Reload image if changed m - Mark/unmark image w - Zoom to fit window - ctrl-x - Run external command (see $XDG_CONFIG_HOME/sxiv/exec/key-handler for options) + ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options) From 29096439ac8de198511736345206e916a3a5cbe7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 6 Apr 2020 19:28:33 -0400 Subject: [PATCH 026/142] weather for pos, neg and signless pos temps --- .local/bin/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index e98628e4..0a501e3c 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -14,7 +14,7 @@ curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in From 2d8fe0c738e84f2a202914771e7be665718d588e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 7 Apr 2020 09:22:41 -0400 Subject: [PATCH 027/142] emoji fonts not specified for mono --- .config/fontconfig/fonts.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 1a4b4042..2d58803c 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -30,8 +30,6 @@ Noto Sans Mono Liberation Mono - Joy Pixels - Noto Color Emoji From fb456c4d98ac44497294617411c1100943d14a40 Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Tue, 7 Apr 2020 21:47:39 -0700 Subject: [PATCH 028/142] statusbar weather HOME/.local/share:=XDG_DATA_HOME --- .local/bin/statusbar/weather | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 0a501e3c..63415b4d 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -7,18 +7,18 @@ # 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. getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && -curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} +curl -sf "wttr.in/$LOCATION" > "$XDG_DATA_HOME/weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum # precipication chance and the daily high and low from the downloaded file and # display them with coresponding emojis. -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | +showweather() { printf "%s" "$(sed '16q;d' "$XDG_DATA_HOME/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +sed '13q;d' "$XDG_DATA_HOME/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; + 1) $TERMINAL -e less -Srf "$XDG_DATA_HOME/weatherreport" ;; 2) getforecast && showweather ;; 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. @@ -29,7 +29,7 @@ esac # The test if our forcecast is updated to the day. If it isn't download a new # weather report from wttr.in with the above function. -[ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || +[ "$(stat -c %y "$XDG_DATA_HOME/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getforecast showweather From fd930553a31e4693502c5f41745bc76d5c8b172b Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Tue, 7 Apr 2020 19:48:39 -0700 Subject: [PATCH 029/142] aliasrc: clean up mbsync from ~/ --- .config/aliasrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/aliasrc b/.config/aliasrc index 34bf437b..915690cc 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -44,3 +44,4 @@ alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source $XDG_CONFIG_HOME/shortcutrc" \ weath="less -S $XDG_DATA_HOME/weatherreport" \ + mbsync="mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc" From c1e2aa9ffcf1c4ee116b0495b6e8bf6ba67c5188 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Wed, 8 Apr 2020 16:16:59 +0200 Subject: [PATCH 030/142] Move bg link to ~/.local/share/ (#545) * Move bg link to ~/.local/share/ often the ~/.cache directory is deleted because it gets too big, in my case if i compile stuff with yay, firefoxs chace also gets quite big, and mesa shaders are also stored there. * added a symlink to .config/wall.png * removed the .cache dir --- .cache/bg | 1 - .local/bin/setbg | 2 +- .local/share/bg | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 120000 .cache/bg create mode 120000 .local/share/bg diff --git a/.cache/bg b/.cache/bg deleted file mode 120000 index 787af6fd..00000000 --- a/.cache/bg +++ /dev/null @@ -1 +0,0 @@ -../.config/wall.png \ No newline at end of file diff --git a/.local/bin/setbg b/.local/bin/setbg index 7b07e23e..82693787 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -7,7 +7,7 @@ # If wal is installed, also generate a colorscheme. # Location of link to wallpaper link. -bgloc="${XDG_CACHE_HOME:-$HOME/.cache/}/bg" +bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" [ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." diff --git a/.local/share/bg b/.local/share/bg new file mode 120000 index 00000000..6c5d2998 --- /dev/null +++ b/.local/share/bg @@ -0,0 +1 @@ +../../.config/wall.png \ No newline at end of file From a6e7fd4ba7a76f16075a2e6e357af05826bae8d4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 11:25:13 -0400 Subject: [PATCH 031/142] volume module updates automatically --- .local/bin/lmc | 2 -- 1 file changed, 2 deletions(-) diff --git a/.local/bin/lmc b/.local/bin/lmc index 6d64b649..d4314952 100755 --- a/.local/bin/lmc +++ b/.local/bin/lmc @@ -26,5 +26,3 @@ case "$1" in down) down ;; control) control ;; esac - -pkill -RTMIN+10 "${STATUSBAR:?}" & From f68f3119c1da3c6229c0c26e41b60f20ce7bc84a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 11:34:45 -0400 Subject: [PATCH 032/142] zshrc update --- .config/zsh/.zshrc | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 63c0049b..4fa744de 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -1,19 +1,30 @@ # Luke's config for the Zoomer Shell -autoload -U colors && colors +# Enable colors and change prompt: +autoload -U colors && colors # Load colors PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " +setopt autocd # Automatically cd into typed directory. +stty stop undef # Disable ctrl-s to freeze terminal. + +# History in cache directory: +HISTSIZE=10000 +SAVEHIST=10000 +HISTFILE=~/.cache/zsh/history # Load aliases and shortcuts if existent. [ -f "$HOME/.config/shortcutrc" ] && source "$HOME/.config/shortcutrc" [ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" +# Basic auto/tab complete: autoload -U compinit zstyle ':completion:*' menu select zmodload zsh/complist compinit +_comp_options+=(globdots) # Include hidden files. -# Include hidden files in autocomplete: -_comp_options+=(globdots) +# vi mode +bindkey -v +export KEYTIMEOUT=1 # Use vim keys in tab complete menu: bindkey -M menuselect 'h' vi-backward-char @@ -22,14 +33,11 @@ bindkey -M menuselect 'l' vi-forward-char bindkey -M menuselect 'j' vi-down-line-or-history bindkey -v '^?' backward-delete-char -export KEYTIMEOUT=1 - # Change cursor shape for different vi modes. function zle-keymap-select { if [[ ${KEYMAP} == vicmd ]] || [[ $1 = 'block' ]]; then echo -ne '\e[1 q' - elif [[ ${KEYMAP} == main ]] || [[ ${KEYMAP} == viins ]] || [[ ${KEYMAP} = '' ]] || @@ -38,17 +46,13 @@ function zle-keymap-select { fi } zle -N zle-keymap-select - zle-line-init() { zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) echo -ne "\e[5 q" } zle -N zle-line-init - -# Use beam shape cursor on startup. -echo -ne '\e[5 q' -# Use beam shape cursor for each new prompt. -preexec() { echo -ne '\e[5 q' ;} +echo -ne '\e[5 q' # Use beam shape cursor on startup. +preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. # Use lf to switch directories and bind it to ctrl-o lfcd () { @@ -57,15 +61,20 @@ lfcd () { if [ -f "$tmp" ]; then dir="$(cat "$tmp")" rm -f "$tmp" - if [ -d "$dir" ]; then - if [ "$dir" != "$(pwd)" ]; then - cd "$dir" - fi - fi + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" fi } +bindkey -s '^o' 'lfcd\n' -bindkey -s '^o' 'lfcd\n' # zsh +bindkey -s '^a' 'bc -l\n' + +bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n' + +bindkey '^[[P' delete-char + +# Edit line in vim with ctrl-e: +autoload edit-command-line; zle -N edit-command-line +bindkey '^e' edit-command-line # Load zsh-syntax-highlighting; should be last. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null From bcbfd066cf90cd5aa83225d468680473b8f66ad6 Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Wed, 8 Apr 2020 10:59:19 -0700 Subject: [PATCH 033/142] revert .mbsyncrc back to default location in ~ This reverts commit fd930553a31e4693502c5f41745bc76d5c8b172b. --- .config/aliasrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/aliasrc b/.config/aliasrc index 915690cc..34bf437b 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -44,4 +44,3 @@ alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source $XDG_CONFIG_HOME/shortcutrc" \ weath="less -S $XDG_DATA_HOME/weatherreport" \ - mbsync="mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc" From 2c06dd36c61dea7383d2a12900eb83ee1751115a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 17:06:21 -0400 Subject: [PATCH 034/142] shortcut to xresources --- .config/files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/files b/.config/files index 6aee4602..54c5999d 100644 --- a/.config/files +++ b/.config/files @@ -5,7 +5,7 @@ cfa $XDG_CONFIG_HOME/aliasrc cfz $ZDOTDIR/.zshrc cfv $XDG_CONFIG_HOME/nvim/init.vim cfm $XDG_CONFIG_HOME/mutt/muttrc -cfd ~/.Xdefaults +cfx $XDG_CONFIG_HOME/Xresources cfu $XDG_CONFIG_HOME/newsboat/urls cfn $XDG_CONFIG_HOME/newsboat/config cfmb $XDG_CONFIG_HOME/ncmpcpp/bindings From 422d106fbab5505f3810fa845f4f71547c7a4332 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 17:21:40 -0400 Subject: [PATCH 035/142] assume default values if xdg dirs not set --- .config/aliasrc | 4 ++-- .config/directories | 2 +- .config/files | 28 ++++++++++++++-------------- .config/i3/config | 2 +- .config/lf/lfrc | 10 +++++----- .config/mimeapps.list | 2 +- .config/mpd/mpd.conf | 12 ++++++------ .config/ncmpcpp/config | 9 ++------- .config/nvim/init.vim | 8 ++++---- .config/ranger/commands.py | 4 ++-- .config/ranger/luke_ranger_readme.md | 6 +++--- .config/ranger/rc.conf | 4 ++-- .config/sxhkd/sxhkdrc | 4 ++-- .config/sxiv/exec/key-handler | 4 ++-- .config/vifm/vifmrc | 2 +- .config/zsh/.zshrc | 4 ++-- .local/bin/cron/crontog | 2 +- .local/bin/dmenuunicode | 2 +- .local/bin/getkeys | 4 ++-- .local/bin/i3cmds/toggle-welcome | 2 +- .local/bin/podentr | 2 +- .local/bin/queueandnotify | 2 +- .local/bin/rssadd | 2 +- .local/bin/shortcuts | 10 +++++----- .local/bin/statusbar/clock | 2 +- .local/bin/statusbar/help | 2 +- .local/bin/statusbar/iplocate | 2 +- .local/bin/statusbar/mailbox | 2 +- .local/bin/statusbar/news | 2 +- .local/bin/statusbar/weather | 10 +++++----- .profile | 24 ++++++++++++------------ .xprofile | 2 +- 32 files changed, 86 insertions(+), 91 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index 34bf437b..57b6f631 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -42,5 +42,5 @@ alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" # Some other stuff alias \ magit="nvim -c MagitOnly" \ - ref="shortcuts >/dev/null; source $XDG_CONFIG_HOME/shortcutrc" \ - weath="less -S $XDG_DATA_HOME/weatherreport" \ + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" \ + weath="less -S ${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" \ diff --git a/.config/directories b/.config/directories index cd3aafb7..957590ee 100644 --- a/.config/directories +++ b/.config/directories @@ -5,6 +5,6 @@ D ~/Downloads m ~/Music pp ~/Pictures vv ~/Videos -cf $XDG_CONFIG_HOME +cf ${XDG_CONFIG_HOME:$HOME/.config} sc ~/.local/bin mn /mnt diff --git a/.config/files b/.config/files index 54c5999d..05da40c1 100644 --- a/.config/files +++ b/.config/files @@ -1,15 +1,15 @@ -bf $XDG_CONFIG_HOME/files -bd $XDG_CONFIG_HOME/directories -bw $XDG_CONFIG_HOME/bookmarks -cfa $XDG_CONFIG_HOME/aliasrc +bf ${XDG_CONFIG_HOME:$HOME/.config}/files +bd ${XDG_CONFIG_HOME:$HOME/.config}/directories +bw ${XDG_CONFIG_HOME:$HOME/.config}/bookmarks +cfa ${XDG_CONFIG_HOME:$HOME/.config}/aliasrc cfz $ZDOTDIR/.zshrc -cfv $XDG_CONFIG_HOME/nvim/init.vim -cfm $XDG_CONFIG_HOME/mutt/muttrc -cfx $XDG_CONFIG_HOME/Xresources -cfu $XDG_CONFIG_HOME/newsboat/urls -cfn $XDG_CONFIG_HOME/newsboat/config -cfmb $XDG_CONFIG_HOME/ncmpcpp/bindings -cfmc $XDG_CONFIG_HOME/ncmpcpp/config -cfk $XDG_CONFIG_HOME/sxhkd/sxhkdrc -cfi $XDG_CONFIG_HOME/i3/config -cfb $XDG_CONFIG_HOME/i3blocks/config +cfv ${XDG_CONFIG_HOME:$HOME/.config}/nvim/init.vim +cfm ${XDG_CONFIG_HOME:$HOME/.config}/mutt/muttrc +cfx ${XDG_CONFIG_HOME:$HOME/.config}/Xresources +cfu ${XDG_CONFIG_HOME:$HOME/.config}/newsboat/urls +cfn ${XDG_CONFIG_HOME:$HOME/.config}/newsboat/config +cfmb ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp/bindings +cfmc ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp/config +cfk ${XDG_CONFIG_HOME:$HOME/.config}/sxhkd/sxhkdrc +cfi ${XDG_CONFIG_HOME:$HOME/.config}/i3/config +cfb ${XDG_CONFIG_HOME:$HOME/.config}/i3blocks/config diff --git a/.config/i3/config b/.config/i3/config index e965b7cc..36c8aba1 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -222,7 +222,7 @@ for_window [title="mpvfloat"] border pixel 0 no_focus [title="mpvfloat"] # #---Function Buttons---# # -bindsym $mod+F1 exec --no-startup-id groff -mom $XDG_DATA_HOME/larbs/readme.mom -Tpdf | zathura - +bindsym $mod+F1 exec --no-startup-id groff -mom ${XDG_DATA_HOME:$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - bindsym $mod+F2 restart bindsym $mod+F3 exec --no-startup-id displayselect bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 3b4cc14f..a201b68a 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -2,7 +2,7 @@ # Basic vars set shell sh -set previewer $XDG_CONFIG_HOME/lf/scope +set previewer ${XDG_CONFIG_HOME:$HOME/.config}/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 @@ -36,7 +36,7 @@ cmd delete ${{ cmd moveto ${{ set -f clear; echo "Move to where?" - dest="$(cut -d' ' -f2- $XDG_CONFIG_HOME/directories | fzf)" && + dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" && eval mv -iv $fx $dest && notify-send "🚚 File(s) moved." "File(s) moved to $dest." }} @@ -44,7 +44,7 @@ cmd moveto ${{ cmd copyto ${{ set -f clear; echo "Copy to where?" - dest="$(cut -d' ' -f2- $XDG_CONFIG_HOME/directories | fzf)" && + dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" && eval cp -ivr $fx $dest && notify-send "📋 File(s) copied." "File(s) copies to $dest." }} @@ -54,9 +54,9 @@ cmd bulkrename ${{ }} # Bindings -map c $lf -remote "send $id cd $(cut -d' ' -f2 $XDG_CONFIG_HOME/directories | fzf)" +map c $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(cut -d' ' -f2 $XDG_CONFIG_HOME/directories | fzf)" +map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" map gh map g top map D delete diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 5c1c093e..30988ccf 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,7 +1,7 @@ [Default Applications] # xdg-open will use these settings to determine how to open filetypes. -# These .desktop entries can also be seen and changed in $XDG_DATA_HOME/applications/ +# These .desktop entries can also be seen and changed in ~/.local/share/applications/ text/x-shellscript=text.desktop; x-scheme-handler/magnet=torrent.desktop; diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index 8a30ca5f..521b9a66 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -1,10 +1,10 @@ -db_file "$XDG_CONFIG_HOME/mpd/database" -log_file "$XDG_CONFIG_HOME/mpd/log" +db_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/database" +log_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/log" music_directory "~/Music" -playlist_directory "$XDG_CONFIG_HOME/mpd/playlists" -pid_file "$XDG_CONFIG_HOME/mpd/pid" -state_file "$XDG_CONFIG_HOME/mpd/state" -sticker_file "$XDG_CONFIG_HOME/mpd/sticker.sql" +playlist_directory "${XDG_CONFIG_HOME:$HOME/.config}/mpd/playlists" +pid_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/pid" +state_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/state" +sticker_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/sticker.sql" auto_update "yes" diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index d2e11326..c9bccedc 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -1,16 +1,11 @@ -############################################################################## -## This is the example configuration file. Copy it to $HOME/.ncmpcpp/config ## -## or $XDG_CONFIG_HOME/ncmpcpp/config and set up your preferences. ## -############################################################################## -# -ncmpcpp_directory = $XDG_CONFIG_HOME/ncmpcpp +ncmpcpp_directory = ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp # ## ## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other ## MPD clients (eg. ncmpc) also use that location. ## # -lyrics_directory = $XDG_DATA_HOME/lyrics +lyrics_directory = ${XDG_DATA_HOME:$HOME/.local/share}/lyrics # ##### connection settings ##### # diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ae94ae1d..d0b2c97f 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,13 +1,13 @@ let mapleader ="," -if ! filereadable(expand('$XDG_CONFIG_HOME/nvim/autoload/plug.vim')) +if ! filereadable(expand('${XDG_CONFIG_HOME:$HOME/.config}/nvim/autoload/plug.vim')) echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p $XDG_CONFIG_HOME/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > $XDG_CONFIG_HOME/nvim/autoload/plug.vim + silent !mkdir -p ${XDG_CONFIG_HOME:$HOME/.config}/nvim/autoload/ + silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:$HOME/.config}/nvim/autoload/plug.vim autocmd VimEnter * PlugInstall endif -call plug#begin('$XDG_CONFIG_HOME/nvim/plugged') +call plug#begin('${XDG_CONFIG_HOME:$HOME/.config}/nvim/plugged') Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree' Plug 'junegunn/goyo.vim' diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py index 5b1acd2d..c1c74193 100755 --- a/.config/ranger/commands.py +++ b/.config/ranger/commands.py @@ -38,7 +38,7 @@ class my_edit(Command): # reference to the currently selected file. target_filename = self.fm.thisfile.path - # This is a generic function to print text in ranger. + # This is a generic function to print text in ranger. self.fm.notify("Let's edit the file " + target_filename + "!") # Using bad=True in fm.notify allows you to print error messages: @@ -60,7 +60,7 @@ class my_edit(Command): # https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf -# Now, simply bind this function to a key, by adding this to your $XDG_CONFIG_HOME/ranger/rc.conf: map fzf_select +# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf: map fzf_select class fzf_select(Command): """ :fzf_select diff --git a/.config/ranger/luke_ranger_readme.md b/.config/ranger/luke_ranger_readme.md index f6ee93fc..45111514 100644 --- a/.config/ranger/luke_ranger_readme.md +++ b/.config/ranger/luke_ranger_readme.md @@ -32,10 +32,10 @@ These "verbs" take "nouns" or "arguments," like these: + d -- "~/Documents" + D -- "~/Downloads" -+ cf -- "$XDG_CONFIG_HOME" ++ cf -- "~/.config" + And many others, including those you add to `~/.bmdirs`. -Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in $XDG_CONFIG_HOME, etc. etc. +Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in ~/.config, etc. etc. ## Many little additions! @@ -60,7 +60,7 @@ Press any "verb" followed by any "argument" to perform a folder operation. "gd" + Txs -- copy slideshow/beamer template to new file + Txh -- copy handout template to new file + Image commands: - + bg -- (for i3 users) makes an image your background (assuming i3 is looking at $XDG_CONFIG_HOME/wall.png for your background) + + bg -- makes an image your background (assuming i3 is looking at ~/.local/share/bg for your background) + bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it. + C -- rotates an image (requires imagemagick) + F -- flips an image (requires imagemagick) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index ff0d5069..c8b5c1ac 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -5,7 +5,7 @@ set column_ratios 1,3,4 set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ set show_hidden false set confirm_on_delete multiple -set preview_script $XDG_CONFIG_HOME/ranger/scope.sh +set preview_script ${XDG_CONFIG_HOME:$HOME/.config}/ranger/scope.sh set use_preview_script true set automatically_count_files true set open_all_images true @@ -505,4 +505,4 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po #Downloading map ytv console shell youtube-dl -ic%space map yta console shell youtube-dl -xic%space -source $XDG_CONFIG_HOME/ranger/shortcuts.conf +source ${XDG_CONFIG_HOME:$HOME/.config}/ranger/shortcuts.conf diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index c07d7809..a43e582b 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -137,10 +137,10 @@ XF86MyComputer # Function keys super + shift + F1 - grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "$XDG_DATA_HOME/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) + grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "${XDG_DATA_HOME:$HOME/.local/share}/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) # Show readme super + F1 - groff -mom $XDG_DATA_HOME/larbs/readme.mom -Tpdf | zathura - + groff -mom ${XDG_DATA_HOME:$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - # F2 restarts either dwm or i3 and is bound in each. # Change display super + F3 diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 279f9f6e..796b0912 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -4,13 +4,13 @@ do case "$1" in "w") setbg "$file" & ;; "c") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" $XDG_CONFIG_HOME/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & ;; "m") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" $XDG_CONFIG_HOME/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index ed77ea83..cba88df2 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -1,5 +1,5 @@ " vim: filetype=vifm -source $XDG_CONFIG_HOME/vifm/vifmshortcuts +source ${XDG_CONFIG_HOME:$HOME/.config}/vifm/vifmshortcuts set vicmd=$EDITOR set syscalls diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 679dc932..18f18822 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -12,8 +12,8 @@ SAVEHIST=10000 HISTFILE=~/.cache/zsh/history # Load aliases and shortcuts if existent. -[ -f "$XDG_CONFIG_HOME/shortcutrc" ] && source "$XDG_CONFIG_HOME/shortcutrc" -[ -f "$XDG_CONFIG_HOME/aliasrc" ] && source "$XDG_CONFIG_HOME/aliasrc" +[ -f "${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" ] && source "${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" +[ -f "${XDG_CONFIG_HOME:$HOME/.config}/aliasrc" ] && source "${XDG_CONFIG_HOME:$HOME/.config}/aliasrc" # Basic auto/tab complete: autoload -U compinit diff --git a/.local/bin/cron/crontog b/.local/bin/cron/crontog index 9889d769..565c5e25 100755 --- a/.local/bin/cron/crontog +++ b/.local/bin/cron/crontog @@ -3,4 +3,4 @@ # Toggles all cronjobs off/on. # Stores disabled crontabs in ~/.consaved until restored. -([ -f $XDG_CONFIG_HOME/cronsaved ] && crontab - < $XDG_CONFIG_HOME/cronsaved && rm $XDG_CONFIG_HOME/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > $XDG_CONFIG_HOME/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") +([ -f ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved ] && crontab - < ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved && rm ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode index df8c7a03..6740be4f 100755 --- a/.local/bin/dmenuunicode +++ b/.local/bin/dmenuunicode @@ -5,7 +5,7 @@ # Must have xclip installed to even show menu. xclip -h 2>/dev/null || exit 1 -chosen=$(cut -d ';' -f1 $XDG_DATA_HOME/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") +chosen=$(cut -d ';' -f1 ${XDG_DATA_HOME:$HOME/.local/share}/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") [ "$chosen" != "" ] || exit diff --git a/.local/bin/getkeys b/.local/bin/getkeys index 0a12d22d..a1113f10 100755 --- a/.local/bin/getkeys +++ b/.local/bin/getkeys @@ -1,5 +1,5 @@ #!/bin/sh -cat $XDG_DATA_HOME/larbs/getkeys/"$1" 2>/dev/null && exit +cat ${XDG_DATA_HOME:$HOME/.local/share}/larbs/getkeys/"$1" 2>/dev/null && exit echo "Run command with one of the following arguments for info about that program:" -ls $XDG_DATA_HOME/larbs/getkeys +ls ${XDG_DATA_HOME:$HOME/.local/share}/larbs/getkeys diff --git a/.local/bin/i3cmds/toggle-welcome b/.local/bin/i3cmds/toggle-welcome index d8cc0eff..1f08eb10 100755 --- a/.local/bin/i3cmds/toggle-welcome +++ b/.local/bin/i3cmds/toggle-welcome @@ -2,7 +2,7 @@ # Toggles the LARBS welcome message. -PIC="$XDG_DATA_HOME/larbs/larbs.png" +PIC="${XDG_DATA_HOME:$HOME/.local/share}/larbs/larbs.png" grep LARBSWELCOME "$HOME/.xprofile" && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || diff --git a/.local/bin/podentr b/.local/bin/podentr index 5bdc0ca3..e2fec469 100755 --- a/.local/bin/podentr +++ b/.local/bin/podentr @@ -4,4 +4,4 @@ [ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit -echo $XDG_DATA_HOME/newsboat/queue | entr -p queueandnotify 2>/dev/null +echo ${XDG_DATA_HOME:$HOME/.local/share}/newsboat/queue | entr -p queueandnotify 2>/dev/null diff --git a/.local/bin/queueandnotify b/.local/bin/queueandnotify index 24746c8b..002c2a34 100755 --- a/.local/bin/queueandnotify +++ b/.local/bin/queueandnotify @@ -3,7 +3,7 @@ # Podboat sucks. This script replaces it. # It reads the newsboat queue, queuing downloads with taskspooler. # It also removes the junk from extentions. -queuefile="$XDG_DATA_HOME/newsboat/queue" +queuefile="${XDG_DATA_HOME:$HOME/.local/share}/newsboat/queue" while read -r line; do [ -z "$line" ] && continue diff --git a/.local/bin/rssadd b/.local/bin/rssadd index 9dcdd7b3..924ee525 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -2,7 +2,7 @@ ! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && notify-send "That doesn't look like a full URL." && exit -RSSFILE="$XDG_CONFIG_HOME/newsboat/urls" +RSSFILE="${XDG_CONFIG_HOME:$HOME/.config}/newsboat/urls" if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then notify-send "You already have this RSS feed." else diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 112d1405..6ef9ce4d 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,11 +1,11 @@ #!/usr/bin/env bash # Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="$XDG_CONFIG_HOME/shortcutrc" -ranger_shortcuts="$XDG_CONFIG_HOME/ranger/shortcuts.conf" +shell_shortcuts="${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" +ranger_shortcuts="${XDG_CONFIG_HOME:$HOME/.config}/ranger/shortcuts.conf" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" -vifm_shortcuts="$XDG_CONFIG_HOME/vifm/vifmshortcuts" +vifm_shortcuts="${XDG_CONFIG_HOME:$HOME/.config}/vifm/vifmshortcuts" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null @@ -14,14 +14,14 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -sed "s/\s*#.*$//;/^\s*$/d" "$XDG_CONFIG_HOME/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:$HOME/.config}/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ >(awk '{print "map g" $1, ":cd", $2 "\nmap t" $1, ":cd", $2 "\nmap M" $1, ":cd", $2 ":mo\nmap Y" $1, ":cd", $2 ":co" }' >> "$vifm_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" # Format the `files` file in the correct syntax and sent it to both configs. -sed "s/\s*#.*$//;/^\s*$/d" "$XDG_CONFIG_HOME/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:$HOME/.config}/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ >(awk '{print "map", $1, ":e", $2 "" }' >> "$vifm_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index f412bcb9..e33cfee7 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -4,7 +4,7 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; - 2) $TERMINAL -e calcurse -D $XDG_CONFIG_HOME/calcurse ;; + 2) $TERMINAL -e calcurse -D ${XDG_CONFIG_HOME:$HOME/.config}/calcurse ;; 3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help index d58f5cca..d05a90c8 100755 --- a/.local/bin/statusbar/help +++ b/.local/bin/statusbar/help @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) groff -mom $XDG_DATA_HOME/larbs/readme.mom -Tpdf | zathura - ;; + 1) groff -mom ${XDG_DATA_HOME:$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;; 2) i3 restart ;; 3) pgrep -x dunst >/dev/null && notify-send "❓ Help module" "\- Left click to open LARBS guide. - Middle click to refresh i3.";; diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate index 6d1038cb..2f1b08b6 100755 --- a/.local/bin/statusbar/iplocate +++ b/.local/bin/statusbar/iplocate @@ -6,4 +6,4 @@ # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ ifinstalled "geoiplookup" || exit addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " $XDG_CONFIG_HOME/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" +grep "flag: " ${XDG_CONFIG_HOME:$HOME/.config}/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 72d45111..28deb45b 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -13,7 +13,7 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -unread="$(find $XDG_DATA_HOME/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" +unread="$(find ${XDG_DATA_HOME:$HOME/.local/share}/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" icon="$(cat "/tmp/imapsyncicon_$USER")" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index e72ef570..85fed45d 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in Note: Only one instance of newsboat (including updates) may be running at a time." ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat $XDG_CONFIG_HOME/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ${XDG_CONFIG_HOME:$HOME/.config}/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 63415b4d..8c85857a 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -7,18 +7,18 @@ # 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. getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && -curl -sf "wttr.in/$LOCATION" > "$XDG_DATA_HOME/weatherreport" || exit 1 ;} +curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum # precipication chance and the daily high and low from the downloaded file and # display them with coresponding emojis. -showweather() { printf "%s" "$(sed '16q;d' "$XDG_DATA_HOME/weatherreport" | +showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "$XDG_DATA_HOME/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' "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) $TERMINAL -e less -Srf "$XDG_DATA_HOME/weatherreport" ;; + 1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" ;; 2) getforecast && showweather ;; 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. @@ -29,7 +29,7 @@ esac # The test if our forcecast is updated to the day. If it isn't download a new # weather report from wttr.in with the above function. -[ "$(stat -c %y "$XDG_DATA_HOME/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || +[ "$(stat -c %y "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getforecast showweather diff --git a/.profile b/.profile index fdc94ec0..d067c73c 100644 --- a/.profile +++ b/.profile @@ -3,8 +3,8 @@ # Adds `~/.local/bin` to $PATH export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" -# Get default LARBS WM from $XDG_DATA_HOME/larbs/wm -export LARBSWM="$(cat $XDG_DATA_HOME/larbs/wm 2>/dev/null)" && +# Get default LARBS WM from ${XDG_DATA_HOME:$HOME/.local/share}/larbs/wm +export LARBSWM="$(cat ${XDG_DATA_HOME:$HOME/.local/share}/larbs/wm 2>/dev/null)" && [ "$LARBSWM" = "dwm" ] || export LARBSWM="i3" # Default programs: @@ -19,16 +19,16 @@ eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" # ~/ Clean-up: #export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. -export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config" -export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" +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" export LESSHISTFILE="-" -export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" -export INPUTRC="$XDG_CONFIG_HOME/inputrc" -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" -export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" +export WGETRC="${XDG_CONFIG_HOME:$HOME/.config}/wget/wgetrc" +export INPUTRC="${XDG_CONFIG_HOME:$HOME/.config}/inputrc" +export ZDOTDIR="${XDG_CONFIG_HOME:$HOME/.config}/zsh" +export PASSWORD_STORE_DIR="${XDG_DATA_HOME:$HOME/.local/share}/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" -export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" -export CARGO_HOME="$XDG_DATA_HOME/cargo" +export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:$HOME/.config}/android" +export CARGO_HOME="${XDG_DATA_HOME:$HOME/.local/share}/cargo" # Other program settings: export DICS="/usr/share/stardict/dic/" @@ -43,10 +43,10 @@ export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" -[ ! -f $XDG_CONFIG_HOME/shortcutrc ] && shortcuts >/dev/null 2>&1 +[ ! -f ${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 # Start graphical server on tty1 if not already running. [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx # Switch escape and caps if tty and no passwd required: -sudo -n loadkeys $XDG_DATA_HOME/larbs/ttymaps.kmap 2>/dev/null +sudo -n loadkeys ${XDG_DATA_HOME:$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null diff --git a/.xprofile b/.xprofile index 853aa584..2f812e58 100644 --- a/.xprofile +++ b/.xprofile @@ -10,7 +10,7 @@ dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XA 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/Xresources & # Uncomment to use Xresources colors/settings on startup +#xrdb ${XDG_CONFIG_HOME:$HOME/.config}/Xresources & # Uncomment to use Xresources colors/settings on startup xcompmgr & # xcompmgr for transparency $STATUSBAR & # start the statusbar dunst & # dunst for notifications From 7f334ff4b902e7cfbc8cb824e59510b752e7a754 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 19:06:11 -0400 Subject: [PATCH 036/142] oops, sed error --- .config/aliasrc | 2 +- .config/i3/config | 2 +- .config/ncmpcpp/config | 2 +- .config/sxhkd/sxhkdrc | 4 ++-- .local/bin/dmenuunicode | 2 +- .local/bin/getkeys | 4 ++-- .local/bin/i3cmds/toggle-welcome | 2 +- .local/bin/podentr | 2 +- .local/bin/queueandnotify | 2 +- .local/bin/statusbar/help | 2 +- .local/bin/statusbar/mailbox | 2 +- .local/bin/statusbar/weather | 10 +++++----- .profile | 10 +++++----- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index 57b6f631..c30f25ea 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -43,4 +43,4 @@ alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" \ - weath="less -S ${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" \ + weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ diff --git a/.config/i3/config b/.config/i3/config index 36c8aba1..ef8077f2 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -222,7 +222,7 @@ for_window [title="mpvfloat"] border pixel 0 no_focus [title="mpvfloat"] # #---Function Buttons---# # -bindsym $mod+F1 exec --no-startup-id groff -mom ${XDG_DATA_HOME:$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - +bindsym $mod+F1 exec --no-startup-id groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - bindsym $mod+F2 restart bindsym $mod+F3 exec --no-startup-id displayselect bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index c9bccedc..1e9f466d 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -5,7 +5,7 @@ ncmpcpp_directory = ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp ## MPD clients (eg. ncmpc) also use that location. ## # -lyrics_directory = ${XDG_DATA_HOME:$HOME/.local/share}/lyrics +lyrics_directory = ${XDG_DATA_HOME:-$HOME/.local/share}/lyrics # ##### connection settings ##### # diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index a43e582b..ffef0b44 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -137,10 +137,10 @@ XF86MyComputer # Function keys super + shift + F1 - grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "${XDG_DATA_HOME:$HOME/.local/share}/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) + grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) # Show readme super + F1 - groff -mom ${XDG_DATA_HOME:$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - + groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - # F2 restarts either dwm or i3 and is bound in each. # Change display super + F3 diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode index 6740be4f..15799a36 100755 --- a/.local/bin/dmenuunicode +++ b/.local/bin/dmenuunicode @@ -5,7 +5,7 @@ # Must have xclip installed to even show menu. xclip -h 2>/dev/null || exit 1 -chosen=$(cut -d ';' -f1 ${XDG_DATA_HOME:$HOME/.local/share}/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") +chosen=$(cut -d ';' -f1 ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") [ "$chosen" != "" ] || exit diff --git a/.local/bin/getkeys b/.local/bin/getkeys index a1113f10..0a0e86e1 100755 --- a/.local/bin/getkeys +++ b/.local/bin/getkeys @@ -1,5 +1,5 @@ #!/bin/sh -cat ${XDG_DATA_HOME:$HOME/.local/share}/larbs/getkeys/"$1" 2>/dev/null && exit +cat ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/getkeys/"$1" 2>/dev/null && exit echo "Run command with one of the following arguments for info about that program:" -ls ${XDG_DATA_HOME:$HOME/.local/share}/larbs/getkeys +ls ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/getkeys diff --git a/.local/bin/i3cmds/toggle-welcome b/.local/bin/i3cmds/toggle-welcome index 1f08eb10..517c301d 100755 --- a/.local/bin/i3cmds/toggle-welcome +++ b/.local/bin/i3cmds/toggle-welcome @@ -2,7 +2,7 @@ # Toggles the LARBS welcome message. -PIC="${XDG_DATA_HOME:$HOME/.local/share}/larbs/larbs.png" +PIC="${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png" grep LARBSWELCOME "$HOME/.xprofile" && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || diff --git a/.local/bin/podentr b/.local/bin/podentr index e2fec469..9a8313ab 100755 --- a/.local/bin/podentr +++ b/.local/bin/podentr @@ -4,4 +4,4 @@ [ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit -echo ${XDG_DATA_HOME:$HOME/.local/share}/newsboat/queue | entr -p queueandnotify 2>/dev/null +echo ${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue | entr -p queueandnotify 2>/dev/null diff --git a/.local/bin/queueandnotify b/.local/bin/queueandnotify index 002c2a34..a54b13e9 100755 --- a/.local/bin/queueandnotify +++ b/.local/bin/queueandnotify @@ -3,7 +3,7 @@ # Podboat sucks. This script replaces it. # It reads the newsboat queue, queuing downloads with taskspooler. # It also removes the junk from extentions. -queuefile="${XDG_DATA_HOME:$HOME/.local/share}/newsboat/queue" +queuefile="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue" while read -r line; do [ -z "$line" ] && continue diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help index d05a90c8..c1f1caa0 100755 --- a/.local/bin/statusbar/help +++ b/.local/bin/statusbar/help @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) groff -mom ${XDG_DATA_HOME:$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;; + 1) groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;; 2) i3 restart ;; 3) pgrep -x dunst >/dev/null && notify-send "❓ Help module" "\- Left click to open LARBS guide. - Middle click to refresh i3.";; diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 28deb45b..49630adf 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -13,7 +13,7 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -unread="$(find ${XDG_DATA_HOME:$HOME/.local/share}/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" +unread="$(find ${XDG_DATA_HOME:-$HOME/.local/share}/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" icon="$(cat "/tmp/imapsyncicon_$USER")" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 8c85857a..59198a0b 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -7,18 +7,18 @@ # 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. getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && -curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" || exit 1 ;} +curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum # precipication chance and the daily high and low from the downloaded file and # display them with coresponding emojis. -showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" | +showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" ;; + 1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" ;; 2) getforecast && showweather ;; 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. @@ -29,7 +29,7 @@ esac # The test if our forcecast is updated to the day. If it isn't download a new # weather report from wttr.in with the above function. -[ "$(stat -c %y "${XDG_DATA_HOME:$HOME/.local/share}/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || +[ "$(stat -c %y "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getforecast showweather diff --git a/.profile b/.profile index d067c73c..39ff1d4a 100644 --- a/.profile +++ b/.profile @@ -3,8 +3,8 @@ # Adds `~/.local/bin` to $PATH export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" -# Get default LARBS WM from ${XDG_DATA_HOME:$HOME/.local/share}/larbs/wm -export LARBSWM="$(cat ${XDG_DATA_HOME:$HOME/.local/share}/larbs/wm 2>/dev/null)" && +# Get default LARBS WM from ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/wm +export LARBSWM="$(cat ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/wm 2>/dev/null)" && [ "$LARBSWM" = "dwm" ] || export LARBSWM="i3" # Default programs: @@ -25,10 +25,10 @@ export LESSHISTFILE="-" export WGETRC="${XDG_CONFIG_HOME:$HOME/.config}/wget/wgetrc" export INPUTRC="${XDG_CONFIG_HOME:$HOME/.config}/inputrc" export ZDOTDIR="${XDG_CONFIG_HOME:$HOME/.config}/zsh" -export PASSWORD_STORE_DIR="${XDG_DATA_HOME:$HOME/.local/share}/password-store" +export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:$HOME/.config}/android" -export CARGO_HOME="${XDG_DATA_HOME:$HOME/.local/share}/cargo" +export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" # Other program settings: export DICS="/usr/share/stardict/dic/" @@ -49,4 +49,4 @@ export LESS_TERMCAP_ue="$(printf '%b' '')" [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx # Switch escape and caps if tty and no passwd required: -sudo -n loadkeys ${XDG_DATA_HOME:$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null +sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null From 9fe6802122f6e0392c7fe20eefd30437771d7f8e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 19:10:00 -0400 Subject: [PATCH 037/142] oops for config --- .config/aliasrc | 2 +- .config/directories | 2 +- .config/files | 28 ++++++++++++++-------------- .config/lf/lfrc | 10 +++++----- .config/mpd/mpd.conf | 12 ++++++------ .config/ncmpcpp/config | 2 +- .config/nvim/init.vim | 8 ++++---- .config/ranger/rc.conf | 4 ++-- .config/sxiv/exec/key-handler | 4 ++-- .config/vifm/vifmrc | 2 +- .config/zsh/.zshrc | 4 ++-- .local/bin/cron/crontog | 2 +- .local/bin/rssadd | 2 +- .local/bin/shortcuts | 10 +++++----- .local/bin/statusbar/clock | 2 +- .local/bin/statusbar/iplocate | 2 +- .local/bin/statusbar/news | 2 +- .profile | 14 +++++++------- .xprofile | 2 +- 19 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index c30f25ea..1dacf8a4 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -42,5 +42,5 @@ alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" # Some other stuff alias \ magit="nvim -c MagitOnly" \ - ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" \ + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ diff --git a/.config/directories b/.config/directories index 957590ee..707a1c72 100644 --- a/.config/directories +++ b/.config/directories @@ -5,6 +5,6 @@ D ~/Downloads m ~/Music pp ~/Pictures vv ~/Videos -cf ${XDG_CONFIG_HOME:$HOME/.config} +cf ${XDG_CONFIG_HOME:-$HOME/.config} sc ~/.local/bin mn /mnt diff --git a/.config/files b/.config/files index 05da40c1..6e074998 100644 --- a/.config/files +++ b/.config/files @@ -1,15 +1,15 @@ -bf ${XDG_CONFIG_HOME:$HOME/.config}/files -bd ${XDG_CONFIG_HOME:$HOME/.config}/directories -bw ${XDG_CONFIG_HOME:$HOME/.config}/bookmarks -cfa ${XDG_CONFIG_HOME:$HOME/.config}/aliasrc +bf ${XDG_CONFIG_HOME:-$HOME/.config}/files +bd ${XDG_CONFIG_HOME:-$HOME/.config}/directories +bw ${XDG_CONFIG_HOME:-$HOME/.config}/bookmarks +cfa ${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc cfz $ZDOTDIR/.zshrc -cfv ${XDG_CONFIG_HOME:$HOME/.config}/nvim/init.vim -cfm ${XDG_CONFIG_HOME:$HOME/.config}/mutt/muttrc -cfx ${XDG_CONFIG_HOME:$HOME/.config}/Xresources -cfu ${XDG_CONFIG_HOME:$HOME/.config}/newsboat/urls -cfn ${XDG_CONFIG_HOME:$HOME/.config}/newsboat/config -cfmb ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp/bindings -cfmc ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp/config -cfk ${XDG_CONFIG_HOME:$HOME/.config}/sxhkd/sxhkdrc -cfi ${XDG_CONFIG_HOME:$HOME/.config}/i3/config -cfb ${XDG_CONFIG_HOME:$HOME/.config}/i3blocks/config +cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim +cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc +cfx ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources +cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls +cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config +cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings +cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config +cfk ${XDG_CONFIG_HOME:-$HOME/.config}/sxhkd/sxhkdrc +cfi ${XDG_CONFIG_HOME:-$HOME/.config}/i3/config +cfb ${XDG_CONFIG_HOME:-$HOME/.config}/i3blocks/config diff --git a/.config/lf/lfrc b/.config/lf/lfrc index a201b68a..29258084 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -2,7 +2,7 @@ # Basic vars set shell sh -set previewer ${XDG_CONFIG_HOME:$HOME/.config}/lf/scope +set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 @@ -36,7 +36,7 @@ cmd delete ${{ cmd moveto ${{ set -f clear; echo "Move to where?" - dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" && + dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" && eval mv -iv $fx $dest && notify-send "🚚 File(s) moved." "File(s) moved to $dest." }} @@ -44,7 +44,7 @@ cmd moveto ${{ cmd copyto ${{ set -f clear; echo "Copy to where?" - dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" && + dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" && eval cp -ivr $fx $dest && notify-send "📋 File(s) copied." "File(s) copies to $dest." }} @@ -54,9 +54,9 @@ cmd bulkrename ${{ }} # Bindings -map c $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" +map c $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:$HOME/.config}/directories | fzf)" +map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" map gh map g top map D delete diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index 521b9a66..ee7ed170 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -1,10 +1,10 @@ -db_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/database" -log_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/log" +db_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/database" +log_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/log" music_directory "~/Music" -playlist_directory "${XDG_CONFIG_HOME:$HOME/.config}/mpd/playlists" -pid_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/pid" -state_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/state" -sticker_file "${XDG_CONFIG_HOME:$HOME/.config}/mpd/sticker.sql" +playlist_directory "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/playlists" +pid_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/pid" +state_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/state" +sticker_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/sticker.sql" auto_update "yes" diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 1e9f466d..6f321b09 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -1,4 +1,4 @@ -ncmpcpp_directory = ${XDG_CONFIG_HOME:$HOME/.config}/ncmpcpp +ncmpcpp_directory = ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp # ## ## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d0b2c97f..d8b0ba20 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,13 +1,13 @@ let mapleader ="," -if ! filereadable(expand('${XDG_CONFIG_HOME:$HOME/.config}/nvim/autoload/plug.vim')) +if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ${XDG_CONFIG_HOME:$HOME/.config}/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:$HOME/.config}/nvim/autoload/plug.vim + silent !mkdir -p ~/.config/nvim/autoload/ + silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim autocmd VimEnter * PlugInstall endif -call plug#begin('${XDG_CONFIG_HOME:$HOME/.config}/nvim/plugged') +call plug#begin('~/.config/nvim/plugged') Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree' Plug 'junegunn/goyo.vim' diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index c8b5c1ac..ba5ec84f 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -5,7 +5,7 @@ set column_ratios 1,3,4 set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ set show_hidden false set confirm_on_delete multiple -set preview_script ${XDG_CONFIG_HOME:$HOME/.config}/ranger/scope.sh +set preview_script ${XDG_CONFIG_HOME:-$HOME/.config}/ranger/scope.sh set use_preview_script true set automatically_count_files true set open_all_images true @@ -505,4 +505,4 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po #Downloading map ytv console shell youtube-dl -ic%space map yta console shell youtube-dl -xic%space -source ${XDG_CONFIG_HOME:$HOME/.config}/ranger/shortcuts.conf +source ${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 796b0912..dc68313d 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -4,13 +4,13 @@ do case "$1" in "w") setbg "$file" & ;; "c") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & ;; "m") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index cba88df2..56e5fca3 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -1,5 +1,5 @@ " vim: filetype=vifm -source ${XDG_CONFIG_HOME:$HOME/.config}/vifm/vifmshortcuts +source ${XDG_CONFIG_HOME:-$HOME/.config}/vifm/vifmshortcuts set vicmd=$EDITOR set syscalls diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 18f18822..91c5613d 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -12,8 +12,8 @@ SAVEHIST=10000 HISTFILE=~/.cache/zsh/history # Load aliases and shortcuts if existent. -[ -f "${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" ] && source "${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" -[ -f "${XDG_CONFIG_HOME:$HOME/.config}/aliasrc" ] && source "${XDG_CONFIG_HOME:$HOME/.config}/aliasrc" +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc" # Basic auto/tab complete: autoload -U compinit diff --git a/.local/bin/cron/crontog b/.local/bin/cron/crontog index 565c5e25..8168012e 100755 --- a/.local/bin/cron/crontog +++ b/.local/bin/cron/crontog @@ -3,4 +3,4 @@ # Toggles all cronjobs off/on. # Stores disabled crontabs in ~/.consaved until restored. -([ -f ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved ] && crontab - < ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved && rm ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ${XDG_CONFIG_HOME:$HOME/.config}/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") +([ -f ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved ] && crontab - < ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && rm ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") diff --git a/.local/bin/rssadd b/.local/bin/rssadd index 924ee525..2ce421bd 100755 --- a/.local/bin/rssadd +++ b/.local/bin/rssadd @@ -2,7 +2,7 @@ ! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && notify-send "That doesn't look like a full URL." && exit -RSSFILE="${XDG_CONFIG_HOME:$HOME/.config}/newsboat/urls" +RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls" if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then notify-send "You already have this RSS feed." else diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 6ef9ce4d..e99ac43a 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -1,11 +1,11 @@ #!/usr/bin/env bash # Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc" -ranger_shortcuts="${XDG_CONFIG_HOME:$HOME/.config}/ranger/shortcuts.conf" +shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" +ranger_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" -vifm_shortcuts="${XDG_CONFIG_HOME:$HOME/.config}/vifm/vifmshortcuts" +vifm_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/vifm/vifmshortcuts" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null @@ -14,14 +14,14 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. -sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:$HOME/.config}/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ >(awk '{print "map g" $1, ":cd", $2 "\nmap t" $1, ":cd", $2 "\nmap M" $1, ":cd", $2 ":mo\nmap Y" $1, ":cd", $2 ":co" }' >> "$vifm_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" # Format the `files` file in the correct syntax and sent it to both configs. -sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:$HOME/.config}/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:-$HOME/.config}/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ >(awk '{print "map", $1, ":e", $2 "" }' >> "$vifm_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index e33cfee7..23e881ef 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -4,7 +4,7 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; - 2) $TERMINAL -e calcurse -D ${XDG_CONFIG_HOME:$HOME/.config}/calcurse ;; + 2) $TERMINAL -e calcurse -D ${XDG_CONFIG_HOME:-$HOME/.config}/calcurse ;; 3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate index 2f1b08b6..1dddb7c2 100755 --- a/.local/bin/statusbar/iplocate +++ b/.local/bin/statusbar/iplocate @@ -6,4 +6,4 @@ # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ ifinstalled "geoiplookup" || exit addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " ${XDG_CONFIG_HOME:$HOME/.config}/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" +grep "flag: " ${XDG_CONFIG_HOME:-$HOME/.config}/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 85fed45d..28b2940e 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in Note: Only one instance of newsboat (including updates) may be running at a time." ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ${XDG_CONFIG_HOME:$HOME/.config}/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" diff --git a/.profile b/.profile index 39ff1d4a..0a5d5aec 100644 --- a/.profile +++ b/.profile @@ -19,15 +19,15 @@ eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" # ~/ Clean-up: #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" +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" export LESSHISTFILE="-" -export WGETRC="${XDG_CONFIG_HOME:$HOME/.config}/wget/wgetrc" -export INPUTRC="${XDG_CONFIG_HOME:$HOME/.config}/inputrc" -export ZDOTDIR="${XDG_CONFIG_HOME:$HOME/.config}/zsh" +export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" +export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" +export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" -export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:$HOME/.config}/android" +export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" # Other program settings: @@ -43,7 +43,7 @@ export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" -[ ! -f ${XDG_CONFIG_HOME:$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 +[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 # Start graphical server on tty1 if not already running. [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx diff --git a/.xprofile b/.xprofile index 2f812e58..c84fab6a 100644 --- a/.xprofile +++ b/.xprofile @@ -10,7 +10,7 @@ dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XA 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}/Xresources & # Uncomment to use Xresources colors/settings on startup +#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources & # Uncomment to use Xresources colors/settings on startup xcompmgr & # xcompmgr for transparency $STATUSBAR & # start the statusbar dunst & # dunst for notifications From 11eac2294fa090cfbd891c538e6ce34fac8da88e Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Wed, 8 Apr 2020 17:15:21 -0700 Subject: [PATCH 038/142] fix: Use default if $XDG_CONFIG_HOME is not set (#546) --- .config/nvim/init.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d8b0ba20..1e4d23c6 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,13 +1,13 @@ let mapleader ="," -if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) +if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ~/.config/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim + silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/ + silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim autocmd VimEnter * PlugInstall endif -call plug#begin('~/.config/nvim/plugged') +call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree' Plug 'junegunn/goyo.vim' From a08904d88a5dc413258c590ad794871cb3fc88e8 Mon Sep 17 00:00:00 2001 From: Wis Date: Thu, 9 Apr 2020 04:35:03 +0300 Subject: [PATCH 039/142] mpv config: use mpvSockets script to remove mpv wrappers/aliases (#544) * add scripts to mpv's cfg \w mpvSockets as 1st dependency and\or script * remove all usage of --input-ipc-server in all cmds * remove mpv alias that adds --input-ipc-server * fix pauseallmpv: correct paths to unix socket files * fix dependency-scripts loading so it works also when opening files off main disk --- .config/aliasrc | 3 --- .config/lf/lfrc | 4 ++-- .config/mpv/scripts/modules.lua | 3 +++ .config/mpv/scripts/mpvSockets | 1 + .config/ranger/rifle.conf | 18 +++++++++--------- .config/vifm/vifmrc | 4 ++-- .gitmodules | 3 +++ .local/bin/dmenuhandler | 4 ++-- .local/bin/linkhandler | 2 +- .local/bin/pauseallmpv | 2 +- 10 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 .config/mpv/scripts/modules.lua create mode 160000 .config/mpv/scripts/mpvSockets create mode 100644 .gitmodules diff --git a/.config/aliasrc b/.config/aliasrc index 2bf58138..64d45afd 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -36,9 +36,6 @@ alias \ xr="sudo xbps-remove -R" \ xq="xbps-query" -# This alias is important. It enables the `pauseallmpv` command. -alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" - # Some other stuff alias \ magit="nvim -c MagitOnly" \ diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 29258084..616c5ab3 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -16,8 +16,8 @@ cmd open ${{ text/*) $EDITOR $fx;; image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;; image/*) rotdir $f | setsid sxiv -aio 2>/dev/null | lf-select & ;; - audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;; - video/*) setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f -quiet >/dev/null 2>&1 & ;; + audio/*) mpv $f ;; + video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;; application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;; *) for f in $fx; do setsid $OPENER $f >/dev/null 2>&1 & done;; esac diff --git a/.config/mpv/scripts/modules.lua b/.config/mpv/scripts/modules.lua new file mode 100644 index 00000000..37b69b30 --- /dev/null +++ b/.config/mpv/scripts/modules.lua @@ -0,0 +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 +load("mpvSockets/mpvSockets.lua") diff --git a/.config/mpv/scripts/mpvSockets b/.config/mpv/scripts/mpvSockets new file mode 160000 index 00000000..8415a08d --- /dev/null +++ b/.config/mpv/scripts/mpvSockets @@ -0,0 +1 @@ +Subproject commit 8415a08d99a46213c918613cfe1e088071018db9 diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index 97410d99..8f661b2a 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -101,7 +101,7 @@ ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1" ext nes, has fceux, X = fceux "$1" ext exe = wine "$1" name ^[mM]akefile$ = make -ext asf, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +ext asf, has mpv, X, flag f = mpv -- "$@" #-------------------------------------------- # Code @@ -118,11 +118,11 @@ ext php = php -- "$1" #------------------------------------------- mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@" mime ^video|audio, has smplayer, X, flag f = smplayer "$@" -mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" -mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-video -- "$@" -mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --fs -- "$@" -mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --loop -- "$@" -mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --title="obs" --autofit=1050x700 -- "$@" +mime ^video, has mpv, X, flag f = mpv -- "$@" +mime ^video, has mpv, X, flag f = mpv --no-video -- "$@" +mime ^video, has mpv, X, flag f = mpv --fs -- "$@" +mime ^video, has mpv, X, flag f = mpv --loop -- "$@" +mime ^video, has mpv, X, flag f = mpv --title="obs" --autofit=1050x700 -- "$@" mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" mime ^video, has mplayer, X, flag f = mplayer -- "$@" @@ -135,16 +135,16 @@ mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@" #------------------------------------------- mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" -mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-audio-display -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@" mime ^audio|ogg$ = tag "$@" -mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv -- "$@" ext midi?, terminal, has wildmidi = wildmidi -- "$@" #-------------------------------------------- # Video without X: #------------------------------------------- -mime ^video, terminal, !X, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +mime ^video, terminal, !X, has mpv = mpv -- "$@" mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" mime ^video, terminal, !X, has mplayer = mplayer -- "$@" diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 56e5fca3..59210cd3 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -54,11 +54,11 @@ fileviewer *.odt odt2txt %c - filetype *.csv,*.xlsx sc-im %c fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw -filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display --input-ipc-server=/tmp/mpvsoc$(date +%%s) %c +filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display %c filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu,*.epub,*.cbz,*.cbr,*.cb7 zathura %f 2>/dev/null &, fileviewer *.pdf pdftotext -l 1 -nopgbrk %c - fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.qt,*.divx,*.as[fx],*mp3,*.flac file -filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx] mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) %f 2>/dev/null &, +filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx] mpv %f 2>/dev/null &, fileview *.tar.gz atool -l --format=tar %f 2>/dev/null | awk '{$1=$2=$3=$4=$5=""; print $0}' fileview *.zip,*.cbz atool -l --format=zip %f 2>/dev/null | tail +4 | awk '{$1=$2=$3=""; print $0}' diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..dd87c9a4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".config/mpv/scripts/mpvSockets"] + path = .config/mpv/scripts/mpvSockets + url = git@github.com:wis/mpvSockets.git diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index c7e27400..8ada2f42 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -6,11 +6,11 @@ case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in "copy url") echo "$1" | xclip -selection clipboard ;; mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; - "mpv (loop)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet --loop "$1" >/dev/null 2>&1 & ;; + "mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;; "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;; feh) setsid feh "$1" >/dev/null 2>&1 & ;; w3m) w3m "$1" >/dev/null 2>&1 ;; - "mpv (float)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; + "mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; esac diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 2c64dcbc..06600115 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -11,7 +11,7 @@ case "$1" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*) - setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;; + setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; *png|*jpg|*jpe|*jpeg|*gif) curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source*) diff --git a/.local/bin/pauseallmpv b/.local/bin/pauseallmpv index 85a7032c..15b9f599 100755 --- a/.local/bin/pauseallmpv +++ b/.local/bin/pauseallmpv @@ -5,6 +5,6 @@ # every single one of them with one command! This is bound to super + shift + p # (with other things) by default and is used in some other places. -for i in $(ls /tmp/mpvsoc*); do +for i in $(ls /tmp/mpvSockets/*); do echo '{ "command": ["set_property", "pause", true] }' | socat - $i; done From 3e8f5c1647e15586b7ec09f9c415b3a50f49e6ac Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 21:36:01 -0400 Subject: [PATCH 040/142] suppress lfcd tmp mesg --- .config/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 97f47eb0..9cd9000b 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -61,7 +61,7 @@ lfcd () { lf -last-dir-path="$tmp" "$@" if [ -f "$tmp" ]; then dir="$(cat "$tmp")" - rm -f "$tmp" + rm -f "$tmp" >/dev/null [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" fi } From 4814403bbf58794da3349f21e55746e50e68eab4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 8 Apr 2020 22:01:51 -0400 Subject: [PATCH 041/142] pgrep junk removed and minor script changes --- .local/bin/setbg | 2 +- .local/bin/statusbar/battery | 2 +- .local/bin/statusbar/clock | 6 +++--- .local/bin/statusbar/help | 2 +- .local/bin/statusbar/internet | 9 ++++++--- .local/bin/statusbar/iplocate | 1 + .local/bin/statusbar/mailbox | 4 ++-- .local/bin/statusbar/moonphase | 4 +++- .local/bin/statusbar/music | 2 +- .local/bin/statusbar/news | 3 +-- .local/bin/statusbar/pacpackages | 2 +- .local/bin/statusbar/statusbarinfo | 21 ++++++++++----------- .local/bin/statusbar/torrent | 2 +- .local/bin/statusbar/volume | 2 +- .local/bin/statusbar/weather | 2 +- 15 files changed, 34 insertions(+), 30 deletions(-) diff --git a/.local/bin/setbg b/.local/bin/setbg index 82693787..b91c87c0 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -4,7 +4,7 @@ # Run by itself, set the wallpaper (at X start). # If given a file, set that as the new wallpaper. # If given a directory, choose random file in it. -# If wal is installed, also generate a colorscheme. +# If wal is installed, also generates a colorscheme. # Location of link to wallpaper link. bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 395ad8d2..65152f77 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -4,7 +4,7 @@ # to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.). case $BLOCK_BUTTON in - 3) pgrep -x dunst >/dev/null && notify-send "🔋 Battery module" "🔋: discharging + 3) notify-send "🔋 Battery module" "🔋: discharging 🛑: not charging ♻: stagnant charge 🔌: charging diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 23e881ef..9799b973 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -3,8 +3,8 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; - 2) $TERMINAL -e calcurse -D ${XDG_CONFIG_HOME:-$HOME/.config}/calcurse ;; - 3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` + 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; + 2) $TERMINAL -e calcurse -D ~/.config/calcurse ;; + 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help index c1f1caa0..70ca383f 100755 --- a/.local/bin/statusbar/help +++ b/.local/bin/statusbar/help @@ -3,6 +3,6 @@ case $BLOCK_BUTTON in 1) groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;; 2) i3 restart ;; - 3) pgrep -x dunst >/dev/null && notify-send "❓ Help module" "\- Left click to open LARBS guide. + 3) notify-send "❓ Help module" "\- Left click to open LARBS guide. - Middle click to refresh i3.";; esac; echo "❓" diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 8063e193..82b10807 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -1,8 +1,11 @@ #!/bin/sh +# Show wifi 📶 and percent strength or 📡 if none. +# Show 🌐 if connected to ethernet or ❎ if none. + case $BLOCK_BUTTON in 1) $TERMINAL -e nmtui ;; - 3) pgrep -x dunst >/dev/null && notify-send "🌐 Internet module" "\- Click to connect + 3) notify-send "🌐 Internet module" "\- Click to connect 📡: no wifi connection 📶: wifi connection with quality ❎: no ethernet @@ -10,7 +13,7 @@ case $BLOCK_BUTTON in " ;; esac -[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" || - wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') +grep "down" /sys/class/net/w*/operstate && wifiicon="📡" || + wifiicon="$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')" printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)" diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate index 1dddb7c2..8dc6290c 100755 --- a/.local/bin/statusbar/iplocate +++ b/.local/bin/statusbar/iplocate @@ -4,6 +4,7 @@ # displays that information in the statusbar # # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ + ifinstalled "geoiplookup" || exit addr="$(curl ifconfig.me 2>/dev/null)" || exit grep "flag: " ${XDG_CONFIG_HOME:-$HOME/.config}/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 49630adf..06b622f0 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -7,7 +7,7 @@ case $BLOCK_BUTTON in 1) "$TERMINAL" -e neomutt ;; 2) setsid mailsync >/dev/null & ;; - 3) pgrep -x dunst >/dev/null && notify-send "📬 Mail module" "\- Shows unread mail + 3) notify-send "📬 Mail module" "\- Shows unread mail - Shows 🔃 if syncing mail - Left click opens neomutt - Middle click syncs mail" ;; @@ -15,6 +15,6 @@ esac unread="$(find ${XDG_DATA_HOME:-$HOME/.local/share}/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" -icon="$(cat "/tmp/imapsyncicon_$USER")" +icon="$(cat "/tmp/imapsyncicon_$USER")" 2>/dev/null [ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index 09af87ba..12ed90bc 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -1,5 +1,7 @@ #!/bin/sh +# Shows the current moon phase. Requires `pom-perl`. + mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' ) case "$mnphs" in @@ -17,7 +19,7 @@ esac case $BLOCK_BUTTON in 1) $mnphs ;; 2) $mnphs ;; - 3) pgrep -x dunst >/dev/null && notify-send " 🌜$(pom)" ;; + 3) notify-send " 🌜$(pom)" ;; esac echo "$icon" "$prcnt"% diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index fadc15e5..1412ae33 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -7,7 +7,7 @@ filter() { case $BLOCK_BUTTON in 1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause 2) mpc toggle | filter ;; # right click, pause/unpause - 3) mpc status | filter && pgrep -x dunst >/dev/null && notify-send "🎵 Music module" "\- Shows mpd song playing. + 3) mpc status | filter && notify-send "🎵 Music module" "\- Shows mpd song playing. - Italic when paused. - Left click opens ncmpcpp. - Middle click pauses. diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 28b2940e..455f64db 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -1,13 +1,12 @@ #!/bin/sh -# i3blocks newsboat module. # Displays number of unread news items and an loading icon if updating. # When clicked, brings up `newsboat`. case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e newsboat ;; 2) setsid newsup >/dev/null & exit ;; - 3) pgrep -x dunst >/dev/null && notify-send "📰 News module" "\- Shows unread news items + 3) notify-send "📰 News module" "\- Shows unread news items - Shows 🔃 if updating with \`newsup\` - Left click opens newsboat - Middle click syncs RSS feeds diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 4273c868..6f439cc0 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -20,7 +20,7 @@ case $BLOCK_BUTTON in 1) $TERMINAL -e popupgrade ;; 2) notify-send "$(/usr/bin/pacman -Qu)" ;; - 3) pgrep -x dunst >/dev/null && notify-send "Upgrade module" "📦: number of upgradable packages + 3) notify-send "Upgrade module" "📦: number of upgradable packages - Left click to upgrade packages - Middle click to show upgradable packages" ;; esac diff --git a/.local/bin/statusbar/statusbarinfo b/.local/bin/statusbar/statusbarinfo index ae799e99..2b3e58cf 100755 --- a/.local/bin/statusbar/statusbarinfo +++ b/.local/bin/statusbar/statusbarinfo @@ -9,25 +9,24 @@ echo " This is a list of the statusbar modules. -📦5 pacpackages: updatable packages (must have pacman -Sy run in root cronjob to check). -📰 41 news: unread RSS entries in newsboat. -☔ 83% ❄️ 69° 🌞 80° weather: ☔ for precipitation, 🌞 and ❄ for daily high and low. -📬 20 mailbox: number of unread mail if mutt-wizard is active. -🔉 62% volume: master sink volume. -🔌83% battery: 🔌 for charging, 🔋 for discharging, ⚡ for full. -📶 80% ❎ internet: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none). +📦5 \033[31mpacpackages\033[0m: updatable packages (must have pacman -Sy run in root cronjob to check). +📰 41 \033[32mnews\033[0m: unread RSS entries in newsboat. +☔ 83% ❄️ 69° 🌞 80° \033[33mweather\033[0m: ☔ for precipitation, 🌞 and ❄ for daily high and low. +📬 20 \033[34mmailbox\033[0m: number of unread mail if mutt-wizard is active. +🔉 62% \033[35mvolume\033[0m: master sink volume. +🔌83% \033[36mbattery\033[0m: 🔌 for charging, 🔋 for discharging, ⚡ for full. +📶 80% ❎ \033[37minternet\033[0m: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none). Obviously the time and date are displayed as well. Optional script modules: -Edit ~/.local/src/dwmblocks/config.h to add these or your own if you'd like (and recompile and restart dwmblocks). +Edit \033[32m~/.local/src/dwmblocks/config.h\033[0m to add these or your own if you'd like (and recompile and restart dwmblocks). 'memory' 🧠 559Mi/3.7Gi Current used memory/total memory. 'cpu' 🌡 +46.0°C CPU temperature. 'disk' 🖥 : 28G/30G Remaining disk space... 'disk ~' 🏠: 641G/850G ...can be given directory argument. -'moonphase' 🌕 39% Phase of the moon (requires \`pom-perl\`). -'iplocate' 🇺🇸 United States Your own or VPN location (requires \`geoiplookup\`). - +'moonphase' 🌕 39% Phase of the moon (requires \033[32m\`pom-perl\`\033[0m). +'iplocate' 🇺🇸 United States Your own or VPN location (requires \033[32m\`geoiplookup\`\033[0m). " | less diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 4b559b89..6f8fc5f6 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -18,7 +18,7 @@ transmission-remote -l | grep % | case $BLOCK_BUTTON in 1) $TERMINAL -e transmission-remote-cli ;; - 3) pgrep -x dunst >/dev/null && notify-send "Torrent module" "🛑: paused + 3) notify-send "Torrent module" "🛑: paused ⏳: idle (seeds needed) 🔼: uploading (unfinished) 🔽: downloading diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index fd59a6f9..cd79de33 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -5,7 +5,7 @@ case $BLOCK_BUTTON in 2) amixer sset Master toggle ;; 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;; 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;; - 3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. + 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. - Middle click to mute. - Scroll to change." esac diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 59198a0b..853d2626 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -20,7 +20,7 @@ sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\( case $BLOCK_BUTTON in 1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" ;; 2) getforecast && showweather ;; - 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. + 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. ☔: Chance of rain/snow ❄: Daily low From a8255f3b478638b91d60ba57c8cf030ad121193a Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Thu, 9 Apr 2020 03:58:27 -0700 Subject: [PATCH 042/142] fix: Use HTTPS instead of SSH (#547) --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index dd87c9a4..4f7c5dd1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule ".config/mpv/scripts/mpvSockets"] path = .config/mpv/scripts/mpvSockets - url = git@github.com:wis/mpvSockets.git + url = https://github.com/wis/mpvSockets.git From 6759e561c81b8e06b9b6351de5ae9dc3ee109852 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 9 Apr 2020 16:56:47 -0400 Subject: [PATCH 043/142] xdg material moved to zprofile --- .config/lf/lfrc | 2 +- .config/user-dirs.dirs | 2 -- .profile | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 616c5ab3..ea8a9ecb 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -2,7 +2,7 @@ # Basic vars set shell sh -set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope +set previewer ~/.config/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index f25c63a2..5a28707c 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -1,3 +1 @@ XDG_DESKTOP_DIR="$HOME/" -XDG_CONFIG_HOME="$HOME/.config" -XDG_DATA_HOME="$HOME/.local/share" diff --git a/.profile b/.profile index 0a5d5aec..7c1f9434 100644 --- a/.profile +++ b/.profile @@ -18,6 +18,8 @@ export STATUSBAR="${LARBSWM}blocks" eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" # ~/ Clean-up: +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" #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" From 475698e57d650456113f0a4b73f3a769ec996749 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 9 Apr 2020 16:56:59 -0400 Subject: [PATCH 044/142] will be replaced --- .config/lf/lfrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index ea8a9ecb..37662685 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -54,7 +54,6 @@ cmd bulkrename ${{ }} # Bindings -map c $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" map $lf -remote "send $id select '$(fzf)'" map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" map gh From 68acbc2bff1bd34cb9390e88c2022ebbcb8349bd Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 9 Apr 2020 17:03:51 -0400 Subject: [PATCH 045/142] volume script uses pulse by default --- .local/bin/statusbar/volume | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index cd79de33..e248952d 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -1,20 +1,30 @@ #!/bin/sh +# Prints the current volume or 🔇 if muted. Uses PulseAudio by default, +# uncomment the ALSA lines if you remove PulseAudio. + case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e alsamixer & ;; - 2) amixer sset Master toggle ;; - 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;; - 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;; + # 1) setsid "$TERMINAL" -e alsamixer & ;; + # 2) amixer sset Master toggle ;; + # 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;; + # 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;; + 1) setsid "$TERMINAL" -e pulsemixer & ;; + 2) pulsemixer --toggle-mute ;; + 4) pulsemixer --change-volume +5 ;; + 5) pulsemixer --change-volume -5 ;; 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. - Middle click to mute. - Scroll to change." esac -volstat="$(amixer get Master)" +volstat="$(pactl list sinks)" +# volstat="$(amixer get Master)" # ALSA only equivalent. -echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit +echo "$volstat" | grep -q "Mute: yes" && printf "🔇\\n" && exit +# echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit # ALSA -vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") +vol="$(echo "$volstat" | grep '^[[:space:]]Volume:' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")" +# vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") # ALSA if [ "$vol" -gt "70" ]; then icon="🔊" From 35de64fb26a682cf99262e56534e26d0d9054b84 Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Thu, 9 Apr 2020 14:15:44 -0700 Subject: [PATCH 046/142] chore: Use $XDG_CONFIG_HOME for tmux (#549) --- .config/aliasrc | 1 + .tmux.conf => .config/tmux/tmux.conf | 0 2 files changed, 1 insertion(+) rename .tmux.conf => .config/tmux/tmux.conf (100%) diff --git a/.config/aliasrc b/.config/aliasrc index 64d45afd..90de3d9c 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -41,3 +41,4 @@ alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ + tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" diff --git a/.tmux.conf b/.config/tmux/tmux.conf similarity index 100% rename from .tmux.conf rename to .config/tmux/tmux.conf From 39776df7c68c3d909b2383df4a3e4f818a1d36de Mon Sep 17 00:00:00 2001 From: vired <62380689+vired@users.noreply.github.com> Date: Fri, 10 Apr 2020 17:34:01 +0600 Subject: [PATCH 047/142] scrooloose/nerdtree has moved to preservim/nerdtree (#553) --- .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 1e4d23c6..5b1605d1 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -9,7 +9,7 @@ endif call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) Plug 'tpope/vim-surround' -Plug 'scrooloose/nerdtree' +Plug 'preservim/nerdtree' Plug 'junegunn/goyo.vim' Plug 'PotatoesMaster/i3-vim-syntax' Plug 'jreybert/vimagit' From 0dad5d69ef07f045e1b3fc9d11dfe22bb11a7dfc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 10 Apr 2020 08:00:42 -0400 Subject: [PATCH 048/142] lf updates including better rename commands --- .config/lf/lfrc | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 37662685..7f12ad74 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,21 +1,23 @@ # Luke's lf settings # Basic vars -set shell sh +set shell bash set previewer ~/.config/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 set color256 -set icons # Enable icons. Requires nerd fonts and LF_ICONS variable. +set icons +set period 1 # cmds/functions cmd open ${{ case $(file --mime-type $f -b) in + image/vnd.djvu|application/pdf|application/octet-stream) setsid zathura $fx >/dev/null 2>&1 & ;; text/troff) man ./ $f;; text/*) $EDITOR $fx;; image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;; - image/*) rotdir $f | setsid sxiv -aio 2>/dev/null | lf-select & ;; + image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\)\(_large\)*$" | setsid sxiv -aio 2>/dev/null | lf-select & ;; audio/*) mpv $f ;; video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;; application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;; @@ -23,9 +25,10 @@ cmd open ${{ esac }} -cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 +cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" cmd delete ${{ + clear; tput cup $(($(tput lines)/3)); tput bold set -f printf "%s\n\t" "$fx" printf "delete?[y/N]" @@ -34,6 +37,7 @@ cmd delete ${{ }} 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}/directories | fzf)" && @@ -42,6 +46,7 @@ cmd moveto ${{ }} 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}/directories | fzf)" && @@ -61,13 +66,21 @@ map g top map D delete map C copyto map M moveto -map a push %mkdir -map r push :rename -map R $lf -remote "send $id push :rename$f" -map b bulkrename +map push :mkdir map reload map shell map x $$f map X !$f -map o &mimeopen "$f" -map O $mimeopen --ask "$f" +map o &mimeopen $f +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 b bulkrename + +map down +map up +map V push :!nvim From 7aabe16b9d623df0405ff71b6e7b73e82fae3cda Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 10 Apr 2020 08:01:53 -0400 Subject: [PATCH 049/142] pulse in i3 --- .config/i3/config | 28 ++++++++++++++-------------- .local/share/larbs/readme.mom | 8 +++----- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index ef8077f2..85e96d81 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -59,7 +59,7 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode ##bindsym $mod+asciitilde #STOP/HIDE EVERYTHING: -bindsym $mod+Shift+Delete exec --no-startup-id lmc mute ; exec --no-startup-id mpc pause && pkill -RTMIN+10 i3blocks ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e lf +bindsym $mod+Shift+Delete exec --no-startup-id pulsemixer --mute ; exec --no-startup-id mpc pause && pkill -RTMIN+10 i3blocks ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e lf # Show selection: bindsym $mod+Insert exec --no-startup-id showclip @@ -97,7 +97,7 @@ bindsym $mod+p exec --no-startup-id mpc toggle bindsym $mod+Shift+p exec --no-startup-id mpc pause bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 -bindsym $mod+Shift+a exec $term -e alsamixer +bindsym $mod+Shift+a exec $term -e pulsemixer bindsym $mod+s gaps inner current plus 5 bindsym $mod+Shift+s gaps inner current minus 5 @@ -150,7 +150,7 @@ bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right bindsym $mod+m exec --no-startup-id $term -e ncmpcpp -bindsym $mod+Shift+m exec --no-startup-id lmc toggle +bindsym $mod+Shift+m exec --no-startup-id pulsemixer --toggle-mute # #---Workspace Bindings---# # bindsym $mod+Home workspace $ws1 @@ -252,10 +252,10 @@ bindsym $mod+Ctrl+Right move workspace to output right # #---Media Keys---# # # Volume keys -bindsym $mod+plus exec --no-startup-id lmc up -bindsym $mod+Shift+plus exec --no-startup-id lmc up 15 -bindsym $mod+minus exec --no-startup-id lmc down -bindsym $mod+Shift+minus exec --no-startup-id lmc down 15 +bindsym $mod+plus exec --no-startup-id pulsemixer --change-volume +5 +bindsym $mod+Shift+plus exec --no-startup-id pulsemixer --change-volume +15 +bindsym $mod+minus exec --no-startup-id pulsemixer --change-volume -5 +bindsym $mod+Shift+minus exec --no-startup-id pulsemixer --change-volume -15 bindsym $mod+less exec --no-startup-id mpc prev bindsym $mod+Shift+less exec --no-startup-id mpc seek 0% bindsym $mod+greater exec --no-startup-id mpc next @@ -276,13 +276,13 @@ bindsym $mod+Delete exec $stoprec bindsym XF86Launch1 exec --no-startup-id xset dpms force off # #---Extra XF86 Keys---# # -bindsym XF86AudioMute exec --no-startup-id lmc toggle -bindsym XF86AudioLowerVolume exec --no-startup-id lmc down -bindsym Shift+XF86AudioLowerVolume exec --no-startup-id lmc down 10 -bindsym Control+XF86AudioLowerVolume exec --no-startup-id lmc down 1 -bindsym XF86AudioRaiseVolume exec --no-startup-id lmc up -bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id lmc up 10 -bindsym Control+XF86AudioRaiseVolume exec --no-startup-id lmc up 1 +bindsym XF86AudioMute exec --no-startup-id pulsemixer --toggle-mute +bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 +bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -10 +bindsym Control+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -1 +bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 +bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +10 +bindsym Control+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +1 bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown" ##bindsym XF86Copy exec ##bindsym XF86Open exec diff --git a/.local/share/larbs/readme.mom b/.local/share/larbs/readme.mom index c46b1a82..fb8feb8b 100644 --- a/.local/share/larbs/readme.mom +++ b/.local/share/larbs/readme.mom @@ -137,7 +137,7 @@ Naturally, you can use \f(CWyay\fP to look for and install any you want to add. .ITEM \f(CWMod+n\fP \(en newsboat (RSS feed reader) .ITEM -\f(CWMod+A\fP \(en alsa (audio system control) +\f(CWMod+A\fP \(en pulsemixer (audio system control) .ITEM \f(CWMod+w\fP \(en Web Browser (Brave) .ITEM @@ -209,7 +209,7 @@ I use ncmpcpp as a music player, which is a front end for mpd. .ITEM \f(CWMod+]\fP \(en Forward 10 seconds (holding shift increases amount) .ITEM -\f(CWMod+A\fP \(en alsamixer (general volume sink/source control) +\f(CWMod+A\fP \(en pulsemixer (general volume sink/source control) .LIST OFF .HEADING 2 "Workspaces" .PP @@ -266,9 +266,7 @@ These settings may override your preferred settings, so you should open this fil .PP On fresh install, the Linux audio system (ALSA) often mutes outputs. You may want to unbind -You may also need to set your preferred default output sink which you can do by the command line, or by selecting one with \f(CWalsamixer\fP (\f(CWmod+A\fP). - -If you have a more complex audio setup and can't be bothered to figure out ALSA, you might want to install and enable PulseAudio, which general "just werks". +You may also need to set your preferred default output sink which you can do by the command line, or by selecting one with \f(CWpulsemixer\fP (\f(CWmod+A\fP). .HEADING 2 "How do I copy and paste?" .PP Copying and pasting is always program-specific on any system. From aca8e7302b7c9ebeb298fdc764cb61be8eb2e2ca Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Fri, 10 Apr 2020 13:39:20 -0700 Subject: [PATCH 050/142] fix: Properly evaluate $XDG_CONFIG_HOME in rc.conf (#555) --- .config/ranger/rc.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index ba5ec84f..efbb3180 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -5,7 +5,6 @@ set column_ratios 1,3,4 set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ set show_hidden false set confirm_on_delete multiple -set preview_script ${XDG_CONFIG_HOME:-$HOME/.config}/ranger/scope.sh set use_preview_script true set automatically_count_files true set open_all_images true @@ -505,4 +504,5 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po #Downloading map ytv console shell youtube-dl -ic%space map yta console shell youtube-dl -xic%space -source ${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf + +eval cmd('source ' + fm.confpath('shortcuts.conf')) From 48375b04e09674b84745fd5c4146e4420dc6fbd5 Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Fri, 10 Apr 2020 13:39:32 -0700 Subject: [PATCH 051/142] chore: Use $XDG_CONFIG_HOME in lfrc (#554) --- .config/lf/lfrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 7f12ad74..e3c72730 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -2,7 +2,6 @@ # Basic vars set shell bash -set previewer ~/.config/lf/scope set shellopts '-eu' set ifs "\n" set scrolloff 10 @@ -10,6 +9,9 @@ set color256 set icons set period 1 +# Vars that depend on environmental variables +$lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope" + # cmds/functions cmd open ${{ case $(file --mime-type $f -b) in From 81f357df530fd144f1f755d2d236d592c2a6ea2d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 10 Apr 2020 22:24:06 -0400 Subject: [PATCH 052/142] other xdg variables --- .profile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.profile b/.profile index 7c1f9434..7d1e6b5c 100644 --- a/.profile +++ b/.profile @@ -27,6 +27,10 @@ export LESSHISTFILE="-" export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" +#export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" +export KODI_DATA="$XDG_DATA_HOME/kodi" export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" From 7ada6550073b9ec011fd8ec9cf571e55b57d1d97 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 10 Apr 2020 22:24:55 -0400 Subject: [PATCH 053/142] actually, that could cause big problems as default --- .profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.profile b/.profile index 7d1e6b5c..7731d2f7 100644 --- a/.profile +++ b/.profile @@ -28,7 +28,7 @@ export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" #export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" -export GNUPGHOME="$XDG_DATA_HOME/gnupg" +#export GNUPGHOME="$XDG_DATA_HOME/gnupg" export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" export KODI_DATA="$XDG_DATA_HOME/kodi" export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" From 6f36fe31693ad7dd47ecb443901039eb5c96969f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 10 Apr 2020 22:53:45 -0400 Subject: [PATCH 054/142] STATUSBAR uncommented only for i3, cleanup, probably broke everything LOL --- .config/sxhkd/sxhkdrc | 14 +++--- .config/xprofile | 17 +++++++ .local/bin/cron/checkup | 2 +- .local/bin/cron/newsup | 4 +- .local/bin/dmenurecord | 16 +++---- .local/bin/mpd-module-update | 3 +- .local/bin/statusbar/popupgrade | 2 +- .local/bin/td-toggle | 2 +- .local/bin/torwrap | 2 +- .local/bin/transadd | 2 +- .profile | 76 ++++++++++++++++++++++++++---- .xinitrc | 22 ++++----- .xprofile | 82 +-------------------------------- 13 files changed, 118 insertions(+), 126 deletions(-) create mode 100755 .config/xprofile mode change 100644 => 120000 .xprofile diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index ffef0b44..1f37d24f 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -15,7 +15,7 @@ super + d super + r $TERMINAL -e $FILE super + e - $TERMINAL -e neomutt; pkill -RTMIN+12 $STATUSBAR + $TERMINAL -e neomutt; pkill -RTMIN+12 blocks super + m $TERMINAL -e ncmpcpp super + n @@ -25,7 +25,7 @@ super + c super + v $TERMINAL -e nvim -c VimwikiIndex super + shift + a - $TERMINAL -e alsamixer; pkill -RTMIN+10 $STATUSBAR + $TERMINAL -e alsamixer; pkill -RTMIN+10 blocks super + shift + c mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --title='mpvfloat' /dev/video0 super + shift + e @@ -93,18 +93,18 @@ super + {_,shift +} bracketleft mpc seek -{10,120} # Increase volume super + {equal,plus} - amixer sset Master {5,15}%+; pkill -RTMIN+10 $STATUSBAR + amixer sset Master {5,15}%+; pkill -RTMIN+10 blocks # Decrease volume super {_,shift +} + minus - amixer sset Master {5,15}%-; pkill -RTMIN+10 $STATUSBAR + amixer sset Master {5,15}%-; pkill -RTMIN+10 blocks super + shift + m - amixer sset Master toggle; pkill -RTMIN+10 $STATUSBAR + amixer sset Master toggle; pkill -RTMIN+10 blocks # Audiokeys XF86AudioMute - amixer sset Master toggle; pkill -RTMIN+10 $STATUSBAR + amixer sset Master toggle; pkill -RTMIN+10 blocks XF86Audio{Raise,Lower}Volume - amixer sset Master 5%{+,-}; pkill -RTMIN+10 $STATUSBAR + amixer sset Master 5%{+,-}; pkill -RTMIN+10 blocks XF86Audio{Next,Prev} mpc {next,prev} XF86Audio{Pause,Play,Stop} diff --git a/.config/xprofile b/.config/xprofile new file mode 100755 index 00000000..861443b8 --- /dev/null +++ b/.config/xprofile @@ -0,0 +1,17 @@ +#!/bin/sh + +# 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. + +# Fix Gnome Apps Slow Start due to failing services +# Add this when you include flatpak in your system +dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY + +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}/Xresources & # Uncomment to use Xresources colors/settings on startup +xcompmgr & # xcompmgr for transparency +dunst & # dunst for notifications +xset r rate 300 50 & # Speed xrate up +unclutter & # Remove mouse when idle diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup index 57bb6d45..34ed61e3 100755 --- a/.local/bin/cron/checkup +++ b/.local/bin/cron/checkup @@ -9,7 +9,7 @@ notify-send "📦 Repository Sync" "Checking for package updates..." sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates. Check your internet connection, if pacman is already running, or run update manually to see errors." -pkill -RTMIN+8 "${STATUSBAR:?}" +pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" if pacman -Qu | grep -v "\[ignored\]" then diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index dd270921..bfdd2f5a 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -10,8 +10,8 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit echo 🔃 > /tmp/newsupdate -pkill -RTMIN+6 "${STATUSBAR:?}" +pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" /usr/bin/newsboat -x reload rm -f /tmp/newsupdate -pkill -RTMIN+6 "${STATUSBAR:?}" +pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" /usr/bin/notify-send "📰 RSS feed update complete." diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index a0339e45..49a2fbf8 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -11,7 +11,7 @@ updateicon() { \ echo "$1" > /tmp/recordingicon - pkill -RTMIN+9 "${STATUSBAR:?}" + pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" } killrecording() { @@ -20,7 +20,7 @@ killrecording() { kill -15 "$recpid" rm -f /tmp/recordingpid updateicon "" - pkill -RTMIN+9 "${STATUSBAR:?}" + pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" # even after SIGTERM, ffmpeg may still run, so SIGKILL it. sleep 3 kill -9 "$recpid" @@ -31,20 +31,20 @@ screencast() { \ ffmpeg -y \ -f x11grab \ -framerate 60 \ - -s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ - -i $DISPLAY \ + -s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \ + -i "$DISPLAY" \ -f alsa -i default \ -r 30 \ - -c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \ - "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" & + -c:v h264 -crf 0 -preset ultrafast -c:a aac \ + "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" & echo $! > /tmp/recordingpid updateicon "⏺️🎙️" } video() { ffmpeg \ -f x11grab \ - -s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ - -i $DISPLAY \ + -s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \ + -i "$DISPLAY" \ -c:v libx264 -qp 0 -r 30 \ "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & echo $! > /tmp/recordingpid diff --git a/.local/bin/mpd-module-update b/.local/bin/mpd-module-update index da8d9fc8..ced910ff 100755 --- a/.local/bin/mpd-module-update +++ b/.local/bin/mpd-module-update @@ -2,6 +2,7 @@ # This loop will update the mpd statusbar module whenever a command changes the # music player's status. mpd must be running on X's start for this to work. + while : ; do - mpc idle >/dev/null && pkill -RTMIN+11 "${STATUSBAR:?}" || break + mpc idle >/dev/null && pkill -RTMIN+11 "${STATUSBAR:-dwmblocks}" || break done diff --git a/.local/bin/statusbar/popupgrade b/.local/bin/statusbar/popupgrade index ba6678c3..3a62727d 100755 --- a/.local/bin/statusbar/popupgrade +++ b/.local/bin/statusbar/popupgrade @@ -3,7 +3,7 @@ printf "Beginning upgrade.\\n" yay -Syu -pkill -RTMIN+8 "${STATUSBAR:?}" +pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" printf "\\nUpgrade complete.\\nPress to exit window.\\n\\n" read -r diff --git a/.local/bin/td-toggle b/.local/bin/td-toggle index dfac906f..46bb1838 100755 --- a/.local/bin/td-toggle +++ b/.local/bin/td-toggle @@ -8,4 +8,4 @@ else ifinstalled transmission-cli || exit [ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started." fi -sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}" +sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" diff --git a/.local/bin/torwrap b/.local/bin/torwrap index 0fbb3a80..2e42c87f 100755 --- a/.local/bin/torwrap +++ b/.local/bin/torwrap @@ -2,6 +2,6 @@ ifinstalled tremc transmission-cli || exit -! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}" +! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" $TERMINAL -e tremc diff --git a/.local/bin/transadd b/.local/bin/transadd index 5d8f510d..97ffafc4 100755 --- a/.local/bin/transadd +++ b/.local/bin/transadd @@ -4,6 +4,6 @@ # transmission-daemon sometimes fails to take remote requests in its first moments. -pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}") +pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") transmission-remote -a "$@" && notify-send "🔽 Torrent added." diff --git a/.profile b/.profile index 7731d2f7..000a5304 100644 --- a/.profile +++ b/.profile @@ -3,19 +3,11 @@ # Adds `~/.local/bin` to $PATH export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" -# Get default LARBS WM from ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/wm -export LARBSWM="$(cat ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/wm 2>/dev/null)" && - [ "$LARBSWM" = "dwm" ] || export LARBSWM="i3" - # Default programs: export EDITOR="nvim" export TERMINAL="st" export BROWSER="brave" export READER="zathura" -export STATUSBAR="${LARBSWM}blocks" - -# Export XDG environmental variables from '~/.config/user-dirs.dirs' -eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" # ~/ Clean-up: export XDG_CONFIG_HOME="$HOME/.config" @@ -48,11 +40,75 @@ export LESS_TERMCAP_so="$(printf '%b' '')" export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" +export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" -[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 +# This is the list for lf icons: +export LF_ICONS="di=📁:\ +fi=📃:\ +tw=🤝:\ +ow=📂:\ +ln=⛓:\ +or=❌:\ +ex=🎯:\ +*.txt=✍:\ +*.mom=✍:\ +*.me=✍:\ +*.ms=✍:\ +*.png=🖼:\ +*.ico=🖼:\ +*.jpg=📸:\ +*.jpeg=📸:\ +*.gif=🖼:\ +*.svg=🗺:\ +*.xcf=🖌:\ +*.html=🌎:\ +*.xml=📰:\ +*.gpg=🔒:\ +*.css=🎨:\ +*.pdf=📚:\ +*.djvu=📚:\ +*.epub=📚:\ +*.csv=📓:\ +*.xlsx=📓:\ +*.tex=📜:\ +*.md=📘:\ +*.r=📊:\ +*.R=📊:\ +*.rmd=📊:\ +*.Rmd=📊:\ +*.mp3=🎵:\ +*.opus=🎵:\ +*.ogg=🎵:\ +*.m4a=🎵:\ +*.flac=🎼:\ +*.mkv=🎥:\ +*.mp4=🎥:\ +*.webm=🎥:\ +*.mpeg=🎥:\ +*.avi=🎥:\ +*.zip=📦:\ +*.rar=📦:\ +*.7z=📦:\ +*.tar.gz=📦:\ +*.z64=🎮:\ +*.v64=🎮:\ +*.n64=🎮:\ +*.1=ℹ:\ +*.nfo=ℹ:\ +*.info=ℹ:\ +*.log=📙:\ +*.iso=📀:\ +*.img=📀:\ +*.bib=🎓:\ +*.ged=👪:\ +*.part=💔:\ +*.torrent=🔽:\ +" + +[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 & # Start graphical server on tty1 if not already running. -[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx +[ "$(tty)" = "/dev/tty1" ] && ! ps -e | grep -qw Xorg && exec startx # Switch escape and caps if tty and no passwd required: sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null diff --git a/.xinitrc b/.xinitrc index c669ad2b..09dbd4ee 100644 --- a/.xinitrc +++ b/.xinitrc @@ -3,20 +3,18 @@ # xinitrc runs automatically when you run startx. # There are some small but important commands that need to be run when we start -# the graphical environment. I keep those commands in ~/.xprofile because that -# file is run automatically if someone uses a display manager (login screen) -# and so they are needed there. To prevent doubling up commands, I source them -# here with the line below. +# the graphical environment. I keep those commands in ~/config/xprofile because +# that file is run automatically if someone uses a display manager (login +# screen) and so they are needed there. To prevent doubling up commands, I +# source them here with the line below. -[ -f ~/.xprofile ] && . ~/.xprofile +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" # Your default LARBS WM is determined in your `~/.profile` on login. Here we # run the proper command to run when the graphical environment starts. -case "$LARBSWM" in - dwm) while :; do - ssh-agent dwm || break - done ;; - i3) exec i3 ;; - *) echo "No valid LARBS window manager detected." ;; -esac +exec dwm + +# To use i3, comment out the line above with dwm and uncomment these two: +# export STATUSBAR="i3blocks" +# exec i3 diff --git a/.xprofile b/.xprofile deleted file mode 100644 index c84fab6a..00000000 --- a/.xprofile +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -# 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. - -# Fix Gnome Apps Slow Start due to failing services -# Add this when you include flatpak in your system -dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY - -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}/Xresources & # Uncomment to use Xresources colors/settings on startup -xcompmgr & # xcompmgr for transparency -$STATUSBAR & # start the statusbar -dunst & # dunst for notifications -xset r rate 300 50 & # Speed xrate up -unclutter & # Remove mouse when idle -mpd-module-update & # Check for when to update the mpd module - -# This is the list for lf icons: -export LF_ICONS="di=📁:\ -fi=📃:\ -tw=🤝:\ -ow=📂:\ -ln=⛓:\ -or=❌:\ -ex=🎯:\ -*.txt=✍:\ -*.mom=✍:\ -*.me=✍:\ -*.ms=✍:\ -*.png=🖼:\ -*.ico=🖼:\ -*.jpg=📸:\ -*.jpeg=📸:\ -*.gif=🖼:\ -*.svg=🗺:\ -*.xcf=🖌:\ -*.html=🌎:\ -*.xml=📰:\ -*.gpg=🔒:\ -*.css=🎨:\ -*.pdf=📚:\ -*.djvu=📚:\ -*.epub=📚:\ -*.csv=📓:\ -*.xlsx=📓:\ -*.tex=📜:\ -*.md=📘:\ -*.r=📊:\ -*.R=📊:\ -*.rmd=📊:\ -*.Rmd=📊:\ -*.mp3=🎵:\ -*.opus=🎵:\ -*.ogg=🎵:\ -*.m4a=🎵:\ -*.flac=🎼:\ -*.mkv=🎥:\ -*.mp4=🎥:\ -*.webm=🎥:\ -*.mpeg=🎥:\ -*.zip=📦:\ -*.rar=📦:\ -*.7z=📦:\ -*.tar.gz=📦:\ -*.z64=🎮:\ -*.v64=🎮:\ -*.n64=🎮:\ -*.1=ℹ:\ -*.nfo=ℹ:\ -*.info=ℹ:\ -*.log=📙:\ -*.iso=📀:\ -*.img=📀:\ -*.bib=🎓:\ -*.ged=👪:\ -*.part=💔:\ -*.torrent=🔽:\ -" diff --git a/.xprofile b/.xprofile new file mode 120000 index 00000000..c0008966 --- /dev/null +++ b/.xprofile @@ -0,0 +1 @@ +.config/xprofile \ No newline at end of file From 67a472f89a2737e11a5e70cbc68f2cb98d5d9b07 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 11 Apr 2020 07:58:58 -0400 Subject: [PATCH 055/142] ncmpcpp reversion and junk removal --- .config/ncmpcpp/config | 516 +---------------------------------------- 1 file changed, 8 insertions(+), 508 deletions(-) diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 6f321b09..36324960 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -1,532 +1,32 @@ -ncmpcpp_directory = ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp -# -## -## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other -## MPD clients (eg. ncmpc) also use that location. -## -# -lyrics_directory = ${XDG_DATA_HOME:-$HOME/.local/share}/lyrics -# -##### connection settings ##### -# -#mpd_host = localhost -# -#mpd_port = 6600 -# -#mpd_connection_timeout = 5 -# -## Needed for tag editor and file operations to work. -## +# vim: filetype=conf + +ncmpcpp_directory = "~/.config/ncmpcpp" +lyrics_directory = "~/.local/share/lyrics" mpd_music_dir = "~/Music" -# -#mpd_crossfade_time = 5 -# -##### music visualizer ##### -## -## Note: In order to make music visualizer work you'll need to use mpd fifo -## output, whose format parameter has to be set to 44100:16:1 for mono -## visualization or 44100:16:2 for stereo visualization. Example configuration -## (it has to be put into mpd.conf): -## -## audio_output { -## type "fifo" -## name "Visualizer feed" -## path "/tmp/mpd.fifo" -## format "44100:16:2" -## } -## -# -#visualizer_fifo_path = /tmp/mpd.fifo -# -## -## Note: Below parameter is needed for ncmpcpp to determine which output -## provides data for visualizer and thus allow syncing between visualization and -## sound as currently there are some problems with it. -## -# -#visualizer_output_name = Visualizer feed -# -## -## If you set format to 44100:16:2, make it 'yes'. -## -#visualizer_in_stereo = yes -# -## -## Note: Below parameter defines how often ncmpcpp has to "synchronize" -## visualizer and audio outputs. 30 seconds is optimal value, but if you -## experience synchronization problems, set it to lower value. Keep in mind -## that sane values start with >=10. -## -# -#visualizer_sync_interval = 30 -# -## -## Note: To enable spectrum frequency visualization you need to compile ncmpcpp -## with fftw3 support. -## -# -## Available values: spectrum, wave, wave_filled, ellipse. -## -visualizer_type = spectrum -# -#visualizer_look = ●卐 -#visualizer_look = 卐 -# -#visualizer_color = blue, cyan, green, yellow, magenta, red -# -## Alternative subset of 256 colors for terminals that support it. -## -#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161 -# -##### system encoding ##### -## -## ncmpcpp should detect your charset encoding but if it failed to do so, you -## can specify charset encoding you are using here. -## -## Note: You can see whether your ncmpcpp build supports charset detection by -## checking output of `ncmpcpp --version`. -## -## Note: Since MPD uses UTF-8 by default, setting this option makes sense only -## if your encoding is different. -## -# -#system_encoding = "" -# -##### delays ##### -# -## Time of inactivity (in seconds) after playlist highlighting will be disabled -## (0 = always on). -## -#playlist_disable_highlight_delay = 5 -# -## Defines how long messages are supposed to be visible. -## -message_delay_time = 1 -# -##### song format ##### -## -## For a song format you can use: -## -## %l - length -## %f - filename -## %D - directory -## %a - artist -## %A - album artist -## %t - title -## %b - album -## %y - date -## %n - track number (01/12 -> 01) -## %N - full track info (01/12 -> 01/12) -## %g - genre -## %c - composer -## %p - performer -## %d - disc -## %C - comment -## %P - priority -## $R - begin right alignment -## -## If you want to make sure that a part of the format is displayed only when -## certain tags are present, you can archieve it by grouping them with brackets, -## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are -## present or '' otherwise. It is also possible to define a list of -## alternatives by providing several groups and separating them with '|', -## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is -## not present. -## -## Note: If you want to set limit on maximal length of a tag, just put the -## appropriate number between % and character that defines tag type, e.g. to -## make album take max. 20 terminal cells, use '%20b'. -## -## In addition, formats support markers used for text attributes. They are -## followed by character '$'. After that you can put: -## -## - 0 - default window color (discards all other colors) -## - 1 - black -## - 2 - red -## - 3 - green -## - 4 - yellow -## - 5 - blue -## - 6 - magenta -## - 7 - cyan -## - 8 - white -## - 9 - end of current color -## - b - bold text -## - u - underline text -## - r - reverse colors -## - a - use alternative character set -## -## If you don't want to use a non-color attribute anymore, just put it again, -## but this time insert character '/' between '$' and attribute character, -## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with -## reversed colors. -## -## If you want to use 256 colors and/or background colors in formats (the naming -## scheme is described below in section about color definitions), it can be done -## with the syntax $(COLOR), e.g. to set the artist tag to one of the -## non-standard colors and make it have yellow background, you need to write -## $(197_yellow)%a$(end). Note that for standard colors this is interchangable -## with attributes listed above. -## -## Note: colors can be nested. -## -# +message_delay_time = "1" +visualizer_type = "spectrum" song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9} -# song_status_format = $b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f} -# song_library_format = {%n - }{%t}|{%f} -# alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b -# alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} -# current_item_prefix = $(cyan)$r$b -# current_item_suffix = $/r$(end)$/b -# current_item_inactive_column_prefix = $(magenta)$r -# current_item_inactive_column_suffix = $/r$(end) -# -#now_playing_prefix = $b -# -#now_playing_suffix = $/b -# -#browser_playlist_prefix = "$2playlist$9 " -# -#selected_item_prefix = $6 -# -#selected_item_suffix = $9 -# -#modified_item_prefix = $3> $9 -# -## -## Note: attributes are not supported for the following variables. -## -#song_window_title_format = {%a - }{%t}|{%f} -## -## Note: Below variables are used for sorting songs in browser. The sort mode -## determines how songs are sorted, and can be used in combination with a sort -## format to specify a custom sorting format. Available values for -## browser_sort_mode are "name", "mtime", "format" and "noop". -## -# -#browser_sort_mode = name -# -#browser_sort_format = {%a - }{%t}|{%f} {(%l)} -# -##### columns settings ##### -## -## syntax of song columns list format is "column column etc." -## -## - syntax for each column is: -## -## (width of the column)[color of the column]{displayed tag} -## -## Note: Width is by default in %, if you want a column to have fixed size, add -## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of -## screen (so the real width will depend on actual screen size), whereas -## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen -## is. -## -## - color is optional (if you want the default one, leave the field empty). -## -## Note: You can give a column additional attributes by putting appropriate -## character after displayed tag character. Available attributes are: -## -## - r - column will be right aligned -## - E - if tag is empty, empty tag marker won't be displayed -## -## You can also: -## -## - give a column custom name by putting it after attributes, separated with -## character ':', e.g. {lr:Length} gives you right aligned column of lengths -## named "Length". -## -## - define sequence of tags, that have to be displayed in case predecessor is -## empty in a way similar to the one in classic song format, i.e. using '|' -## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to -## display artist tag and then composer and performer if previous ones are not -## available. -## -# -#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l} -# -##### various settings ##### -# -## -## Note: Custom command that will be executed each time song changes. Useful for -## notifications etc. -## -#execute_on_song_change = "" -# -## -## Note: Custom command that will be executed each time player state -## changes. The environment variable MPD_PLAYER_STATE is set to the current -## state (either unknown, play, pause, or stop) for its duration. -## -# -#execute_on_player_state_change = "" -# -#playlist_show_mpd_host = no -# -#playlist_show_remaining_time = no -# -#playlist_shorten_total_times = no -# -#playlist_separate_albums = no -# -## -## Note: Possible display modes: classic, columns. -## playlist_display_mode = columns -# browser_display_mode = columns -# -#search_engine_display_mode = classic -# -#playlist_editor_display_mode = classic -# -#discard_colors_if_item_is_selected = yes -# -#show_duplicate_tags = true -# -#incremental_seeking = yes -# -#seek_time = 1 -# -#volume_change_step = 2 -# -#autocenter_mode = no -# -#centered_cursor = no -# -## -## Note: You can specify third character which will be used to build 'empty' -## part of progressbar. -## progressbar_look = -> -# -## Available values: database, playlist. -## -#default_place_to_search_in = database -# -## Available values: classic, alternative. -## -#user_interface = classic -# -#data_fetching_delay = yes -# -## Available values: artist, album_artist, date, genre, composer, performer. -## media_library_primary_tag = album_artist -# media_library_albums_split_by_date = no -# -## Available values: wrapped, normal. -## -#default_find_mode = wrapped -# -#default_tag_editor_pattern = %n - %t -# -#header_visibility = yes -# -#statusbar_visibility = yes -# -#titles_visibility = yes -# -#header_text_scrolling = yes -# -#cyclic_scrolling = no -# -#lines_scrolled = 2 -# -#lyrics_fetchers = lyricwiki, azlyrics, genius, sing365, lyricsmania, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, internet -# -#follow_now_playing_lyrics = no -# -#fetch_lyrics_for_current_song_in_background = no -# -#store_lyrics_in_song_dir = no -# -#generate_win32_compatible_filenames = yes -# -#allow_for_physical_item_deletion = no -# -## -## Note: If you set this variable, ncmpcpp will try to get info from last.fm in -## language you set and if it fails, it will fall back to english. Otherwise it -## will use english the first time. -## -## Note: Language has to be expressed as an ISO 639 alpha-2 code. -## -#lastfm_preferred_language = en -# -#space_add_mode = add_remove -# -#show_hidden_files_in_local_browser = no -# -## -## How shall screen switcher work? -## -## - "previous" - switch between the current and previous screen. -## - "screen1,...,screenN" - switch between given sequence of screens. -## -## Screens available for use: help, playlist, browser, search_engine, -## media_library, playlist_editor, tag_editor, outputs, visualizer, clock, -## lyrics, last_fm. -## -#screen_switcher_mode = playlist, browser -# -## -## Note: You can define startup screen by choosing screen from the list above. -## -startup_screen = media_library -# -## -## Note: You can define startup slave screen by choosing screen from the list -## above or an empty value for no slave screen. -## -#startup_slave_screen = "" -# -#startup_slave_screen_focus = no -# -## -## Default width of locked screen (in %). Acceptable values are from 20 to 80. -## -# -#locked_screen_width_part = 50 -# -#ask_for_locked_screen_width_part = yes -# -#jump_to_now_playing_song_at_start = yes -# -#ask_before_clearing_playlists = yes -# -#clock_display_seconds = no -# +startup_screen = "media_library" display_volume_level = no -# -#display_bitrate = no -# -#display_remaining_time = no -# -## Available values: none, basic, extended, perl. -## -#regular_expressions = perl -# -## -## Note: if below is enabled, ncmpcpp will ignore leading "The" word while -## sorting items in browser, tags in media library, etc. -## ignore_leading_the = yes -# -## -## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and -## filtering lists. This takes an effect only if boost was compiled with ICU -## support. -## -#ignore_diacritics = no -# -#block_search_constraints_change_if_items_found = yes -# -#mouse_support = yes -# -#mouse_list_scroll_whole_page = yes -# -#empty_tag_marker = -# -#tags_separator = " | " -# -#tag_editor_extended_numeration = no -# -#media_library_sort_by_mtime = no -# -#enable_window_title = yes -# -## -## Note: You can choose default search mode for search engine. Available modes -## are: -## -## - 1 - use mpd built-in searching (no regexes, pattern matching) -## -## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but -## if your mpd is on a remote machine, downloading big database to process -## it can take a while -## -## - 3 - match only exact values (this mode uses mpd function for searching in -## database and local one for searching in current playlist) -## -# -#search_engine_default_search_mode = 1 -# -external_editor = vim -# -## Note: set to yes if external editor is a console application. -## +external_editor = nvim use_console_editor = yes -# -##### colors definitions ##### -## -## It is possible to set a background color by setting a color value -## "_", e.g. red_black will set foregound color to red -## and background color to black. -## -## In addition, for terminals that support 256 colors it is possible to set one -## of them by using a number in range [1, 256] instead of color name, -## e.g. numerical value corresponding to red_black is 2_1. To find out if the -## terminal supports 256 colors, run ncmpcpp and check out the bottom of the -## help screen for list of available colors and their numerical values. -## -## What is more, there are two special values for the background color: -## "transparent" and "current". The first one explicitly sets the background to -## be transparent, while the second one allows you to preserve current -## background color and change only the foreground one. It's used implicitly -## when background color is not specified. -## -## Moreover, it is possible to attach format information to selected color -## variables by appending to their end a colon followed by one or more format -## flags, e.g. black:b or red:ur. The following variables support this syntax: -## visualizer_color, color1, color2, empty_tag_color, volume_color, -## state_line_color, state_flags_color, progressbar_color, -## progressbar_elapsed_color, player_state_color, statusbar_time_color, -## alternative_ui_separator_color. -## -## Note: due to technical limitations of older ncurses version, if 256 colors -## are used there is a possibility that you'll be able to use only colors with -## transparent background. -# -#colors_enabled = yes -# empty_tag_color = magenta -# -#header_window_color = magenta -# -#volume_color = default -# -#state_line_color = default -# -#state_flags_color = default:b -# main_window_color = white -# -#color1 = white -# -#color2 = green -# progressbar_color = black:b -# progressbar_elapsed_color = blue:b -# statusbar_color = red -# statusbar_time_color = cyan:b -# -#player_state_color = default:b -# -#alternative_ui_separator_color = black:b -# -#window_border_color = green -# -#active_window_border = red -# From 7b9277ae0b061af6890786a9149b7e26aa380e2b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 11 Apr 2020 10:00:47 -0400 Subject: [PATCH 056/142] note on xprofile cleanup --- .config/xprofile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/xprofile b/.config/xprofile index 861443b8..92861d16 100755 --- a/.config/xprofile +++ b/.config/xprofile @@ -3,6 +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. +# This file's true location is in ~/.config/xprofile and a link exists to it in +# ~/.xprofile. If you do not use a DM, you may remove the link to it to have a +# cleaner home. + # Fix Gnome Apps Slow Start due to failing services # Add this when you include flatpak in your system dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY From 080365dd22b967274833f50a5cd0cccc0790a658 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 11 Apr 2020 10:03:33 -0400 Subject: [PATCH 057/142] pgrep is a little slow, slower than ps | grep --- .local/bin/cron/newsup | 2 +- .local/bin/displayselect | 2 +- .local/bin/launch_polybar | 2 +- .local/bin/td-toggle | 2 +- .local/bin/torwrap | 2 +- .local/bin/transadd | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index bfdd2f5a..bf8898ea 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -7,7 +7,7 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit /usr/bin/notify-send "📰 Updating RSS feeds..." -pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit +ps ax | grep -q newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit echo 🔃 > /tmp/newsupdate pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" diff --git a/.local/bin/displayselect b/.local/bin/displayselect index c0e34795..b2e00758 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -69,4 +69,4 @@ esac setbg # Fix background if screen size/arangement has changed. remaps # Re-remap keys if keyboard added (for laptop bases) -pgrep -x dunst >/dev/null && killall dunst && setsid dunst & # Restart dunst to ensure proper location on screen +{ killall dunst ; setsid dunst & } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen diff --git a/.local/bin/launch_polybar b/.local/bin/launch_polybar index 291d1834..0af1579a 100755 --- a/.local/bin/launch_polybar +++ b/.local/bin/launch_polybar @@ -4,7 +4,7 @@ killall -q polybar # Wait until the processes have been shut down -while pgrep -x polybar >/dev/null; do sleep 1; done +while ps ax | grep -q "\spolybar$"; do sleep 1; done for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar default & done diff --git a/.local/bin/td-toggle b/.local/bin/td-toggle index 46bb1838..fb8620f9 100755 --- a/.local/bin/td-toggle +++ b/.local/bin/td-toggle @@ -1,7 +1,7 @@ #!/bin/sh # If transmission-daemon is running, will ask to kill, else will ask to start. -if pgrep -x transmission-da >/dev/null ; +if ps ax | grep -q "\stransmission-daemon$" ; then [ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed." else diff --git a/.local/bin/torwrap b/.local/bin/torwrap index 2e42c87f..82a268ac 100755 --- a/.local/bin/torwrap +++ b/.local/bin/torwrap @@ -2,6 +2,6 @@ ifinstalled tremc transmission-cli || exit -! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" +! ps ax | grep -q "\stransmission-daemon$" && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" & $TERMINAL -e tremc diff --git a/.local/bin/transadd b/.local/bin/transadd index 97ffafc4..a2e080d8 100755 --- a/.local/bin/transadd +++ b/.local/bin/transadd @@ -2,8 +2,8 @@ # Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running. -# transmission-daemon sometimes fails to take remote requests in its first moments. +# transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep. -pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") +ps ax | grep -q "\stransmission-daemon$" || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") & transmission-remote -a "$@" && notify-send "🔽 Torrent added." From e461257dde10bf4cf65e27781cb70cfc986347ce Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 11 Apr 2020 10:03:46 -0400 Subject: [PATCH 058/142] legacy alsa config moved --- .asoundrc => .config/alsa/asoundrc | 0 .profile | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .asoundrc => .config/alsa/asoundrc (100%) diff --git a/.asoundrc b/.config/alsa/asoundrc similarity index 100% rename from .asoundrc rename to .config/alsa/asoundrc diff --git a/.profile b/.profile index 000a5304..7edd637e 100644 --- a/.profile +++ b/.profile @@ -19,7 +19,7 @@ export LESSHISTFILE="-" export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" -#export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" +export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" #export GNUPGHOME="$XDG_DATA_HOME/gnupg" export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" export KODI_DATA="$XDG_DATA_HOME/kodi" From f581adb328213ecb290e048e4e3f322de4537ce5 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sat, 11 Apr 2020 16:43:26 +0200 Subject: [PATCH 059/142] i3/config volume update for statusbar (#557) after lmc removal, forgot to add `pkill -RTMIN+10 i3blocks` --- .config/i3/config | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 85e96d81..ea24277f 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -150,7 +150,7 @@ bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right bindsym $mod+m exec --no-startup-id $term -e ncmpcpp -bindsym $mod+Shift+m exec --no-startup-id pulsemixer --toggle-mute +bindsym $mod+Shift+m exec --no-startup-id pulsemixer --toggle-mute && pkill -RTMIN+10 i3blocks # #---Workspace Bindings---# # bindsym $mod+Home workspace $ws1 @@ -252,10 +252,10 @@ bindsym $mod+Ctrl+Right move workspace to output right # #---Media Keys---# # # Volume keys -bindsym $mod+plus exec --no-startup-id pulsemixer --change-volume +5 -bindsym $mod+Shift+plus exec --no-startup-id pulsemixer --change-volume +15 -bindsym $mod+minus exec --no-startup-id pulsemixer --change-volume -5 -bindsym $mod+Shift+minus exec --no-startup-id pulsemixer --change-volume -15 +bindsym $mod+plus exec --no-startup-id pulsemixer --change-volume +5 && pkill -RTMIN+10 i3blocks +bindsym $mod+Shift+plus exec --no-startup-id pulsemixer --change-volume +15 && pkill -RTMIN+10 i3blocks +bindsym $mod+minus exec --no-startup-id pulsemixer --change-volume -5 && pkill -RTMIN+10 i3blocks +bindsym $mod+Shift+minus exec --no-startup-id pulsemixer --change-volume -15 && pkill -RTMIN+10 i3blocks bindsym $mod+less exec --no-startup-id mpc prev bindsym $mod+Shift+less exec --no-startup-id mpc seek 0% bindsym $mod+greater exec --no-startup-id mpc next @@ -276,13 +276,13 @@ bindsym $mod+Delete exec $stoprec bindsym XF86Launch1 exec --no-startup-id xset dpms force off # #---Extra XF86 Keys---# # -bindsym XF86AudioMute exec --no-startup-id pulsemixer --toggle-mute -bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 -bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -10 -bindsym Control+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -1 -bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 -bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +10 -bindsym Control+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +1 +bindsym XF86AudioMute exec --no-startup-id pulsemixer --toggle-mute && pkill -RTMIN+10 i3blocks +bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 && pkill -RTMIN+10 i3blocks +bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -10 && pkill -RTMIN+10 i3blocks +bindsym Control+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -1 && pkill -RTMIN+10 i3blocks +bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 && pkill -RTMIN+10 i3blocks +bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +10 && pkill -RTMIN+10 i3blocks +bindsym Control+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +1 && pkill -RTMIN+10 i3blocks bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown" ##bindsym XF86Copy exec ##bindsym XF86Open exec From e008bbee2a47197ee79ca545706917e16843d56e Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sat, 11 Apr 2020 18:35:05 -0700 Subject: [PATCH 060/142] xprofile: tell Qt to use the GTK2 theme --- .config/xprofile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/xprofile b/.config/xprofile index 92861d16..662cc327 100755 --- a/.config/xprofile +++ b/.config/xprofile @@ -19,3 +19,6 @@ xcompmgr & # xcompmgr for transparency dunst & # dunst for notifications xset r rate 300 50 & # Speed xrate up unclutter & # Remove mouse when idle + +# program settings: +export QT_QPA_PLATFORMTHEME="gtk2" From 37637b20305256d82e29e6850b90fd5c7dfc85bc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 12 Apr 2020 09:17:20 -0400 Subject: [PATCH 061/142] mpd cleanup --- .config/mpd/mpd.conf | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index ee7ed170..c635183f 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -1,26 +1,19 @@ -db_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/database" -log_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/log" -music_directory "~/Music" -playlist_directory "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/playlists" -pid_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/pid" -state_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/state" -sticker_file "${XDG_CONFIG_HOME:-$HOME/.config}/mpd/sticker.sql" +music_directory "~/Music" +playlist_directory "~/.config/mpd/playlists" auto_update "yes" - bind_to_address "127.0.0.1" restore_paused "yes" max_output_buffer_size "16384" audio_output { type "alsa" - name "alsa for audio soundcard" - mixer_type "software" + name "ALSA" } audio_output { -type "fifo" -name "toggle_visualizer" -path "/tmp/mpd.fifo" -format "44100:16:2" + type "fifo" + name "Visualizer feed" + path "/tmp/mpd.fifo" + format "44100:16:2" } From b77dc80c37cb3f43564e927dbe12a68756503f5b Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sun, 12 Apr 2020 08:26:47 -0700 Subject: [PATCH 062/142] move qt use gtk theme from xprofile to profile --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index 7edd637e..7f3a920e 100644 --- a/.profile +++ b/.profile @@ -41,6 +41,7 @@ export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" +export QT_QPA_PLATFORMTHEME="gtk2" # This is the list for lf icons: export LF_ICONS="di=📁:\ From 6491129dbb654e248df75f289ccf37a82cfab1f2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 12 Apr 2020 23:49:42 -0400 Subject: [PATCH 063/142] bat script changes for better statusbar --- .local/bin/statusbar/battery | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 65152f77..981fc3af 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -22,6 +22,6 @@ do # If it is discharging and 25% or less, we will add a ❗ as a warning. [ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗" - printf "%s%s%s%%\n" "$status" "$warn" "$capacity" + printf "%s%s%s%% " "$status" "$warn" "$capacity" unset warn -done +done | sed s/\ $/\\n/ From 64b8f085636776e4ab1dad091711a3e8a22a8076 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 13 Apr 2020 01:38:59 -0400 Subject: [PATCH 064/142] statusbar tweaks/updates for dwmblocks --- .local/bin/statusbar/cpu | 5 +++-- .local/bin/statusbar/help | 14 +++++++++++--- .local/bin/statusbar/memory | 4 +++- .local/bin/statusbar/pacpackages | 8 ++++---- .local/bin/statusbar/weather | 2 +- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index 5b5528e6..bd0c77a4 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -1,10 +1,11 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; + 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;; + 2) setsid "$TERMINAL" -e htop & ;; 3) notify-send "🖥 CPU module " "\- Shows CPU temperature. - Click to show intensive processes. -- % is of single core." ;; +- Middle click to open htop." ;; esac sensors | awk '/Core 0/ {print "🌡", $3}' diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help index 70ca383f..4d8e3c21 100755 --- a/.local/bin/statusbar/help +++ b/.local/bin/statusbar/help @@ -1,8 +1,16 @@ #!/bin/sh +# The clickable help menu. Middle click to restart wm. + +# If dwm is running, use dwm's readme and restart. +ps ax | grep -q "\sdwm$" && + READMEFILE=/usr/local/share/dwm/larbs.mom + restartwm() { pkill -HUP dwm ;} || + restartwm() { i3 restart ;} + case $BLOCK_BUTTON in - 1) groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura - ;; - 2) i3 restart ;; + 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;; + 2) restartwm ;; 3) notify-send "❓ Help module" "\- Left click to open LARBS guide. -- Middle click to refresh i3.";; +- Middle click to refresh window manager.";; esac; echo "❓" diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index 25a29585..dce52684 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -2,8 +2,10 @@ case $BLOCK_BUTTON in 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; + 2) setsid "$TERMINAL" -e htop & ;; 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. -- Click to show memory hogs." ;; +- Click to show memory hogs. +- Middle click to open htop." ;; esac free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}' diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 6f439cc0..49ba3196 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -15,14 +15,14 @@ # [Action] # Description = Updating statusbar... # When = PostTransaction -# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks +# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3. case $BLOCK_BUTTON in - 1) $TERMINAL -e popupgrade ;; + 1) setsid "$TERMINAL" -e popupgrade & ;; 2) notify-send "$(/usr/bin/pacman -Qu)" ;; - 3) notify-send "Upgrade module" "📦: number of upgradable packages + 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages - Left click to upgrade packages - Middle click to show upgradable packages" ;; esac -pacman -Qu | grep -v "\[ignored\]" | wc -l | sed "s/^/📦/;s/^📦0$//g" +pacman -Qu | grep -cv "\[ignored\]" | sed "s/^/📦/;s/^📦0$//g" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 853d2626..875259c2 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -18,7 +18,7 @@ sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\( # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) $TERMINAL -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" ;; + 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; 2) getforecast && showweather ;; 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. From 203930c326ba04ff41df30328eefeb6dcc878abd Mon Sep 17 00:00:00 2001 From: vired <62380689+vired@users.noreply.github.com> Date: Mon, 13 Apr 2020 17:09:32 +0600 Subject: [PATCH 065/142] autocmd to delete newlines at end of file on save. (#563) --- .config/nvim/init.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 5b1605d1..c0078e12 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -103,8 +103,9 @@ set clipboard+=unnamedplus autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x! autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! -" Automatically deletes all trailing whitespace on save. +" Automatically deletes all trailing whitespace and newlines at end of file on save. autocmd BufWritePre * %s/\s\+$//e + autocmd BufWritepre * %s/\n\+\%$//e " When shortcut files are updated, renew bash and ranger configs with new material: autocmd BufWritePost files,directories !shortcuts From 24d9df2709f2c6262906a2e58a821d332a94b6a2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 13 Apr 2020 07:20:05 -0400 Subject: [PATCH 066/142] clean --- .config/xprofile | 3 --- .profile | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/xprofile b/.config/xprofile index 662cc327..92861d16 100755 --- a/.config/xprofile +++ b/.config/xprofile @@ -19,6 +19,3 @@ xcompmgr & # xcompmgr for transparency dunst & # dunst for notifications xset r rate 300 50 & # Speed xrate up unclutter & # Remove mouse when idle - -# program settings: -export QT_QPA_PLATFORMTHEME="gtk2" diff --git a/.profile b/.profile index 7f3a920e..f7a12c56 100644 --- a/.profile +++ b/.profile @@ -41,7 +41,8 @@ export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" -export QT_QPA_PLATFORMTHEME="gtk2" +export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. +export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. # This is the list for lf icons: export LF_ICONS="di=📁:\ From d8f0865799d3641a2f458f8025ef788cc7d7c518 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 13 Apr 2020 11:49:40 -0400 Subject: [PATCH 067/142] actually, just use pidof --- .local/bin/launch_polybar | 4 +--- .local/bin/td-toggle | 7 ++++--- .local/bin/transadd | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.local/bin/launch_polybar b/.local/bin/launch_polybar index 0af1579a..8786be6c 100755 --- a/.local/bin/launch_polybar +++ b/.local/bin/launch_polybar @@ -4,8 +4,6 @@ killall -q polybar # Wait until the processes have been shut down -while ps ax | grep -q "\spolybar$"; do sleep 1; done +while pidof polybar >/dev/null; do sleep 1; done for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar default & done - -echo "Bars launched..." diff --git a/.local/bin/td-toggle b/.local/bin/td-toggle index fb8620f9..d2ba76ae 100755 --- a/.local/bin/td-toggle +++ b/.local/bin/td-toggle @@ -1,11 +1,12 @@ #!/bin/sh # If transmission-daemon is running, will ask to kill, else will ask to start. -if ps ax | grep -q "\stransmission-daemon$" ; + +if pidof transmission-daemon >/dev/null ; then - [ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed." + [ "$(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 "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started." + [ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon enabled." fi sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" diff --git a/.local/bin/transadd b/.local/bin/transadd index a2e080d8..1b9599ed 100755 --- a/.local/bin/transadd +++ b/.local/bin/transadd @@ -4,6 +4,6 @@ # transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep. -ps ax | grep -q "\stransmission-daemon$" || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") & +pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") & transmission-remote -a "$@" && notify-send "🔽 Torrent added." From b53b599bc57e0d47db4a1ed250a0c17eee2ed8ce Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 13 Apr 2020 17:29:25 -0400 Subject: [PATCH 068/142] wine and kodi backups --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index f7a12c56..4d2cf6f8 100644 --- a/.profile +++ b/.profile @@ -21,8 +21,8 @@ export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" #export GNUPGHOME="$XDG_DATA_HOME/gnupg" -export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" -export KODI_DATA="$XDG_DATA_HOME/kodi" +export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default" +export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi" export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" From e88b3a72b8273d3b362fcc32b8e945dd66de8120 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 14 Apr 2020 11:10:26 -0400 Subject: [PATCH 069/142] internet script fix --- .local/bin/statusbar/internet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 82b10807..518d6d7f 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -4,7 +4,7 @@ # Show 🌐 if connected to ethernet or ❎ if none. case $BLOCK_BUTTON in - 1) $TERMINAL -e nmtui ;; + 1) setsid "$TERMINAL" -e nmtui & ;; 3) notify-send "🌐 Internet module" "\- Click to connect 📡: no wifi connection 📶: wifi connection with quality @@ -13,7 +13,7 @@ case $BLOCK_BUTTON in " ;; esac -grep "down" /sys/class/net/w*/operstate && wifiicon="📡" || +grep -q "down" /sys/class/net/w*/operstate && wifiicon="📡" || wifiicon="$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')" printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)" From 05f9c3b70799d48ec39786097808fccfd7c89643 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 14 Apr 2020 20:37:22 -0400 Subject: [PATCH 070/142] use pamixer, which is much faster --- .local/bin/statusbar/volume | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index e248952d..20805e6a 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -9,9 +9,9 @@ case $BLOCK_BUTTON in # 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;; # 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;; 1) setsid "$TERMINAL" -e pulsemixer & ;; - 2) pulsemixer --toggle-mute ;; - 4) pulsemixer --change-volume +5 ;; - 5) pulsemixer --change-volume -5 ;; + 2) pamixer -t ;; + 4) pamixer --allow-boost -i 1 ;; + 5) pamixer --allow-boost -d 1 ;; 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. - Middle click to mute. - Scroll to change." From 314ff058de27274a8b3ee0fd272ed0105fd01b6d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 14 Apr 2020 20:38:25 -0400 Subject: [PATCH 071/142] manual refresh xrdb on dwm after wal --- .local/bin/setbg | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/setbg b/.local/bin/setbg index b91c87c0..3e7294b7 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -16,4 +16,5 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" # If pywal is installed, use it. wal -s -i "$(readlink -f "$bgloc")" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 +pidof dwm >/dev/null && xdotool key super+F5 xwallpaper --zoom "$bgloc" From 54f691a0785072bbe48c7f519ed157a3881a7f06 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 14 Apr 2020 21:45:09 -0400 Subject: [PATCH 072/142] language-independent volume script --- .local/bin/statusbar/volume | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index 20805e6a..7580f200 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -23,7 +23,7 @@ volstat="$(pactl list sinks)" echo "$volstat" | grep -q "Mute: yes" && printf "🔇\\n" && exit # echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit # ALSA -vol="$(echo "$volstat" | grep '^[[:space:]]Volume:' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")" +vol="$(echo "$volstat" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")" # vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") # ALSA if [ "$vol" -gt "70" ]; then From dff66cd1efb36afd54dd6dcf2fdaa9475d5646c1 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 14 Apr 2020 22:10:38 -0400 Subject: [PATCH 073/142] sysact added --- .local/bin/sysact | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 .local/bin/sysact diff --git a/.local/bin/sysact b/.local/bin/sysact new file mode 100755 index 00000000..6bf1a569 --- /dev/null +++ b/.local/bin/sysact @@ -0,0 +1,15 @@ +#!/bin/sh + +# A dmenu wrapper script for system functions. + +cmds="\ +lock screen slock +leave dwm kill -TERM $(pidof -s dwm) +refresh dwm kill -HUP $(pidof -s dwm) +reboot sudo -A reboot +shutdown sudo -A shutdown -h now +" + +choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" + +`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2` From 0242d8428d258a886bed6305dc6e37e61ab86046 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 15 Apr 2020 14:42:36 -0400 Subject: [PATCH 074/142] help renamed to avoid conflicts --- .config/i3blocks/config | 2 +- .local/bin/statusbar/{help => help-icon} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .local/bin/statusbar/{help => help-icon} (100%) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 457a9a2a..e83de5a0 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -64,5 +64,5 @@ interval=30 [internet] interval=10 -[help] +[help-icon] interval=once diff --git a/.local/bin/statusbar/help b/.local/bin/statusbar/help-icon similarity index 100% rename from .local/bin/statusbar/help rename to .local/bin/statusbar/help-icon From bdbf0d838268575f2d310c769636b165c81f196b Mon Sep 17 00:00:00 2001 From: Luke Bubar <43391582+lukerb52@users.noreply.github.com> Date: Wed, 15 Apr 2020 19:58:20 -0400 Subject: [PATCH 075/142] Added GNU Octave run conditions (#575) --- .local/bin/compiler | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/compiler b/.local/bin/compiler index 2fefdf5a..474300ff 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -32,6 +32,7 @@ case "$file" in *config.h) sudo make install ;; *\.c) cc "$file" -o "$base" && "$base" ;; *\.py) python "$file" ;; + *\.m) octave "$file" ;; *\.go) go run "$file" ;; *\.sent) setsid sent "$file" 2>/dev/null & ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; From 82f016a5c34f3495414e28772039770daccee8a7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 18 Apr 2020 10:22:52 -0400 Subject: [PATCH 076/142] dmenupass uses -P option on my dmenu build --- .local/bin/dmenupass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenupass b/.local/bin/dmenupass index 8631a134..2c14e6f0 100755 --- a/.local/bin/dmenupass +++ b/.local/bin/dmenupass @@ -3,4 +3,4 @@ # This script is the SUDO_ASKPASS variable, meaning that it will be used as a # password prompt if needed. -dmenu -fn Monospace-18 -sb "#d79921" -sf "#1d2021" -nf "#000000" -nb "#000000" -p "$1" <&- && echo +dmenu -fn Monospace-18 -P -p "$1" <&- && echo From 37788be5d97cf9c32be1abae76fddc77f4ea87f6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 18 Apr 2020 10:33:58 -0400 Subject: [PATCH 077/142] ifinstalled now checks for packages, iplocate fix, sleep removed from torwrap --- .local/bin/ifinstalled | 8 ++++++-- .local/bin/statusbar/iplocate | 4 ++-- .local/bin/torwrap | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.local/bin/ifinstalled b/.local/bin/ifinstalled index c8e1c2ec..04c0eef4 100755 --- a/.local/bin/ifinstalled +++ b/.local/bin/ifinstalled @@ -1,4 +1,8 @@ #!/bin/sh -# If $1 command is not available, error code and notify. -command -v "$1" >/dev/null || { notify-send "📦 $1" "must be installed for this function." && exit 1 ;} +# Some optional functions in LARBS require programs not installed by default. I +# use this little script to check to see if a command exists and if it doesn't +# it informs the user that they need that command to continue. This is used in +# various other scripts for clarity's sake. + +pacman -Qq "$1" >/dev/null || { notify-send "📦 $1" "must be installed for this function." && exit 1 ;} diff --git a/.local/bin/statusbar/iplocate b/.local/bin/statusbar/iplocate index 8dc6290c..02adab8d 100755 --- a/.local/bin/statusbar/iplocate +++ b/.local/bin/statusbar/iplocate @@ -5,6 +5,6 @@ # # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ -ifinstalled "geoiplookup" || exit +ifinstalled "geoip" || exit addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " ${XDG_CONFIG_HOME:-$HOME/.config}/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" +grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.local/bin/torwrap b/.local/bin/torwrap index 82a268ac..4f94053e 100755 --- a/.local/bin/torwrap +++ b/.local/bin/torwrap @@ -1,7 +1,7 @@ #!/bin/sh -ifinstalled tremc transmission-cli || exit +ifinstalled tremc-git transmission-cli || exit -! ps ax | grep -q "\stransmission-daemon$" && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" & +! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." -$TERMINAL -e tremc +$TERMINAL -e tremc; pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" From 2cff4c1fa8af1489947595253152551b0946f791 Mon Sep 17 00:00:00 2001 From: mighty9245 <52252283+mighty9245@users.noreply.github.com> Date: Sat, 18 Apr 2020 21:19:36 +0300 Subject: [PATCH 078/142] hide go folder (#578) --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index 4d2cf6f8..be6868e0 100644 --- a/.profile +++ b/.profile @@ -27,6 +27,7 @@ export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" +export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" # Other program settings: export DICS="/usr/share/stardict/dic/" From 6f22b799c84c10dac4d2605dc019d836768df9f9 Mon Sep 17 00:00:00 2001 From: ElliotsLab Date: Sun, 19 Apr 2020 08:34:57 -0400 Subject: [PATCH 079/142] hide ansible folder and config (#579) --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index be6868e0..48c5e2ab 100644 --- a/.profile +++ b/.profile @@ -28,6 +28,7 @@ export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" +export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" # Other program settings: export DICS="/usr/share/stardict/dic/" From 6bcdd2bfca57589f5107463745002d32495e9107 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 19 Apr 2020 19:03:34 -0400 Subject: [PATCH 080/142] zprofile is now the file, profile is the link --- .profile | 119 +----------------------------------------------------- .zprofile | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 119 insertions(+), 119 deletions(-) mode change 100644 => 120000 .profile mode change 120000 => 100644 .zprofile diff --git a/.profile b/.profile deleted file mode 100644 index 48c5e2ab..00000000 --- a/.profile +++ /dev/null @@ -1,118 +0,0 @@ -# Profile file. Runs on login. Environmental variables are set here. - -# Adds `~/.local/bin` to $PATH -export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" - -# Default programs: -export EDITOR="nvim" -export TERMINAL="st" -export BROWSER="brave" -export READER="zathura" - -# ~/ Clean-up: -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_DATA_HOME="$HOME/.local/share" -#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" -export LESSHISTFILE="-" -export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" -export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" -export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" -export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" -#export GNUPGHOME="$XDG_DATA_HOME/gnupg" -export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default" -export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi" -export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" -export TMUX_TMPDIR="$XDG_RUNTIME_DIR" -export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" -export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" -export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" -export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" - -# Other program settings: -export DICS="/usr/share/stardict/dic/" -export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" -export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" -export LESS=-R -export LESS_TERMCAP_mb="$(printf '%b' '')" -export LESS_TERMCAP_md="$(printf '%b' '')" -export LESS_TERMCAP_me="$(printf '%b' '')" -export LESS_TERMCAP_so="$(printf '%b' '')" -export LESS_TERMCAP_se="$(printf '%b' '')" -export LESS_TERMCAP_us="$(printf '%b' '')" -export LESS_TERMCAP_ue="$(printf '%b' '')" -export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" -export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. -export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. - -# This is the list for lf icons: -export LF_ICONS="di=📁:\ -fi=📃:\ -tw=🤝:\ -ow=📂:\ -ln=⛓:\ -or=❌:\ -ex=🎯:\ -*.txt=✍:\ -*.mom=✍:\ -*.me=✍:\ -*.ms=✍:\ -*.png=🖼:\ -*.ico=🖼:\ -*.jpg=📸:\ -*.jpeg=📸:\ -*.gif=🖼:\ -*.svg=🗺:\ -*.xcf=🖌:\ -*.html=🌎:\ -*.xml=📰:\ -*.gpg=🔒:\ -*.css=🎨:\ -*.pdf=📚:\ -*.djvu=📚:\ -*.epub=📚:\ -*.csv=📓:\ -*.xlsx=📓:\ -*.tex=📜:\ -*.md=📘:\ -*.r=📊:\ -*.R=📊:\ -*.rmd=📊:\ -*.Rmd=📊:\ -*.mp3=🎵:\ -*.opus=🎵:\ -*.ogg=🎵:\ -*.m4a=🎵:\ -*.flac=🎼:\ -*.mkv=🎥:\ -*.mp4=🎥:\ -*.webm=🎥:\ -*.mpeg=🎥:\ -*.avi=🎥:\ -*.zip=📦:\ -*.rar=📦:\ -*.7z=📦:\ -*.tar.gz=📦:\ -*.z64=🎮:\ -*.v64=🎮:\ -*.n64=🎮:\ -*.1=ℹ:\ -*.nfo=ℹ:\ -*.info=ℹ:\ -*.log=📙:\ -*.iso=📀:\ -*.img=📀:\ -*.bib=🎓:\ -*.ged=👪:\ -*.part=💔:\ -*.torrent=🔽:\ -" - -[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 & - -# Start graphical server on tty1 if not already running. -[ "$(tty)" = "/dev/tty1" ] && ! ps -e | grep -qw Xorg && exec startx - -# Switch escape and caps if tty and no passwd required: -sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null diff --git a/.profile b/.profile new file mode 120000 index 00000000..c1abe3fd --- /dev/null +++ b/.profile @@ -0,0 +1 @@ +.zprofile \ No newline at end of file diff --git a/.zprofile b/.zprofile deleted file mode 120000 index aa7da3a9..00000000 --- a/.zprofile +++ /dev/null @@ -1 +0,0 @@ -.profile \ No newline at end of file diff --git a/.zprofile b/.zprofile new file mode 100644 index 00000000..48c5e2ab --- /dev/null +++ b/.zprofile @@ -0,0 +1,118 @@ +# Profile file. Runs on login. Environmental variables are set here. + +# Adds `~/.local/bin` to $PATH +export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" + +# Default programs: +export EDITOR="nvim" +export TERMINAL="st" +export BROWSER="brave" +export READER="zathura" + +# ~/ Clean-up: +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +#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" +export LESSHISTFILE="-" +export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" +export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" +export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" +export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" +#export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default" +export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi" +export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" +export TMUX_TMPDIR="$XDG_RUNTIME_DIR" +export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android" +export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" +export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" +export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" + +# Other program settings: +export DICS="/usr/share/stardict/dic/" +export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" +export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" +export LESS=-R +export LESS_TERMCAP_mb="$(printf '%b' '')" +export LESS_TERMCAP_md="$(printf '%b' '')" +export LESS_TERMCAP_me="$(printf '%b' '')" +export LESS_TERMCAP_so="$(printf '%b' '')" +export LESS_TERMCAP_se="$(printf '%b' '')" +export LESS_TERMCAP_us="$(printf '%b' '')" +export LESS_TERMCAP_ue="$(printf '%b' '')" +export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" +export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. +export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. + +# This is the list for lf icons: +export LF_ICONS="di=📁:\ +fi=📃:\ +tw=🤝:\ +ow=📂:\ +ln=⛓:\ +or=❌:\ +ex=🎯:\ +*.txt=✍:\ +*.mom=✍:\ +*.me=✍:\ +*.ms=✍:\ +*.png=🖼:\ +*.ico=🖼:\ +*.jpg=📸:\ +*.jpeg=📸:\ +*.gif=🖼:\ +*.svg=🗺:\ +*.xcf=🖌:\ +*.html=🌎:\ +*.xml=📰:\ +*.gpg=🔒:\ +*.css=🎨:\ +*.pdf=📚:\ +*.djvu=📚:\ +*.epub=📚:\ +*.csv=📓:\ +*.xlsx=📓:\ +*.tex=📜:\ +*.md=📘:\ +*.r=📊:\ +*.R=📊:\ +*.rmd=📊:\ +*.Rmd=📊:\ +*.mp3=🎵:\ +*.opus=🎵:\ +*.ogg=🎵:\ +*.m4a=🎵:\ +*.flac=🎼:\ +*.mkv=🎥:\ +*.mp4=🎥:\ +*.webm=🎥:\ +*.mpeg=🎥:\ +*.avi=🎥:\ +*.zip=📦:\ +*.rar=📦:\ +*.7z=📦:\ +*.tar.gz=📦:\ +*.z64=🎮:\ +*.v64=🎮:\ +*.n64=🎮:\ +*.1=ℹ:\ +*.nfo=ℹ:\ +*.info=ℹ:\ +*.log=📙:\ +*.iso=📀:\ +*.img=📀:\ +*.bib=🎓:\ +*.ged=👪:\ +*.part=💔:\ +*.torrent=🔽:\ +" + +[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 & + +# Start graphical server on tty1 if not already running. +[ "$(tty)" = "/dev/tty1" ] && ! ps -e | grep -qw Xorg && exec startx + +# Switch escape and caps if tty and no passwd required: +sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null From 0420f7c1190607d8da3af6fae7e9f06a4c134001 Mon Sep 17 00:00:00 2001 From: Luke Bubar <43391582+lukerb52@users.noreply.github.com> Date: Mon, 20 Apr 2020 13:37:50 -0400 Subject: [PATCH 081/142] Added OpenSCAD run conditions (#582) Default output to STL seems appropriate. STL files can be viewed with a minimalist program like fstl (in the AUR) --- .local/bin/compiler | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/compiler b/.local/bin/compiler index 474300ff..fd812b55 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -33,6 +33,7 @@ case "$file" in *\.c) cc "$file" -o "$base" && "$base" ;; *\.py) python "$file" ;; *\.m) octave "$file" ;; + *\.scad) openscad -o "$base".stl "$file" ;; *\.go) go run "$file" ;; *\.sent) setsid sent "$file" 2>/dev/null & ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; From eb76d8ed5d4ffba4ad5cea1672acc3579402eafc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 20 Apr 2020 16:41:33 -0400 Subject: [PATCH 082/142] i3 STATUSBAR fix and xinitrc moved/linked --- .config/xinitrc | 21 +++++++++++++++++++++ .xinitrc | 21 +-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) create mode 100755 .config/xinitrc mode change 100644 => 120000 .xinitrc diff --git a/.config/xinitrc b/.config/xinitrc new file mode 100755 index 00000000..e636c90d --- /dev/null +++ b/.config/xinitrc @@ -0,0 +1,21 @@ +#!/bin/sh + +# xinitrc runs automatically when you run startx. + +# There are some small but important commands that need to be run when we start +# the graphical environment. I keep those commands in ~/config/xprofile because +# that file is run automatically if someone uses a display manager (login +# screen) and so they are needed there. To prevent doubling up commands, I +# source them here with the line below. + +# export STATUSBAR="i3blocks" # Uncomment this line when using i3. + +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" + +# Your default LARBS WM is determined in your `~/.profile` on login. Here we +# run the proper command to run when the graphical environment starts. + +# Comment/uncomment these lines depending on what wm you want to use. Also +# check the i3blocks line above. +ssh-agent dwm +# ssh-agent i3 diff --git a/.xinitrc b/.xinitrc deleted file mode 100644 index 09dbd4ee..00000000 --- a/.xinitrc +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# xinitrc runs automatically when you run startx. - -# There are some small but important commands that need to be run when we start -# the graphical environment. I keep those commands in ~/config/xprofile because -# that file is run automatically if someone uses a display manager (login -# screen) and so they are needed there. To prevent doubling up commands, I -# source them here with the line below. - -[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" - -# Your default LARBS WM is determined in your `~/.profile` on login. Here we -# run the proper command to run when the graphical environment starts. - -exec dwm - -# To use i3, comment out the line above with dwm and uncomment these two: -# export STATUSBAR="i3blocks" -# exec i3 diff --git a/.xinitrc b/.xinitrc new file mode 120000 index 00000000..6fefdaf0 --- /dev/null +++ b/.xinitrc @@ -0,0 +1 @@ +.config/xinitrc \ No newline at end of file From f180dade4afd2661b5f573622820e2b42eb8c0ce Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 20 Apr 2020 16:45:44 -0400 Subject: [PATCH 083/142] note on removing ~/.profile --- .zprofile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.zprofile b/.zprofile index 48c5e2ab..3ef64d2a 100644 --- a/.zprofile +++ b/.zprofile @@ -1,4 +1,9 @@ -# Profile file. Runs on login. Environmental variables are set here. +#!/bin/zsh + +# zsh profile file. Runs on login. Environmental variables are set here. + +# If you don't plan on reverting to bash, you can remove the link in ~/.profile +# to clean up. # Adds `~/.local/bin` to $PATH export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" From 1669b3c2b95dc7143f84470ca8dd5bb35283821a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 20 Apr 2020 16:48:32 -0400 Subject: [PATCH 084/142] feedback and autoconfig if single screen --- .local/bin/displayselect | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index b2e00758..02b35c2c 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -48,25 +48,36 @@ morescreen() { # If multi-monitor is selected and there are more than two screen multimon() { # Multi-monitor handler. case "$(echo "$screens" | wc -l)" in - 1) xrandr $(echo "$allposs" | grep -v "$screens" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; 2) twoscreen ;; *) morescreen ;; esac ;} +onescreen() { # If only one output available or chosen. + xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') + } + +postrun() { # Stuff to run to clean up. + setbg # Fix background if screen size/arangement has changed. + remaps # Re-remap keys if keyboard added (for laptop bases) + { killall dunst ; setsid dunst & } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen + } + # Get all possible displays allposs=$(xrandr -q | grep "connected") # Get all connected screens. -screens=$(echo "$allposs" | grep " connected" | awk '{print $1}') +screens=$(echo "$allposs" | awk '/ connected/ {print $1}') + +# If there's only one screen +[ "$(echo "$screens" | wc -l)" -lt 2 ] && + { onescreen "$screens"; postrun; notify-send "💻 Only one screen detected." "Using it in its optimal settings..."; exit ;} # Get user choice including multi-monitor and manual selection: chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && case "$chosen" in "manual selection") arandr ; exit ;; "multi-monitor") multimon ;; - *) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; + *) onescreen "$chosen" ;; esac -setbg # Fix background if screen size/arangement has changed. -remaps # Re-remap keys if keyboard added (for laptop bases) -{ killall dunst ; setsid dunst & } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen +postrun From 2c02c85aae3f0ade67d26d7e87c0c57c10b591cd Mon Sep 17 00:00:00 2001 From: simohamed Date: Tue, 21 Apr 2020 21:53:57 +0000 Subject: [PATCH 085/142] remove unneeded require (#587) `library::` is all you need to load a library before using one of its functions. --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index fd812b55..0f693d27 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -26,7 +26,7 @@ case "$file" in *\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf > "$base".pdf ;; *\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;; *\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;; - *\.[rR]md) Rscript -e "require(rmarkdown); rmarkdown::render('$file', quiet=TRUE)" ;; + *\.[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;; *\.tex) textype "$file" ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *config.h) sudo make install ;; From 933e4149d350f0c73a003a94a6cee45f277a6c17 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Wed, 22 Apr 2020 18:34:43 +0200 Subject: [PATCH 086/142] i3 to use slock (#590) it could only work with '&&' and only in this order. i see that it would be logical to "slock" even if a preceding command will fail, though like i said it would only run in this order. i've tried using a script (even in this order) with " ; " it would not run. the audios would mute and the screen would turn off, but it would not lock. --- .config/i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index ea24277f..ed7e7a59 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -134,7 +134,7 @@ bindsym $mod+Ctrl+l move workspace to output right bindsym $mod+z gaps outer current plus 5 bindsym $mod+Shift+z gaps outer current minus 5 -bindsym $mod+x exec --no-startup-id mpc pause; exec --no-startup-id pauseallmpv ; exec --no-startup-id i3lock -e -f -c 1d2021 ; exec --no-startup-id xset dpms force off +bindsym $mod+x exec --no-startup-id xset dpms force off && mpc pause && pauseallmpv && slock & bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown" bindsym $mod+c exec --no-startup-id cabl From 18113aad1a0f50f8596486f64332eed859a79813 Mon Sep 17 00:00:00 2001 From: Charlie39 Date: Thu, 23 Apr 2020 01:45:53 +0530 Subject: [PATCH 087/142] Replaced pgrep with pidof (#592) * dwm compliant revised PR * replaced pgrep with pidof because it is faster! * Update music --- .local/bin/statusbar/music | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 1412ae33..1b187768 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -1,7 +1,8 @@ #!/bin/sh filter() { - sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g" + [ "$(pidof dwmblocks)" ] && sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/\\[paused\\] /g;s/\\[playing\\].*//" | tr -d '\n' | sed -e "s/\..*$//g" \ + || sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g" } case $BLOCK_BUTTON in From 745f12bd16983f9d1e7592ae1101c2f18f6b6c1b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 23 Apr 2020 19:42:37 -0400 Subject: [PATCH 088/142] torrent statusbar opens tremc --- .local/bin/statusbar/torrent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 6f8fc5f6..828ba44d 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -17,7 +17,7 @@ transmission-remote -l | grep % | s/Z/🌱/g" | awk '{print $2, $1}' | sed -e "s/ $//g" | tr '\n' ' ' case $BLOCK_BUTTON in - 1) $TERMINAL -e transmission-remote-cli ;; + 1) $TERMINAL -e tremc ;; 3) notify-send "Torrent module" "🛑: paused ⏳: idle (seeds needed) 🔼: uploading (unfinished) From 5d59b3927da16f589dfb961e54a86e6f14a480d6 Mon Sep 17 00:00:00 2001 From: mokulus <36231852+mokulus@users.noreply.github.com> Date: Fri, 24 Apr 2020 14:44:48 +0200 Subject: [PATCH 089/142] Fix minor statusbar issues (#597) * Fix: Remove trailing space from battery * Unify spacing in disk * Fix news Don't display news module when there are no news. * Use grep -F in pacpackages * Fix torrent Remove trailing whitespace *after* replacing newlines. * Quote sed command --- .local/bin/statusbar/battery | 2 +- .local/bin/statusbar/disk | 2 +- .local/bin/statusbar/news | 2 +- .local/bin/statusbar/pacpackages | 2 +- .local/bin/statusbar/torrent | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 981fc3af..5172e5a8 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -24,4 +24,4 @@ do printf "%s%s%s%% " "$status" "$warn" "$capacity" unset warn -done | sed s/\ $/\\n/ +done | sed 's/* $//' diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index 269eba7e..3e3f2e36 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -16,7 +16,7 @@ esac case "$location" in "/home"* ) icon="🏠" ;; "/mnt"* ) icon="💾" ;; - *) icon="🖥 ";; + *) icon="🖥";; esac printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 455f64db..65ae7fd3 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -13,4 +13,4 @@ case $BLOCK_BUTTON in Note: Only one instance of newsboat (including updates) may be running at a time." ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 49ba3196..5a8d6f3a 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -25,4 +25,4 @@ case $BLOCK_BUTTON in - Middle click to show upgradable packages" ;; esac -pacman -Qu | grep -cv "\[ignored\]" | sed "s/^/📦/;s/^📦0$//g" +pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g" diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 828ba44d..5095cd6a 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -14,7 +14,7 @@ transmission-remote -l | grep % | s/L/🔼/g; s/M/🔽/g; s/N/✅/g; - s/Z/🌱/g" | awk '{print $2, $1}' | sed -e "s/ $//g" | tr '\n' ' ' + s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//' case $BLOCK_BUTTON in 1) $TERMINAL -e tremc ;; From de70c89f4e76b8ba3ea3c79a7e46d04a0af65a51 Mon Sep 17 00:00:00 2001 From: Charlie39 Date: Sat, 25 Apr 2020 17:33:55 +0530 Subject: [PATCH 090/142] alias for zathura (#594) --- .config/aliasrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/aliasrc b/.config/aliasrc index 90de3d9c..39ec0509 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -34,7 +34,8 @@ alias \ p="sudo pacman" \ xi="sudo xbps-install" \ xr="sudo xbps-remove -R" \ - xq="xbps-query" + xq="xbps-query" \ + z="zathura" # Some other stuff alias \ From 8dc3f78a7d5ed58a223503a33e09812bf9dff1f2 Mon Sep 17 00:00:00 2001 From: Charlie39 Date: Sat, 25 Apr 2020 17:38:46 +0530 Subject: [PATCH 091/142] Plugin to highlight hex color codes (#591) Visually intuitive for editing hex color codes in Xresources /XDefaults and anywhere else --- .config/nvim/init.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index c0078e12..9342fa98 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -18,6 +18,7 @@ Plug 'vimwiki/vimwiki' Plug 'bling/vim-airline' Plug 'tpope/vim-commentary' Plug 'kovetskiy/sxhkd-vim' +Plug 'ap/vim-css-color' call plug#end() set bg=light From 7ed651e92ff9750fcbbe2414ee78d08c35e74fc9 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sat, 25 Apr 2020 14:10:40 +0200 Subject: [PATCH 092/142] Clock with auto change emoji (#589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Clock with auto change emoji i made it so it will give you an emoji for the main 12 hours. there are also halfs (one-thirty 🕜,six thirty 🕡...) though ill let someone who knows how to do it in an efficient way, since i dont. also added an option for europeans, and made it cleaner. * use printf instead of echo --- .local/bin/statusbar/clock | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 9799b973..49da91af 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -1,6 +1,23 @@ #!/bin/sh -date '+%Y %b %d (%a) %I:%M%p' +clock=$(date '+%I') + +case "$clock" in + "00") icon="🕛" ;; + "01") icon="🕐" ;; + "02") icon="🕑" ;; + "03") icon="🕒" ;; + "04") icon="🕓" ;; + "05") icon="🕔" ;; + "06") icon="🕕" ;; + "07") icon="🕖" ;; + "08") icon="🕗" ;; + "09") icon="🕘" ;; + "10") icon="🕙" ;; + "11") icon="🕚" ;; + "12") icon="🕛" ;; + *) echo errorrrr ;; +esac case $BLOCK_BUTTON in 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; @@ -8,3 +25,8 @@ case $BLOCK_BUTTON in 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac + +printf '%s %s%s\n' "$(date '+%Y %b %d (%a)')" "$icon" "$(date '+%I:%M%p')" + +#for europeans, use this +#printf '%s %s%s\n' "$(date '+%a %d/%m')" "$icon" "$(date '+%I:%M%p')" From 40faeb97ec72892cbfe1160735c970cd2fde246f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 25 Apr 2020 08:37:38 -0400 Subject: [PATCH 093/142] statusbar fixes --- .local/bin/statusbar/battery | 2 +- .local/bin/statusbar/clock | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 5172e5a8..97868bbf 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -24,4 +24,4 @@ do printf "%s%s%s%% " "$status" "$warn" "$capacity" unset warn -done | sed 's/* $//' +done | sed 's/ *$//' diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 49da91af..24412266 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -16,12 +16,11 @@ case "$clock" in "10") icon="🕙" ;; "11") icon="🕚" ;; "12") icon="🕛" ;; - *) echo errorrrr ;; esac case $BLOCK_BUTTON in 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; - 2) $TERMINAL -e calcurse -D ~/.config/calcurse ;; + 2) setsid "$TERMINAL" -e calcurse -D ~/.config/calcurse & ;; 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac From af4f814b0cb8326368d3ccaa9934ec9342f0728a Mon Sep 17 00:00:00 2001 From: mokulus <36231852+mokulus@users.noreply.github.com> Date: Sun, 26 Apr 2020 01:18:06 +0200 Subject: [PATCH 094/142] dmenumount fix + improvements (#602) * Remove misleading character escape. Everything is in single quotes, so shell will escape it correctly without backslashes. Fixes #440. * Remove lsblk type restriction. * Make it possible to cancel with ESC in dmenu. Up to now if you pressed ESC to cancel the program would just continue with incorrect data. --- .local/bin/dmenumount | 20 ++++++++++++-------- .local/bin/dmenuumount | 10 ++++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index c192873a..75e11b55 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -7,18 +7,20 @@ getmount() { \ [ -z "$chosen" ] && exit 1 - mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" + # shellcheck disable=SC2086 + mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1 [ "$mp" = "" ] && exit 1 if [ ! -d "$mp" ]; then - mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") + 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") fi } mountusb() { \ - chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')" + chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?")" || exit 1 + chosen="$(echo "$chosen" | awk '{print $1}')" sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0 - alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \\( -path *%s -prune \\) \\ \n",$3}') + alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not ( -path *%s -prune ) ",$3}') getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" partitiontype="$(lsblk -no "fstype" "$chosen")" case "$partitiontype" in @@ -29,23 +31,25 @@ mountusb() { \ } mountandroid() { \ - chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1) + chosen="$(echo "$anddrives" | dmenu -i -p "Which Android device?")" || exit 1 + chosen="$(echo "$chosen" | cut -d : -f 1)" getmount "$HOME -maxdepth 3 -type d" simple-mtpfs --device "$chosen" "$mp" - echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" + echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1 simple-mtpfs --device "$chosen" "$mp" notify-send "🤖 Android Mounting" "Android device mounted to $mp." } asktype() { \ - case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in + choice="$(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")" || exit 1 + case $choice in USB) mountusb ;; Android) mountandroid ;; esac } anddrives=$(simple-mtpfs -l 2>/dev/null) -usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}')" +usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$4==""{printf "%s (%s)\n",$1,$3}')" if [ -z "$usbdrives" ]; then [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount index da0f4016..26612efe 100755 --- a/.local/bin/dmenuumount +++ b/.local/bin/dmenuumount @@ -6,25 +6,27 @@ unmountusb() { [ -z "$drives" ] && exit - chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') + chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1 + chosen="$(echo "$chosen" | awk '{print $1}')" [ -z "$chosen" ] && exit sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted." } unmountandroid() { \ - chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?") + chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1 [ -z "$chosen" ] && exit sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted." } asktype() { \ - case "$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" in + choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1 + case "$choice" in USB) unmountusb ;; Android) unmountandroid ;; esac } -drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') +drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/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 8afc8de231f06c4df8ea47ce6b7e36ce8f3da4c9 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 26 Apr 2020 11:12:45 -0400 Subject: [PATCH 095/142] F12 is the new wal refresh bind, only in setbg --- .config/wal/postrun | 4 +--- .local/bin/setbg | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/wal/postrun b/.config/wal/postrun index ae28d832..74d551b5 100755 --- a/.config/wal/postrun +++ b/.config/wal/postrun @@ -24,6 +24,4 @@ done fix_sequences <"${HOME}/.cache/wal/sequences" -xsetroot -name "fsignal:xrdb" -pkill dunst -dunst & +pkill dunst; dunst & diff --git a/.local/bin/setbg b/.local/bin/setbg index 3e7294b7..ea35e163 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -16,5 +16,5 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" # If pywal is installed, use it. wal -s -i "$(readlink -f "$bgloc")" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 -pidof dwm >/dev/null && xdotool key super+F5 +pidof dwm >/dev/null && xdotool key super+F12 xwallpaper --zoom "$bgloc" From 3cb901253cb1b0a64aaa5b1cabcf02ce40480b02 Mon Sep 17 00:00:00 2001 From: Charlie39 Date: Mon, 27 Apr 2020 05:27:09 +0530 Subject: [PATCH 096/142] $XDG_CACHE_HOME env variable (#595) * $XDG_CACHE_HOME env variable XDG compliance * shortcut to cache directory * Update directories * Update directories * Update directories --- .config/directories | 3 ++- .zprofile | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/directories b/.config/directories index 707a1c72..879219c8 100644 --- a/.config/directories +++ b/.config/directories @@ -6,5 +6,6 @@ m ~/Music pp ~/Pictures vv ~/Videos cf ${XDG_CONFIG_HOME:-$HOME/.config} -sc ~/.local/bin +cac ${XDG_CACHE_HOME:-$HOME/.cache} +sc ~/.local/bin mn /mnt diff --git a/.zprofile b/.zprofile index 3ef64d2a..8a9643be 100644 --- a/.zprofile +++ b/.zprofile @@ -17,6 +17,7 @@ export READER="zathura" # ~/ Clean-up: export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" #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" From 161723e8a1966146a77759b3d1b4677f93fc7bd0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 28 Apr 2020 08:45:46 -0400 Subject: [PATCH 097/142] Upstream problem with java not able to figure dwm's windows. Jetbrains products (intellij Idea and pycharm) and Netbeans draws grey windows in dwm(upstream bug). Intellij Idea will work with this two env vars. for pycharm, affected plebs may need to install the wmname tool (community repository) --- .zprofile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.zprofile b/.zprofile index 8a9643be..20c9a821 100644 --- a/.zprofile +++ b/.zprofile @@ -51,6 +51,8 @@ export LESS_TERMCAP_ue="$(printf '%b' '')" export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. +export _JAVA_AWT_WM_NONREPARENTING=1 # Java doesn't understand tiling windows +export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname # This is the list for lf icons: export LF_ICONS="di=📁:\ From ea61ca6366e5aa611b6c02a8c0d36455a260fe7b Mon Sep 17 00:00:00 2001 From: mokulus <36231852+mokulus@users.noreply.github.com> Date: Tue, 28 Apr 2020 14:50:57 +0200 Subject: [PATCH 098/142] Squashed commit of the following: (#600) commit 8f7b5b2e1e0c93db6620f163e944a14558fba652 Author: MateuszOkulus Date: Sun Apr 26 07:23:41 2020 +0200 Fix sysact when there are multiple spaces. commit dd0133304c55eec117c4e03f38317f332ad8970f Author: MateuszOkulus Date: Sun Apr 26 07:22:55 2020 +0200 Remove trailing newline So there is no empty selection at the end in dmenu. commit 2ab45df225695f9c64031d52ff48d837bb9a6e72 Author: MateuszOkulus Date: Sun Apr 26 07:22:22 2020 +0200 Exit when escaping dmenu. commit e8209da3e809ac830844b89e7638d695cd61240f Author: MateuszOkulus Date: Sun Apr 26 07:19:18 2020 +0200 Revert "Fix sysact" This reverts commit 90a2147c0a2463122a5f0cc3ff14de0cceb66135. commit 8dba47f7462d04a49282be33ae9ce68eb7d8d476 Author: MateuszOkulus Date: Sun Apr 26 07:18:57 2020 +0200 Revert "Change tab to spaces." This reverts commit 2e480b32ba90c793771d87d47d7273bcdc180e12. commit 2e480b32ba90c793771d87d47d7273bcdc180e12 Author: MateuszOkulus Date: Sat Apr 25 11:35:55 2020 +0200 Change tab to spaces. commit 90a2147c0a2463122a5f0cc3ff14de0cceb66135 Author: MateuszOkulus Date: Sat Apr 25 11:25:50 2020 +0200 Fix sysact See #584. It now uses # so it's clearly visible. --- .local/bin/sysact | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 6bf1a569..aaef4697 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -7,9 +7,8 @@ lock screen slock leave dwm kill -TERM $(pidof -s dwm) refresh dwm kill -HUP $(pidof -s dwm) reboot sudo -A reboot -shutdown sudo -A shutdown -h now -" +shutdown sudo -A shutdown -h now" -choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" +choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 -`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2` +`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-` From c83f43bed1a24d46b9f327624bc2b0b783449b44 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 28 Apr 2020 09:20:59 -0400 Subject: [PATCH 099/142] fast syntax highlighting --- .config/zsh/.zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 9cd9000b..70459837 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -77,5 +77,5 @@ bindkey '^[[P' delete-char autoload edit-command-line; zle -N edit-command-line bindkey '^e' edit-command-line -# Load zsh-syntax-highlighting; should be last. -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null +# Load syntax highlighting; should be last. +source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null From 53ef201c08d2180a371b3d9a6c5e35cbe1f88230 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 30 Apr 2020 10:24:32 -0400 Subject: [PATCH 100/142] optional cryptocurrencies module --- .local/bin/statusbar/crypto | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 .local/bin/statusbar/crypto diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto new file mode 100755 index 00000000..88b2365d --- /dev/null +++ b/.local/bin/statusbar/crypto @@ -0,0 +1,54 @@ +#!/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/ $//' + } + +mkdir -p "$dir" + +# 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 1.1.1.1 >/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." ;; +esac + +printprices From 60a467de7c4fced7c9cd6a720c722e5a2a81f5da Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 30 Apr 2020 10:31:46 -0400 Subject: [PATCH 101/142] ugly minor intro bugfixes --- .local/bin/statusbar/crypto | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index 88b2365d..31e88b33 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -8,8 +8,7 @@ coins="Bitcoin;btc;💰 Etherium;eth;🍸 Basic Attention Token;bat;🦁 -LBC;lbc;📚 -" +LBC;lbc;📚" # Directory where currency info is stored. dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" @@ -33,7 +32,7 @@ printprices() { # Print/format all prices done | sed 's/ $//' } -mkdir -p "$dir" +[ ! -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')" ] && From 4e385c18b1e92d79f273964c327ed2320902bbcb Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 30 Apr 2020 10:32:29 -0400 Subject: [PATCH 102/142] liberal snowflake doesn't render well in dwm/st --- .local/bin/statusbar/weather | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 875259c2..a2ec518f 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -1,6 +1,6 @@ #!/bin/sh -# Displays todays precipication chance (☔) and daily low (❄) and high (🌞). +# Displays todays precipication chance (☔) and daily low (🥶) and high (🌞). # Usually intended for the statusbar. # If we have internet, get a weather report from wttr.in and store it locally. @@ -14,7 +14,7 @@ curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherrepo # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} +sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶",$1 "°","🌞",$2 "°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in @@ -23,7 +23,7 @@ case $BLOCK_BUTTON in 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. ☔: Chance of rain/snow -❄: Daily low +🥶: Daily low 🌞: Daily high" ;; esac From 77b65299475513c1c40b4ddade9897e20dac8d6a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 1 May 2020 16:55:09 -0400 Subject: [PATCH 103/142] optional network traffic module --- .local/bin/statusbar/nettraf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 .local/bin/statusbar/nettraf diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf new file mode 100755 index 00000000..64b239ff --- /dev/null +++ b/.local/bin/statusbar/nettraf @@ -0,0 +1,24 @@ +#!/bin/sh + +# Module showing network traffic. Shows how much data has been received (RX) or +# transmitted (TX) since the previous time this script ran. So if run every +# second, gives network traffic per second. + +case "$BLOCK_BUTTON" in + 3) notify-send "🌐 Network traffic module" "🔻: Traffic received +🔺: Traffic transmitted" ;; +esac + +rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog" +txfile="${XDG_CACHE_HOME:-$HOME/.cache}/txlog" + +rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | tr '\n' '+' | sed 's/+$/\n/' | bc)" +txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | tr '\n' '+' | sed 's/+$/\n/' | bc)" + +printf "🔻%skB 🔺%skB\\n" \ + "$(printf -- "(%s-%s)/1024\\n" "$rxcurrent" "$(cat "$rxfile")" | bc)" \ + "$(printf -- "(%s-%s)/1024\\n" "$txcurrent" "$(cat "$txfile")" | bc)" + +# Log the current values for next run. +echo "$rxcurrent" > "$rxfile" +echo "$txcurrent" > "$txfile" From 833d5fe9b7ced38d8484844977e7ec8347c06fb4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 1 May 2020 16:58:21 -0400 Subject: [PATCH 104/142] alias tweaks including more rm safety --- .config/aliasrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index 39ec0509..468483ac 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -5,10 +5,9 @@ command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Verbosity and settings that you pretty much just always are going to want. alias \ - bat="cat /sys/class/power_supply/BAT?/capacity" \ cp="cp -iv" \ mv="mv -iv" \ - rm="rm -v" \ + rm="rm -vI" \ mkd="mkdir -pv" \ yt="youtube-dl --add-metadata -i" \ yta="yt -x -f bestaudio/best" \ @@ -37,9 +36,8 @@ alias \ xq="xbps-query" \ z="zathura" -# Some other stuff alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ - tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" + tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" \ From 632d35ebaeba8464eccf159e4f2b704c28e617d6 Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sat, 2 May 2020 15:46:57 +0200 Subject: [PATCH 105/142] update for welcome toggle (#614) changed `~/.xprofile` to `$XDG_CONFIG_HOME/xprofile` --- .local/bin/i3cmds/toggle-welcome | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/i3cmds/toggle-welcome b/.local/bin/i3cmds/toggle-welcome index 517c301d..d15ca143 100755 --- a/.local/bin/i3cmds/toggle-welcome +++ b/.local/bin/i3cmds/toggle-welcome @@ -4,7 +4,7 @@ PIC="${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png" -grep LARBSWELCOME "$HOME/.xprofile" && - ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || - ( echo "notify-send -i \"$PIC\" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && +grep LARBSWELCOME "$XDG_CONFIG_HOME/xprofile" && + ( sed -i "/LARBSWELCOME/d" "$XDG_CONFIG_HOME/xprofile" && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || + ( echo "notify-send -i \"$PIC\" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> "$XDG_CONFIG_HOME/xprofile" && notify-send -i "$PIC" "LARBS welcome message" "Welcome message re-enabled." ) From 50baa1a44f74206f6848fb55009439800e9b8965 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 2 May 2020 15:03:20 -0400 Subject: [PATCH 106/142] use xdotool type --- .local/bin/dmenuunicode | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode index 15799a36..de1421b9 100755 --- a/.local/bin/dmenuunicode +++ b/.local/bin/dmenuunicode @@ -2,16 +2,16 @@ # The famous "get a menu of emojis to copy" script. -# Must have xclip installed to even show menu. -xclip -h 2>/dev/null || exit 1 +# Get user selection via dmenu from emoji file. +chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 30 | sed "s/ .*//") -chosen=$(cut -d ';' -f1 ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") +# Exit if none chosen. +[ -z "$chosen" ] && exit -[ "$chosen" != "" ] || exit - -# If you run this command with an argument, it will automatically insert the character. +# If you run this command with an argument, it will automatically insert the +# character. Otherwise, show a message that the emoji has been copied. if [ -n "$1" ]; then - xdotool key Shift+Insert + xdotool type "$chosen" else echo "$chosen" | tr -d '\n' | xclip -selection clipboard notify-send "'$chosen' copied to clipboard." & From 1c79c00208b4dda46d068924ca70a67074360e50 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 3 May 2020 09:11:37 -0400 Subject: [PATCH 107/142] needed newsboat updates including more color style and sections with --- pre/postfixes --- .config/newsboat/config | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.config/newsboat/config b/.config/newsboat/config index 5366202f..3da9b5ea 100644 --- a/.config/newsboat/config +++ b/.config/newsboat/config @@ -27,13 +27,26 @@ color listfocus black yellow standout bold color listnormal_unread blue default color listfocus_unread yellow default bold color info red black bold -color article cyan default +color article white default bold browser linkhandler macro , open-in-browser -macro t set browser "tsp youtube-dl --add-metadata -ic"; open-in-browser ; set browser linkhandler +macro t set browser "qndl"; open-in-browser ; set browser linkhandler macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best"; open-in-browser ; set browser linkhandler macro v set browser "setsid nohup mpv"; open-in-browser ; set browser linkhandler -macro w set browser "w3m"; open-in-browser ; set browser linkhandler +macro w set browser "lynx"; open-in-browser ; set browser linkhandler macro p set browser "dmenuhandler"; open-in-browser ; set browser linkhandler macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler + +highlight all "---.*---" yellow +highlight feedlist ".*(0/0))" black +highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold +highlight article "(^Link:.*|^Date:.*)" default default +highlight article "https?://[^ ]+" green default +highlight article "^(Title):.*$" blue default +highlight article "\\[[0-9][0-9]*\\]" magenta default bold +highlight article "\\[image\\ [0-9]+\\]" green default bold +highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold +highlight article ":.*\\(link\\)$" cyan default +highlight article ":.*\\(image\\)$" blue default +highlight article ":.*\\(embedded flash\\)$" magenta default From 65b644d9b7c35b33210128a8bf4168ae8f957aec Mon Sep 17 00:00:00 2001 From: Alexandros Vasileiou Date: Mon, 4 May 2020 14:59:25 +0300 Subject: [PATCH 108/142] Changes to mpd.conf to support pulseaudio (#607) --- .config/mpd/mpd.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index c635183f..fa6a25c4 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -9,6 +9,8 @@ max_output_buffer_size "16384" audio_output { type "alsa" name "ALSA" + # type "pulse" # uncomment for pulseaudio + # name "pulse" # uncomment for pulseaudio } audio_output { From 4920a1b363b6b321204938d5f8d664f83e1ebbaf Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 4 May 2020 08:07:40 -0400 Subject: [PATCH 109/142] moonphase won't run if pom-perl not installed --- .local/bin/statusbar/moonphase | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index 12ed90bc..739b8a83 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -2,7 +2,7 @@ # Shows the current moon phase. Requires `pom-perl`. -mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') +mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') || exit 1 prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' ) case "$mnphs" in "New") icon="🌑" prcnt="0" ;; @@ -13,13 +13,12 @@ case "$mnphs" in "Waning Gibbous") icon="🌖" ;; "Last Quarter") icon="🌗" prcnt="50" ;; "Waning Crescent") icon="🌘" ;; - *) echo errorrrr ;; esac -case $BLOCK_BUTTON in +case ${BUTTON:-$BLOCK_BUTTON} in 1) $mnphs ;; 2) $mnphs ;; 3) notify-send " 🌜$(pom)" ;; esac -echo "$icon" "$prcnt"% +echo "${icon:?}" "$prcnt"% From d0b37d460035c36de52eac41e1b8e9f9b1a90730 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 4 May 2020 10:30:11 -0400 Subject: [PATCH 110/142] icons to sysact, hibernate for runit --- .local/bin/sysact | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index aaef4697..3ba1940d 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -3,11 +3,12 @@ # A dmenu wrapper script for system functions. cmds="\ -lock screen slock -leave dwm kill -TERM $(pidof -s dwm) -refresh dwm kill -HUP $(pidof -s dwm) -reboot sudo -A reboot -shutdown sudo -A shutdown -h now" +🔒 lock slock +🚪 leave dwm kill -TERM $(pidof -s dwm) +♻ renew dwm kill -HUP $(pidof -s dwm) +🐻 hibernate sudo -A zzz +🔃 reboot sudo -A reboot +🖥 shutdown sudo -A shutdown -h now" choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 From 3f20263444539b59a54fc43f027e2c39d0b5e69a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 4 May 2020 13:06:29 -0400 Subject: [PATCH 111/142] some systems use only lowercase? acpi option added --- .local/bin/statusbar/battery | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index 97868bbf..d3482798 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -12,12 +12,15 @@ case $BLOCK_BUTTON in ❗: battery very low!" ;; esac +# acpi alternative +# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /🔋/;s/[Nn]ot charging, /🛑/;s/[Cc]harging, /🔌/;s/[Uu]nknown, /♻️/;s/[Ff]ull, /⚡/;s/ \(remaining\|until charged\)//"; exit + # Loop through all attached batteries. for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. capacity=$(cat "$battery"/capacity) || break - status=$(sed "s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/" "$battery"/status) + status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. [ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗" From 674f8e1a7a17720031ae7ac66051d6c117363bd9 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 4 May 2020 17:24:39 -0400 Subject: [PATCH 112/142] =?UTF-8?q?music=20filter=20uses=20=E2=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/statusbar/music | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 1b187768..0cb97301 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -1,9 +1,6 @@ #!/bin/sh -filter() { - [ "$(pidof dwmblocks)" ] && sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/\\[paused\\] /g;s/\\[playing\\].*//" | tr -d '\n' | sed -e "s/\..*$//g" \ - || sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g" - } +filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | tr '\n' ' ' | sed 's/ $//' ;} case $BLOCK_BUTTON in 1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause @@ -16,4 +13,4 @@ case $BLOCK_BUTTON in 4) mpc prev | filter ;; # scroll up, previous 5) mpc next | filter ;; # scroll down, next *) mpc status | filter ;; -esac; exit +esac From d20ba524040a08ccb7c00db46db94db9600a861e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 4 May 2020 20:38:38 -0400 Subject: [PATCH 113/142] wrap less, ping is unnecessary --- .local/bin/statusbar/weather | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index a2ec518f..68d30a34 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -6,8 +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. -getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && -curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;} +getforecast() { curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum # precipication chance and the daily high and low from the downloaded file and @@ -18,7 +17,7 @@ sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\( # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; + 1) setsid "$TERMINAL" -e less -Sf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; 2) getforecast && showweather ;; 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. From 87dda7cdc350b06d9929c1569d0a6e8f3e8a2926 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 6 May 2020 09:50:00 -0400 Subject: [PATCH 114/142] systemd compatibility --- .local/bin/sysact | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 3ba1940d..a404257e 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -2,11 +2,15 @@ # A dmenu wrapper script for system functions. +case "$(readlink -f /sbin/init)" in + *runit-init) hib="sudo -A zzz" ;; +esac + cmds="\ 🔒 lock slock 🚪 leave dwm kill -TERM $(pidof -s dwm) ♻ renew dwm kill -HUP $(pidof -s dwm) -🐻 hibernate sudo -A zzz +🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate} 🔃 reboot sudo -A reboot 🖥 shutdown sudo -A shutdown -h now" From f08f4b0b7f8bf4c569f679f301313d563406b851 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 6 May 2020 14:34:33 -0400 Subject: [PATCH 115/142] openrc fixes --- .local/bin/sysact | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index a404257e..0a7cdd02 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -2,8 +2,10 @@ # A dmenu wrapper script for system functions. +# For non-systemd init systems. case "$(readlink -f /sbin/init)" in - *runit-init) hib="sudo -A zzz" ;; + *runit*) hib="sudo -A zzz" ;; + *openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p" ;; esac cmds="\ @@ -11,8 +13,8 @@ cmds="\ 🚪 leave dwm kill -TERM $(pidof -s dwm) ♻ renew dwm kill -HUP $(pidof -s dwm) 🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate} -🔃 reboot sudo -A reboot -🖥 shutdown sudo -A shutdown -h now" +🔃 reboot ${reb:-sudo -A reboot} +🖥 shutdown ${shut:-sudo -A shutdown -h now}" choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1 From 14fde603b7d85897b0322c3674bf494ae0346573 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 6 May 2020 19:54:42 -0400 Subject: [PATCH 116/142] fix for no wifi, use case statement --- .local/bin/statusbar/internet | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 518d6d7f..6fcd291e 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -13,7 +13,9 @@ case $BLOCK_BUTTON in " ;; esac -grep -q "down" /sys/class/net/w*/operstate && wifiicon="📡" || - wifiicon="$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')" +case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in + down) wifiicon="📡 " ;; + up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;; +esac -printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)" +printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" From baad9e0136890d8b894b0b0562466c112c5bcc43 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 7 May 2020 08:09:04 -0400 Subject: [PATCH 117/142] inbox search case insensitive --- .local/bin/statusbar/mailbox | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 06b622f0..ff7d522d 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -1,11 +1,10 @@ #!/bin/sh -# i3blocks mail module. # Displays number of unread mail and an loading icon if updating. # When clicked, brings up `neomutt`. case $BLOCK_BUTTON in - 1) "$TERMINAL" -e neomutt ;; + 1) setsid "$TERMINAL" -e neomutt & ;; 2) setsid mailsync >/dev/null & ;; 3) notify-send "📬 Mail module" "\- Shows unread mail - Shows 🔃 if syncing mail @@ -13,8 +12,8 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -unread="$(find ${XDG_DATA_HOME:-$HOME/.local/share}/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" +unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" -icon="$(cat "/tmp/imapsyncicon_$USER")" 2>/dev/null +icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" -[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$icon" From 33e329c8cb44679c37054d1823ef487c2569fcdc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 7 May 2020 17:31:42 -0400 Subject: [PATCH 118/142] statusbar scripts now open when shift-clicked weather module "fixed" other minor statusbar script tweaks --- .local/bin/statusbar/battery | 3 ++- .local/bin/statusbar/clock | 1 + .local/bin/statusbar/cpu | 1 + .local/bin/statusbar/crypto | 1 + .local/bin/statusbar/disk | 1 + .local/bin/statusbar/help-icon | 9 +++++---- .local/bin/statusbar/internet | 1 + .local/bin/statusbar/mailbox | 1 + .local/bin/statusbar/memory | 1 + .local/bin/statusbar/moonphase | 9 +++++---- .local/bin/statusbar/music | 13 +++++++------ .local/bin/statusbar/nettraf | 1 + .local/bin/statusbar/news | 1 + .local/bin/statusbar/pacpackages | 1 + .local/bin/statusbar/torrent | 14 ++++++++++---- .local/bin/statusbar/volume | 3 ++- .local/bin/statusbar/weather | 8 ++++---- 17 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index d3482798..a6fb62d1 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -4,12 +4,13 @@ # to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.). case $BLOCK_BUTTON in - 3) notify-send "🔋 Battery module" "🔋: discharging + 3) notify-send "🔋 Battery module" "🔋: discharging 🛑: not charging ♻: stagnant charge 🔌: charging ⚡: charged ❗: battery very low!" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac # acpi alternative diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 24412266..49cdc0b4 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -23,6 +23,7 @@ case $BLOCK_BUTTON in 2) setsid "$TERMINAL" -e calcurse -D ~/.config/calcurse & ;; 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac printf '%s %s%s\n' "$(date '+%Y %b %d (%a)')" "$icon" "$(date '+%I:%M%p')" diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index bd0c77a4..b26f9d9c 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -6,6 +6,7 @@ case $BLOCK_BUTTON in 3) notify-send "🖥 CPU module " "\- Shows CPU temperature. - Click to show intensive processes. - Middle click to open htop." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac sensors | awk '/Core 0/ {print "🌡", $3}' diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index 31e88b33..153e2fe3 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -48,6 +48,7 @@ case $BLOCK_BUTTON in - 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/bin/statusbar/disk b/.local/bin/statusbar/disk index 3e3f2e36..e947509d 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -11,6 +11,7 @@ case $BLOCK_BUTTON in 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; 3) notify-send "💽 Disk module" "\- Shows used hard drive space. - Click to show all disk info." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac case "$location" in diff --git a/.local/bin/statusbar/help-icon b/.local/bin/statusbar/help-icon index 4d8e3c21..9c90964a 100755 --- a/.local/bin/statusbar/help-icon +++ b/.local/bin/statusbar/help-icon @@ -9,8 +9,9 @@ ps ax | grep -q "\sdwm$" && restartwm() { i3 restart ;} case $BLOCK_BUTTON in - 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;; - 2) restartwm ;; - 3) notify-send "❓ Help module" "\- Left click to open LARBS guide. -- Middle click to refresh window manager.";; + 1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;; + 2) restartwm ;; + 3) notify-send "❓ Help module" "\- Left click to open LARBS guide. +- Middle click to refresh window manager." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac; echo "❓" diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 6fcd291e..94eb47f2 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -11,6 +11,7 @@ case $BLOCK_BUTTON in ❎: no ethernet 🌐: ethernet working " ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index ff7d522d..95603888 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -10,6 +10,7 @@ case $BLOCK_BUTTON in - Shows 🔃 if syncing mail - Left click opens neomutt - Middle click syncs mail" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index dce52684..66fcd8be 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -6,6 +6,7 @@ case $BLOCK_BUTTON in 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. - Click to show memory hogs. - Middle click to open htop." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}' diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index 739b8a83..2d9f91f1 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -15,10 +15,11 @@ case "$mnphs" in "Waning Crescent") icon="🌘" ;; esac -case ${BUTTON:-$BLOCK_BUTTON} in - 1) $mnphs ;; - 2) $mnphs ;; - 3) notify-send " 🌜$(pom)" ;; +case $BLOCK_BUTTON in + 1) $mnphs ;; + 2) $mnphs ;; + 3) notify-send " 🌜$(pom)" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac echo "${icon:?}" "$prcnt"% diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 0cb97301..6d22467b 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -3,14 +3,15 @@ filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | tr '\n' ' ' | sed 's/ $//' ;} case $BLOCK_BUTTON in - 1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause - 2) mpc toggle | filter ;; # right click, pause/unpause - 3) mpc status | filter && notify-send "🎵 Music module" "\- Shows mpd song playing. + 1) mpc status | filter ; setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause + 2) mpc toggle | filter ;; # right click, pause/unpause + 3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing. - Italic when paused. - Left click opens ncmpcpp. - Middle click pauses. - Scroll changes track.";; # right click, pause/unpause - 4) mpc prev | filter ;; # scroll up, previous - 5) mpc next | filter ;; # scroll down, next - *) mpc status | filter ;; + 4) mpc prev | filter ;; # scroll up, previous + 5) mpc next | filter ;; # scroll down, next + 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;; + *) mpc status | filter ;; esac diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index 64b239ff..bac22d87 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -7,6 +7,7 @@ case "$BLOCK_BUTTON" in 3) notify-send "🌐 Network traffic module" "🔻: Traffic received 🔺: Traffic transmitted" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 65ae7fd3..ffaadfbc 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -11,6 +11,7 @@ case $BLOCK_BUTTON in - Left click opens newsboat - Middle click syncs RSS feeds Note: Only one instance of newsboat (including updates) may be running at a time." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 5a8d6f3a..e61660c2 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -23,6 +23,7 @@ case $BLOCK_BUTTON in 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages - Left click to upgrade packages - Middle click to show upgradable packages" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g" diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 5095cd6a..99ed5c85 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -10,18 +10,24 @@ transmission-remote -l | grep % | s/.*%.*/M/g" | sort -h | uniq -c | sed " # Now we replace the standin letters with icons. s/A/🛑/g; - s/B/⌛️/g; + s/B/🕰/g; s/L/🔼/g; s/M/🔽/g; s/N/✅/g; s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//' case $BLOCK_BUTTON in - 1) $TERMINAL -e tremc ;; - 3) notify-send "Torrent module" "🛑: paused -⏳: idle (seeds needed) + 1) setsid "$TERMINAL" -e tremc & ;; + 2) td-toggle ;; + 3) notify-send "🌱 Torrent module" "\- Left click to open tremc. +- Middle click to toggle transmission. +- Shift click to edit script. +Module shows number of torrents: +🛑: paused +🕰: idle (seeds needed) 🔼: uploading (unfinished) 🔽: downloading ✅: done 🌱: done and seeding" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index 7580f200..8df98c8f 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -14,7 +14,8 @@ case $BLOCK_BUTTON in 5) pamixer --allow-boost -d 1 ;; 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. - Middle click to mute. -- Scroll to change." +- Scroll to change." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac volstat="$(pactl list sinks)" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 68d30a34..76a84d90 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -15,15 +15,15 @@ showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share} grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶",$1 "°","🌞",$2 "°"}' ;} -# The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e less -Sf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; - 2) getforecast && showweather ;; - 3) notify-send "🌈 Weather module" "\- Left click for full forecast. + 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; + 2) getforecast && showweather ;; + 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. ☔: Chance of rain/snow 🥶: Daily low 🌞: Daily high" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac # The test if our forcecast is updated to the day. If it isn't download a new From 26c92f886bb1b52b750727f66c4b5cf2ae910bac Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 9 May 2020 08:35:02 -0400 Subject: [PATCH 119/142] moonphase now has no deps statusbarinfo obsolete and deleted --- .local/bin/statusbar/moonphase | 46 +++++++++++++++++++----------- .local/bin/statusbar/statusbarinfo | 32 --------------------- 2 files changed, 29 insertions(+), 49 deletions(-) delete mode 100755 .local/bin/statusbar/statusbarinfo diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index 2d9f91f1..fab8b4da 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -1,25 +1,37 @@ #!/bin/sh -# Shows the current moon phase. Requires `pom-perl`. +# Shows the current moon phase. -mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') || exit 1 -prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' ) -case "$mnphs" in - "New") icon="🌑" prcnt="0" ;; - "Waxing Crescent") icon="🌒" ;; - "First Quarter") icon="🌓" prcnt="50" ;; - "Waxing Gibbous") icon="🌔" ;; - "Full") icon="🌕" prcnt="100" ;; - "Waning Gibbous") icon="🌖" ;; - "Last Quarter") icon="🌗" prcnt="50" ;; - "Waning Crescent") icon="🌘" ;; +moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase" + +[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || + { curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;} + +icon="$(cat "$moonfile")" + +case "$icon" in + 🌑) name="New" ;; + 🌒) name="Waxing Crescent" ;; + 🌓) name="First Quarter" ;; + 🌔) name="Waxing Gibbous" ;; + 🌕) name="Full" ;; + 🌖) name="Waning Gibbous" ;; + 🌗) name="Last Quarter" ;; + 🌘) name="Waning Crescent" ;; + *) exit 1 ;; esac +echo "${icon-?}" + case $BLOCK_BUTTON in - 1) $mnphs ;; - 2) $mnphs ;; - 3) notify-send " 🌜$(pom)" ;; + 3) notify-send "🌜 Moon phase module" "Displays current moon phase. +- 🌑: New +- 🌒: Waxing Crescent +- 🌓: First Quarter +- 🌔: Waxing Gibbous +- 🌕: Full +- 🌖: Waning Gibbous +- 🌗: Last Quarter +- 🌘: Waning Crescent" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac - -echo "${icon:?}" "$prcnt"% diff --git a/.local/bin/statusbar/statusbarinfo b/.local/bin/statusbar/statusbarinfo deleted file mode 100755 index 2b3e58cf..00000000 --- a/.local/bin/statusbar/statusbarinfo +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -echo " - ____ _ _ _ -/ ___|| |_ __ _| |_ _ _ ___| |__ __ _ _ __ -\___ \| __/ _\` | __| | | / __| '_ \ / _\` | '__| - ___) | || (_| | |_| |_| \__ \ |_) | (_| | | -|____/ \__\__,_|\__|\__,_|___/_.__/ \__,_|_| - -This is a list of the statusbar modules. - -📦5 \033[31mpacpackages\033[0m: updatable packages (must have pacman -Sy run in root cronjob to check). -📰 41 \033[32mnews\033[0m: unread RSS entries in newsboat. -☔ 83% ❄️ 69° 🌞 80° \033[33mweather\033[0m: ☔ for precipitation, 🌞 and ❄ for daily high and low. -📬 20 \033[34mmailbox\033[0m: number of unread mail if mutt-wizard is active. -🔉 62% \033[35mvolume\033[0m: master sink volume. -🔌83% \033[36mbattery\033[0m: 🔌 for charging, 🔋 for discharging, ⚡ for full. -📶 80% ❎ \033[37minternet\033[0m: 📶 for wifi with % (📡 if none), 🌐 for ethernet. (❎ if none). - -Obviously the time and date are displayed as well. - -Optional script modules: - -Edit \033[32m~/.local/src/dwmblocks/config.h\033[0m to add these or your own if you'd like (and recompile and restart dwmblocks). - -'memory' 🧠 559Mi/3.7Gi Current used memory/total memory. -'cpu' 🌡 +46.0°C CPU temperature. -'disk' 🖥 : 28G/30G Remaining disk space... -'disk ~' 🏠: 641G/850G ...can be given directory argument. -'moonphase' 🌕 39% Phase of the moon (requires \033[32m\`pom-perl\`\033[0m). -'iplocate' 🇺🇸 United States Your own or VPN location (requires \033[32m\`geoiplookup\`\033[0m). -" | less From 28c0ab6294c6dce67577294b02062a2aa5916d37 Mon Sep 17 00:00:00 2001 From: Bryan Jenks Date: Sat, 9 May 2020 05:40:02 -0700 Subject: [PATCH 120/142] new line needed to work on i3 (#621) i was fiddling with the block settings and couldnt get it to display on i3 until i just added the new line. also tested on the dwm build, module acts as it should on dem with this change --- .local/bin/statusbar/crypto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index 153e2fe3..2e37f133 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -29,7 +29,7 @@ printprices() { # Print/format all prices [ -f "$x" ] || break info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")" printf "%s $%0.2f " $info - done | sed 's/ $//' + done | sed "s/ $/\n/" } [ ! -d "$dir" ] && mkdir -p "$dir" && { getprices; exit ;} From 4f622e6d2b41a0c801a7d09971815d17c9b26517 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 9 May 2020 10:01:42 -0400 Subject: [PATCH 121/142] pulse default in mpd --- .config/mpd/mpd.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index fa6a25c4..bf329d61 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -7,10 +7,10 @@ restore_paused "yes" max_output_buffer_size "16384" audio_output { - type "alsa" - name "ALSA" - # type "pulse" # uncomment for pulseaudio - # name "pulse" # uncomment for pulseaudio + type "pulse" + name "pulse" + #type "alsa" + #name "ALSA" } audio_output { From 2b6b3822e32b11f3f6bf65cd64d4801bdacb0173 Mon Sep 17 00:00:00 2001 From: karioki Date: Sat, 9 May 2020 14:31:25 +0000 Subject: [PATCH 122/142] Placing NERDTree bookmark file not on home dir (#624) --- .config/nvim/init.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 9342fa98..48635a4a 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -51,6 +51,11 @@ set clipboard+=unnamedplus " Nerd tree map n :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + if has('nvim') + let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks' + else + let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks' + endif " vimling: nm d :call ToggleDeadKeys() From 6577acae890e18dc99244599fc85fa31053e400e Mon Sep 17 00:00:00 2001 From: Kian Kasad Date: Sat, 9 May 2020 16:32:56 -0700 Subject: [PATCH 123/142] replace `tr '\n' 'CHAR'` with `paste -sd 'CHAR'` (#625) --- .local/bin/displayselect | 2 +- .local/bin/statusbar/music | 2 +- .local/bin/statusbar/nettraf | 4 ++-- .local/bin/statusbar/torrent | 2 +- .zprofile | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 02b35c2c..57120ec2 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -53,7 +53,7 @@ multimon() { # Multi-monitor handler. esac ;} onescreen() { # If only one output available or chosen. - xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') + xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ') } postrun() { # Stuff to run to clean up. diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 6d22467b..8c60919c 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -1,6 +1,6 @@ #!/bin/sh -filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | tr '\n' ' ' | sed 's/ $//' ;} +filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ';} case $BLOCK_BUTTON in 1) mpc status | filter ; setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index bac22d87..d96d9791 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -13,8 +13,8 @@ esac rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog" txfile="${XDG_CACHE_HOME:-$HOME/.cache}/txlog" -rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | tr '\n' '+' | sed 's/+$/\n/' | bc)" -txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | tr '\n' '+' | sed 's/+$/\n/' | bc)" +rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | paste -sd '+' | bc)" +txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | paste -sd '+' | bc)" printf "🔻%skB 🔺%skB\\n" \ "$(printf -- "(%s-%s)/1024\\n" "$rxcurrent" "$(cat "$rxfile")" | bc)" \ diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 99ed5c85..a550c621 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -14,7 +14,7 @@ transmission-remote -l | grep % | s/L/🔼/g; s/M/🔽/g; s/N/✅/g; - s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//' + s/Z/🌱/g" | awk '{print $2, $1}' | paste -sd ' ' case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e tremc & ;; diff --git a/.zprofile b/.zprofile index 20c9a821..de77ad10 100644 --- a/.zprofile +++ b/.zprofile @@ -6,7 +6,7 @@ # to clean up. # Adds `~/.local/bin` to $PATH -export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')" +export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')" # Default programs: export EDITOR="nvim" From 8f05c7d79f91783d2cafe00a7d479eef9d652e8a Mon Sep 17 00:00:00 2001 From: Vlad Doster Date: Sun, 10 May 2020 06:58:09 -0500 Subject: [PATCH 124/142] Status bar fixes for nettraf and memory (#627) * More precise RAM measurement and fix of memory type * Should be KiB kB refers to https://en.wikipedia.org/wiki/Kibibyte --- .local/bin/statusbar/memory | 2 +- .local/bin/statusbar/nettraf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index 66fcd8be..0d64508d 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -9,4 +9,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -free -h | sed -n '2{p;q}' | awk '{print "🧠", $3 "/" $2}' +free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠 %2.2fGiB/%2.2fGiB", ( $3 / 1024), ($2 / 1024))}' diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index d96d9791..3c41dfc7 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -16,7 +16,7 @@ txfile="${XDG_CACHE_HOME:-$HOME/.cache}/txlog" rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | paste -sd '+' | bc)" txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | paste -sd '+' | bc)" -printf "🔻%skB 🔺%skB\\n" \ +printf "🔻%sKiB 🔺%sKiB\\n" \ "$(printf -- "(%s-%s)/1024\\n" "$rxcurrent" "$(cat "$rxfile")" | bc)" \ "$(printf -- "(%s-%s)/1024\\n" "$txcurrent" "$(cat "$txfile")" | bc)" From 74421a25b535443b03cb8e7ebdc03d8b148fa5ab Mon Sep 17 00:00:00 2001 From: Vitor Silvestri Date: Wed, 13 May 2020 12:47:29 -0300 Subject: [PATCH 125/142] Update transadd (#633) * Update transadd When transmission daemon is closed and the user wants to add a torrent, it needs to try to add the torrent two times, the first time for opening the daemon, and the second time for adding the torrent Removing the ampersand fix this, enabling one click for both starting the daemon and adding the torrent * fix typo --- .local/bin/transadd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/transadd b/.local/bin/transadd index 1b9599ed..a598fad3 100755 --- a/.local/bin/transadd +++ b/.local/bin/transadd @@ -4,6 +4,6 @@ # transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep. -pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") & +pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") transmission-remote -a "$@" && notify-send "🔽 Torrent added." From bc031c2a176f3516789f3558fe3e8586ad96d213 Mon Sep 17 00:00:00 2001 From: Vlad Doster Date: Wed, 13 May 2020 15:36:47 -0500 Subject: [PATCH 126/142] Update files (#631) --- .config/files | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/files b/.config/files index 6e074998..235762fe 100644 --- a/.config/files +++ b/.config/files @@ -4,6 +4,7 @@ bw ${XDG_CONFIG_HOME:-$HOME/.config}/bookmarks cfa ${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc cfz $ZDOTDIR/.zshrc cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim +cft ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/.tmux.conf cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc cfx ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls From 37c754477ab8375ad3ae91103fe070b37c60fd0c Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 13 May 2020 16:40:52 -0400 Subject: [PATCH 127/142] fix for java applications in dwm --- .zprofile | 1 + 1 file changed, 1 insertion(+) diff --git a/.zprofile b/.zprofile index de77ad10..d9e95b7e 100644 --- a/.zprofile +++ b/.zprofile @@ -53,6 +53,7 @@ export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. export _JAVA_AWT_WM_NONREPARENTING=1 # Java doesn't understand tiling windows export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname +export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm # This is the list for lf icons: export LF_ICONS="di=📁:\ From b8b9b420f9579174369c4eeecea99e545dfd24f6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 13 May 2020 18:12:44 -0400 Subject: [PATCH 128/142] don't skip color change since it is now fixed --- .local/bin/setbg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/setbg b/.local/bin/setbg index ea35e163..5f70fa54 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -14,7 +14,7 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" [ -d "$1" ] && ln -sf "$(find "$(readlink -f "$1")" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." # If pywal is installed, use it. -wal -s -i "$(readlink -f "$bgloc")" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 +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 xwallpaper --zoom "$bgloc" From 7378817a1a67d02e8e1a0cb8413f5a729b0e7ab6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 14 May 2020 03:31:41 -0400 Subject: [PATCH 129/142] duplicate --- .zprofile | 1 - 1 file changed, 1 deletion(-) diff --git a/.zprofile b/.zprofile index d9e95b7e..57b1628f 100644 --- a/.zprofile +++ b/.zprofile @@ -51,7 +51,6 @@ export LESS_TERMCAP_ue="$(printf '%b' '')" export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. -export _JAVA_AWT_WM_NONREPARENTING=1 # Java doesn't understand tiling windows export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm From 4dbff2873df8e2b13ecff74beb17c32ef3c3267a Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Sat, 16 May 2020 16:15:05 +0200 Subject: [PATCH 130/142] Now moonphase is correct and even more precise (#637) As described in issue #636 using wttr.in was incorerct by 16% Now the `~/.local/share/moonphase` looks ugly, so dont look at it. --- .local/bin/statusbar/moonphase | 38 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index fab8b4da..e90dc777 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -5,33 +5,25 @@ moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase" [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || - { curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;} + { curl -sf 'https://www.timeanddate.com/moon/phases/' | grep -m1 -o cur-moon-percent.......................................................................................................................................................... > "$moonfile" || exit 1 ;} -icon="$(cat "$moonfile")" - -case "$icon" in - 🌑) name="New" ;; - 🌒) name="Waxing Crescent" ;; - 🌓) name="First Quarter" ;; - 🌔) name="Waxing Gibbous" ;; - 🌕) name="Full" ;; - 🌖) name="Waning Gibbous" ;; - 🌗) name="Last Quarter" ;; - 🌘) name="Waning Crescent" ;; - *) exit 1 ;; +mnphs=$( cat $moonfile | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') +prcnt=$( cat $moonfile | grep -o "[0-9.0-9]*%" | grep -o "[0-9.0-9]*" ) +case "$mnphs" in + "New") icon="🌑" prcnt="0" ;; + "Waxing Crescent") icon="🌒" ;; + "First Quarter") icon="🌓" prcnt="50" ;; + "Waxing Gibbous") icon="🌔" ;; + "Full") icon="🌕" prcnt="100" ;; + "Waning Gibbous") icon="🌖" ;; + "Last Quarter") icon="🌗" prcnt="50" ;; + "Waning Crescent") icon="🌘" ;; + *) echo exit 1 ;; esac -echo "${icon-?}" +echo ""$icon" "$prcnt"%" case $BLOCK_BUTTON in - 3) notify-send "🌜 Moon phase module" "Displays current moon phase. -- 🌑: New -- 🌒: Waxing Crescent -- 🌓: First Quarter -- 🌔: Waxing Gibbous -- 🌕: Full -- 🌖: Waning Gibbous -- 🌗: Last Quarter -- 🌘: Waning Crescent" ;; + 3) notify-send "🌜 Moon phase module" "$icon: $mnphs $prcnt" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac From a00e42e292781e375c02454674155c40aa5e480d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 16 May 2020 10:29:28 -0400 Subject: [PATCH 131/142] Revert "Now moonphase is correct and even more precise (#637)" This reverts commit 4dbff2873df8e2b13ecff74beb17c32ef3c3267a. --- .local/bin/statusbar/moonphase | 38 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase index e90dc777..fab8b4da 100755 --- a/.local/bin/statusbar/moonphase +++ b/.local/bin/statusbar/moonphase @@ -5,25 +5,33 @@ moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase" [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || - { curl -sf 'https://www.timeanddate.com/moon/phases/' | grep -m1 -o cur-moon-percent.......................................................................................................................................................... > "$moonfile" || exit 1 ;} + { curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;} -mnphs=$( cat $moonfile | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') -prcnt=$( cat $moonfile | grep -o "[0-9.0-9]*%" | grep -o "[0-9.0-9]*" ) -case "$mnphs" in - "New") icon="🌑" prcnt="0" ;; - "Waxing Crescent") icon="🌒" ;; - "First Quarter") icon="🌓" prcnt="50" ;; - "Waxing Gibbous") icon="🌔" ;; - "Full") icon="🌕" prcnt="100" ;; - "Waning Gibbous") icon="🌖" ;; - "Last Quarter") icon="🌗" prcnt="50" ;; - "Waning Crescent") icon="🌘" ;; - *) echo exit 1 ;; +icon="$(cat "$moonfile")" + +case "$icon" in + 🌑) name="New" ;; + 🌒) name="Waxing Crescent" ;; + 🌓) name="First Quarter" ;; + 🌔) name="Waxing Gibbous" ;; + 🌕) name="Full" ;; + 🌖) name="Waning Gibbous" ;; + 🌗) name="Last Quarter" ;; + 🌘) name="Waning Crescent" ;; + *) exit 1 ;; esac -echo ""$icon" "$prcnt"%" +echo "${icon-?}" case $BLOCK_BUTTON in - 3) notify-send "🌜 Moon phase module" "$icon: $mnphs $prcnt" ;; + 3) notify-send "🌜 Moon phase module" "Displays current moon phase. +- 🌑: New +- 🌒: Waxing Crescent +- 🌓: First Quarter +- 🌔: Waxing Gibbous +- 🌕: Full +- 🌖: Waning Gibbous +- 🌗: Last Quarter +- 🌘: Waning Crescent" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac From c948c8b56ff15156cd88703ee8ba379042202a5f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 17 May 2020 16:19:28 -0400 Subject: [PATCH 132/142] xprofile in normal location --- .config/xprofile | 21 --------------------- .xprofile | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 22 deletions(-) delete mode 100755 .config/xprofile mode change 120000 => 100755 .xprofile diff --git a/.config/xprofile b/.config/xprofile deleted file mode 100755 index 92861d16..00000000 --- a/.config/xprofile +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# 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. - -# This file's true location is in ~/.config/xprofile and a link exists to it in -# ~/.xprofile. If you do not use a DM, you may remove the link to it to have a -# cleaner home. - -# Fix Gnome Apps Slow Start due to failing services -# Add this when you include flatpak in your system -dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY - -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}/Xresources & # Uncomment to use Xresources colors/settings on startup -xcompmgr & # xcompmgr for transparency -dunst & # dunst for notifications -xset r rate 300 50 & # Speed xrate up -unclutter & # Remove mouse when idle diff --git a/.xprofile b/.xprofile deleted file mode 120000 index c0008966..00000000 --- a/.xprofile +++ /dev/null @@ -1 +0,0 @@ -.config/xprofile \ No newline at end of file diff --git a/.xprofile b/.xprofile new file mode 100755 index 00000000..861443b8 --- /dev/null +++ b/.xprofile @@ -0,0 +1,17 @@ +#!/bin/sh + +# 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. + +# Fix Gnome Apps Slow Start due to failing services +# Add this when you include flatpak in your system +dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY + +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}/Xresources & # Uncomment to use Xresources colors/settings on startup +xcompmgr & # xcompmgr for transparency +dunst & # dunst for notifications +xset r rate 300 50 & # Speed xrate up +unclutter & # Remove mouse when idle From c9f0d747a80fb95be6efc4d50fd94baa6a02809f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 17 May 2020 17:24:21 -0400 Subject: [PATCH 133/142] fix --- .config/xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/xinitrc b/.config/xinitrc index e636c90d..f38086e8 100755 --- a/.config/xinitrc +++ b/.config/xinitrc @@ -10,7 +10,7 @@ # export STATUSBAR="i3blocks" # Uncomment this line when using i3. -[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/xprofile" +. ~/.xprofile # Your default LARBS WM is determined in your `~/.profile` on login. Here we # run the proper command to run when the graphical environment starts. From 2db8755f04e6eb33e56a62d8bc26cc7a69c559a5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 21 May 2020 19:26:08 -0400 Subject: [PATCH 134/142] alsa junk rm'd --- .config/alsa/asoundrc | 21 --------------------- .zprofile | 1 - 2 files changed, 22 deletions(-) delete mode 100644 .config/alsa/asoundrc diff --git a/.config/alsa/asoundrc b/.config/alsa/asoundrc deleted file mode 100644 index 38722f08..00000000 --- a/.config/alsa/asoundrc +++ /dev/null @@ -1,21 +0,0 @@ -# Find and use input "Microphone" for input -pcm.usb -{ - type hw - card Microphone -} -pcm.!default -{ - type asym - playback.pcm - { - # Use the dmix plug to allow multiple outputs. - type plug - slave.pcm "dmix" - } - capture.pcm - { - type plug - slave.pcm "usb" - } -} diff --git a/.zprofile b/.zprofile index 57b1628f..8a7d2764 100644 --- a/.zprofile +++ b/.zprofile @@ -25,7 +25,6 @@ export LESSHISTFILE="-" export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc" export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" -export ALSA_CONFIG_PATH="$XDG_CONFIG_HOME/alsa/asoundrc" #export GNUPGHOME="$XDG_DATA_HOME/gnupg" export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default" export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi" From 7f3437710586fd7a019e9524fcf8ab7f38ab6ef8 Mon Sep 17 00:00:00 2001 From: Dennis Lee Date: Sun, 24 May 2020 10:13:27 -0700 Subject: [PATCH 135/142] run preconv and pipe its output into refer to prevent unicode problems (#647) * compiler: preconv to prevent `refer` unicode error * compiler: fix formatting --- .local/bin/compiler | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index 0f693d27..51d14f5e 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -20,17 +20,17 @@ textype() { \ biber --input-directory "$dir" "$base" && $command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" - } +} case "$file" in - *\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf > "$base".pdf ;; - *\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;; - *\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;; + *\.ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;; + *\.mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;; + *\.[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; *\.[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;; *\.tex) textype "$file" ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *config.h) sudo make install ;; - *\.c) cc "$file" -o "$base" && "$base" ;; + *\.c) cc "$file" -o "$base" && "$base" ;; *\.py) python "$file" ;; *\.m) octave "$file" ;; *\.scad) openscad -o "$base".stl "$file" ;; From dbfb6705a75d80ae26dcaa9c90a6549d41a6aea5 Mon Sep 17 00:00:00 2001 From: build2stone Date: Mon, 25 May 2020 19:48:01 +0200 Subject: [PATCH 136/142] Fix sxiv .desktop file (#648) Would previously error out as such: Opening "" with Image viewer (image/jpeg) sxiv: file:// sxiv: No valid image file given, aborting --- .local/share/applications/img.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/share/applications/img.desktop b/.local/share/applications/img.desktop index d1582a5e..42aa81e0 100644 --- a/.local/share/applications/img.desktop +++ b/.local/share/applications/img.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application Name=Image viewer -Exec=/usr/bin/sxiv -a %u +Exec=/usr/bin/sxiv -a %f From c075127aaee99d072fdb887c0986fd6dc5c8c533 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 17:06:24 -0400 Subject: [PATCH 137/142] no spaces between icons and content --- .local/bin/statusbar/clock | 5 +---- .local/bin/statusbar/cpu | 2 +- .local/bin/statusbar/crypto | 4 ++-- .local/bin/statusbar/internet | 2 +- .local/bin/statusbar/mailbox | 2 +- .local/bin/statusbar/memory | 2 +- .local/bin/statusbar/news | 2 +- .local/bin/statusbar/torrent | 2 +- .local/bin/statusbar/volume | 2 +- .local/bin/statusbar/weather | 4 ++-- 10 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 49cdc0b4..431a7f09 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -26,7 +26,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -printf '%s %s%s\n' "$(date '+%Y %b %d (%a)')" "$icon" "$(date '+%I:%M%p')" - -#for europeans, use this -#printf '%s %s%s\n' "$(date '+%a %d/%m')" "$icon" "$(date '+%I:%M%p')" +date "+%Y %b %d (%a) $icon%I:%M%p" diff --git a/.local/bin/statusbar/cpu b/.local/bin/statusbar/cpu index b26f9d9c..9225c1e8 100755 --- a/.local/bin/statusbar/cpu +++ b/.local/bin/statusbar/cpu @@ -9,4 +9,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -sensors | awk '/Core 0/ {print "🌡", $3}' +sensors | awk '/Core 0/ {print "🌡" $3}' diff --git a/.local/bin/statusbar/crypto b/.local/bin/statusbar/crypto index 2e37f133..bb19fc94 100755 --- a/.local/bin/statusbar/crypto +++ b/.local/bin/statusbar/crypto @@ -28,8 +28,8 @@ 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/" + printf "%s$%0.2f " $info + done | sed 's/ $/\n/' } [ ! -d "$dir" ] && mkdir -p "$dir" && { getprices; exit ;} diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index 94eb47f2..d8bd8969 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -4,7 +4,7 @@ # Show 🌐 if connected to ethernet or ❎ if none. case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e nmtui & ;; + 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; 3) notify-send "🌐 Internet module" "\- Click to connect 📡: no wifi connection 📶: wifi connection with quality diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 95603888..d04b9718 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -17,4 +17,4 @@ unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" -[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$icon" +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon" diff --git a/.local/bin/statusbar/memory b/.local/bin/statusbar/memory index 0d64508d..07a0f41b 100755 --- a/.local/bin/statusbar/memory +++ b/.local/bin/statusbar/memory @@ -9,4 +9,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠 %2.2fGiB/%2.2fGiB", ( $3 / 1024), ($2 / 1024))}' +free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index ffaadfbc..69d9bf32 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰" $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index a550c621..e9e7fce3 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -14,7 +14,7 @@ transmission-remote -l | grep % | s/L/🔼/g; s/M/🔽/g; s/N/✅/g; - s/Z/🌱/g" | awk '{print $2, $1}' | paste -sd ' ' + s/Z/🌱/g" | awk '{print $2 $1}' | paste -sd ' ' case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e tremc & ;; diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index 8df98c8f..b64744ff 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -35,4 +35,4 @@ else icon="🔉" fi -printf "%s %s%%\\n" "$icon" "$vol" +printf "%s%s%%\\n" "$icon" "$vol" diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 76a84d90..2599e915 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -12,8 +12,8 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/sh # precipication chance and the daily high and low from the downloaded file and # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | - grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶",$1 "°","🌞",$2 "°"}' ;} + grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')" +sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;} case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;; From bad0b625a65e2e758d47a4f0a21eea0321f59838 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 20:23:06 -0400 Subject: [PATCH 138/142] new crypto statusbar script for individual ammounts and historical chart --- .local/bin/statusbar/price | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 .local/bin/statusbar/price diff --git a/.local/bin/statusbar/price b/.local/bin/statusbar/price new file mode 100755 index 00000000..325f9770 --- /dev/null +++ b/.local/bin/statusbar/price @@ -0,0 +1,34 @@ +#!/bin/sh + +# Usage: +# price +# price bat "Basic Attention Token" 🦁 +# When the name of the currency is multi-word, put it in quotes. + +[ -z "$3" ] && exit 1 +interval="@7d" # History contained in chart preceded by '@' (7d = 7 days) + +# Directory where currency info is stored. +dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" +pricefile="$dir/$1" +chartfile="$dir/$1-chart" + +[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && + { ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && curl -s "rate.sx/1$1" > "$pricefile" || exit ;} + +[ "$(stat -c %x "$chartfile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && + { ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && curl -s "rate.sx/$1$interval" > "$chartfile" || exit ;} + +case $BLOCK_BUTTON in + 1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;; + 3) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")" + notify-send "$3 $2 module" "\- Exact price: \$$(cat "$price") +- Left click for chart of changes. +- Middle click to update. +- Shows 🔃 if updating prices. +- Last updated: + $uptime" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +printf "$3$%0.2f" "$(cat "$pricefile")" From 06fb70a6cbff9513c6e0db5f050a4cde7e2ab453 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 20:28:19 -0400 Subject: [PATCH 139/142] autocreate dir and show price before getting chart --- .local/bin/statusbar/price | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/statusbar/price b/.local/bin/statusbar/price index 325f9770..54cdb9d2 100755 --- a/.local/bin/statusbar/price +++ b/.local/bin/statusbar/price @@ -7,15 +7,17 @@ [ -z "$3" ] && exit 1 interval="@7d" # History contained in chart preceded by '@' (7d = 7 days) - -# Directory where currency info is stored. dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices" pricefile="$dir/$1" chartfile="$dir/$1-chart" +[ -d "$dir" ] || mkdir -p "$dir" + [ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && { ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && curl -s "rate.sx/1$1" > "$pricefile" || exit ;} +printf "$3$%0.2f" "$(cat "$pricefile")" + [ "$(stat -c %x "$chartfile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] && { ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && curl -s "rate.sx/$1$interval" > "$chartfile" || exit ;} @@ -30,5 +32,3 @@ case $BLOCK_BUTTON in $uptime" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac - -printf "$3$%0.2f" "$(cat "$pricefile")" From 31f26c73b08bfbe112228c743631e9534ed6b75d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 20:52:08 -0400 Subject: [PATCH 140/142] use pidof to check for syncs --- .local/bin/statusbar/mailbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index d04b9718..8f87d757 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -15,6 +15,6 @@ esac unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" -icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" +pidof mbsync >/dev/null 2>&1 && icon="🔃" [ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon" From 7f58bbb22d847ffe93347652e5742b3aac63ebd2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 21:29:12 -0400 Subject: [PATCH 141/142] little fixes --- .local/bin/statusbar/price | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/price b/.local/bin/statusbar/price index 54cdb9d2..953df3b0 100755 --- a/.local/bin/statusbar/price +++ b/.local/bin/statusbar/price @@ -23,8 +23,8 @@ printf "$3$%0.2f" "$(cat "$pricefile")" case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;; - 3) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")" - notify-send "$3 $2 module" "\- Exact price: \$$(cat "$price") + 3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")" + notify-send "$3 $2 module" "\- Exact price: \$$(cat "$pricefile") - Left click for chart of changes. - Middle click to update. - Shows 🔃 if updating prices. From c153ac7fb427cf517db6d5e5bff0857ee894d407 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 26 May 2020 07:22:06 -0400 Subject: [PATCH 142/142] mpd-module-update now mpdup it is autostarted by the music module if not already running --- .local/bin/{mpd-module-update => statusbar/mpdup} | 2 +- .local/bin/statusbar/music | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) rename .local/bin/{mpd-module-update => statusbar/mpdup} (70%) diff --git a/.local/bin/mpd-module-update b/.local/bin/statusbar/mpdup similarity index 70% rename from .local/bin/mpd-module-update rename to .local/bin/statusbar/mpdup index ced910ff..af81a7d6 100755 --- a/.local/bin/mpd-module-update +++ b/.local/bin/statusbar/mpdup @@ -4,5 +4,5 @@ # music player's status. mpd must be running on X's start for this to work. while : ; do - mpc idle >/dev/null && pkill -RTMIN+11 "${STATUSBAR:-dwmblocks}" || break + mpc idle >/dev/null && kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" || break done diff --git a/.local/bin/statusbar/music b/.local/bin/statusbar/music index 8c60919c..54eced50 100755 --- a/.local/bin/statusbar/music +++ b/.local/bin/statusbar/music @@ -2,6 +2,8 @@ filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ';} +pidof -x mpdup >/dev/null 2>&1 || mpdup & + case $BLOCK_BUTTON in 1) mpc status | filter ; setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause 2) mpc toggle | filter ;; # right click, pause/unpause