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 01/76] 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 02/76] 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 03/76] 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 04/76] 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 05/76] 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 06/76] 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 07/76] 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 08/76] 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 09/76] 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 10/76] 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 11/76] 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 12/76] 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 13/76] 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 14/76] 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 15/76] 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 16/76] 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 17/76] 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 18/76] 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 19/76] 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 20/76] 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 21/76] 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 22/76] 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 23/76] 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 24/76] 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 25/76] 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 26/76] 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 27/76] 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 28/76] 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 29/76] 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 30/76] 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 31/76] 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 32/76] 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 33/76] 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 34/76] 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 35/76] 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 36/76] 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 37/76] 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 38/76] 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 39/76] 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 40/76] 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 41/76] 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 42/76] 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 43/76] 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 44/76] 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 45/76] 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 46/76] 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 47/76] 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 48/76] 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 49/76] 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 50/76] $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 51/76] 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 52/76] 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 53/76] 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 54/76] 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 55/76] 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 56/76] 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 57/76] 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 58/76] 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 59/76] 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 60/76] 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 61/76] 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 62/76] 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 63/76] 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 64/76] 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 65/76] 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 66/76] =?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 67/76] 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 68/76] 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 69/76] 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 70/76] 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 71/76] 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 72/76] 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 73/76] 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 74/76] 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 75/76] 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 76/76] 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()