From a30f0aac45a866c2e6bde797d83e93fb12ee165b Mon Sep 17 00:00:00 2001 From: Conrado Fonseca Date: Wed, 26 Aug 2020 22:48:09 +0100 Subject: [PATCH 01/36] Reduce escape delay time in tmux (#802) --- .config/tmux/tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 6d85cc70..d7e74f73 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -12,6 +12,7 @@ setw -g automatic-rename set -g mouse on set -g history-limit 30000 set -g terminal-overrides 'xterm*:smcup@:rmcup@' +set -sg escape-time 20 # faster escape delay time set-option -g status-justify right set-option -g status-bg black # colour213 # pink set-option -g status-fg cyan From 3aa5f8bd4e443915570cf74c4f586b5019757423 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Aug 2020 15:31:23 -0400 Subject: [PATCH 02/36] recommend git version --- .zprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zprofile b/.zprofile index 2d2f3674..e7b62f61 100644 --- a/.zprofile +++ b/.zprofile @@ -136,7 +136,7 @@ if pacman -Qs libxft-bgra >/dev/null 2>&1; then else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: - \033[32myay -S libxft-bgra\033[0m + \033[32myay -S libxft-bgra-git\033[0m and replace \`libxft\`" fi From ec7d7bfec48fd4735db04a44fefaef15f4c6b0ed Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Aug 2020 15:46:23 -0400 Subject: [PATCH 03/36] webcam dox --- .local/share/larbs/readme.mom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/share/larbs/readme.mom b/.local/share/larbs/readme.mom index fb8feb8b..c759c5b3 100644 --- a/.local/share/larbs/readme.mom +++ b/.local/share/larbs/readme.mom @@ -241,7 +241,7 @@ previous recordings as their names are based on their exact times. .ITEM \f(CWMod+Delete\fP \(en Kills any recording started in the above way. .ITEM -\f(CWMod+Shift+c\fP \(en Toggles a webcam in the bottom right for screencasting. +\f(CWMod+F11\fP \(en Opens up a webcam window for screencasting. .ITEM \f(CWMod+ScrollLock\fP \(en Toggle screenkey (if installed) to show keypresses .LIST OFF From 435f0e5f526c12cc3f70ad9025d861270de78ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Thu, 27 Aug 2020 21:54:36 +0200 Subject: [PATCH 04/36] add videos.lukesmith.xyz to linkhandler script (#792) since mpv can handle peertube videos, it would be best to open video links in e. g. newsboat with mpv. --- .local/bin/linkhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 7c7e96f7..ee5d1705 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -10,7 +10,7 @@ [ -z "$1" ] && { "$BROWSER"; exit; } case "$1" in - *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*) + *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*) setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif) curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; From 5fd9637eb7345c2e68ec9a2b5c3116292e7f57e7 Mon Sep 17 00:00:00 2001 From: build2stone Date: Thu, 27 Aug 2020 21:55:17 +0200 Subject: [PATCH 05/36] Improve rotdir script (#789) Now doesn't interpret file name as regex pattern. --- .local/bin/rotdir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/rotdir b/.local/bin/rotdir index 7313a424..86da6dbe 100755 --- a/.local/bin/rotdir +++ b/.local/bin/rotdir @@ -9,4 +9,4 @@ [ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 base="$(basename "$1")" - ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }" +ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }' From ca9b3952e6481903cdb47810933765fb2cd1ab27 Mon Sep 17 00:00:00 2001 From: anntnzrb <51257127+anntnzrb@users.noreply.github.com> Date: Thu, 27 Aug 2020 14:57:16 -0500 Subject: [PATCH 06/36] Exit codes, stderr suppression, minor edits (#788) This is a re-attempt of #643 - `[ "$archive" = "" ]` may be replaced with `[ -z "$archive" ]` - added exit codes - upon entering `ext -c` with no arguments stderr will be thrown from readlink, should be suppressed --- .local/bin/ext | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/ext b/.local/bin/ext index c5f89c5d..806ce5e2 100755 --- a/.local/bin/ext +++ b/.local/bin/ext @@ -8,19 +8,19 @@ while getopts "hc" o; do case "${o}" in c) extracthere="True" ;; - *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;; + *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit 1 ;; esac done if [ -z "$extracthere" ]; then archive="$(readlink -f "$*")" && directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" && mkdir -p "$directory" && - cd "$directory" || exit + cd "$directory" || exit 1 else - archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")" + archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)" 2>/dev/null)" fi -[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit +[ -z "$archive" ] && printf "Give archive to extract as argument.\\n" && exit 1 if [ -f "$archive" ] ; then case "$archive" in From 0582b495937117d899ce8ef715a89c6cc25a36cf Mon Sep 17 00:00:00 2001 From: LordRusk <54194338+LordRusk@users.noreply.github.com> Date: Thu, 27 Aug 2020 20:07:01 +0000 Subject: [PATCH 07/36] right clicking on nettraf now opens bmon (bandwidth monitor) (#681) --- .local/bin/statusbar/nettraf | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index 71e6fe43..eb7a73b3 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -5,6 +5,7 @@ # second, gives network traffic per second. case $BLOCK_BUTTON in + 1) setsid -f "$TERMINAL" -e bmon ;; 3) notify-send "🌐 Network traffic module" "πŸ”»: Traffic received πŸ”Ί: Traffic transmitted" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; From edde6779d4c6c279cd43e61bec2e9cbc9227d804 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 28 Aug 2020 13:31:21 -0400 Subject: [PATCH 08/36] pulseaudio failsafe for brave/chromium --- .xprofile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.xprofile b/.xprofile index 861443b8..2bdbb5b8 100755 --- a/.xprofile +++ b/.xprofile @@ -7,6 +7,12 @@ # Add this when you include flatpak in your system dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY +# Autostart Pulseaudio if installed and not already started by init. +# Chromium/Brave doesn't automatically start Pulse for some reason. +[ -x /usr/bin/pulseaudio ] && + ! pidof pulseaudio >/dev/null && + setsid -f pulseaudio --start >/dev/null 2>&1 + 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 From 3dc859933b88974ad5bea9417eafa86fc52caa68 Mon Sep 17 00:00:00 2001 From: Adam Mertzenich <62816361+Mertzenich@users.noreply.github.com> Date: Sat, 5 Sep 2020 12:09:01 -0500 Subject: [PATCH 09/36] Rename luke_ranger_readme.md to README.MD (#807) Displays the README when in the ranger folder (clicking = bloat) --- .config/ranger/{luke_ranger_readme.md => README.MD} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .config/ranger/{luke_ranger_readme.md => README.MD} (100%) diff --git a/.config/ranger/luke_ranger_readme.md b/.config/ranger/README.MD similarity index 100% rename from .config/ranger/luke_ranger_readme.md rename to .config/ranger/README.MD From b8d15d527838aeae50850458e151ac3a517f389a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20Tomi=C4=87?= Date: Tue, 8 Sep 2020 15:23:10 +0200 Subject: [PATCH 10/36] mount exfat for rw (#812) --- .local/bin/dmenumount | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index 488522a6..b98b6a3a 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -25,6 +25,7 @@ mountusb() { \ partitiontype="$(lsblk -no "fstype" "$chosen")" case "$partitiontype" in "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;; + "exfat") sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)";; *) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" "$mp";; esac notify-send "πŸ’» USB mounting" "$chosen mounted to $mp." From 426979aa7250e1d09b1f6044020d3f2b538425a9 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 12 Sep 2020 11:48:39 -0400 Subject: [PATCH 11/36] fix #814 --- .config/wal/templates/zathurarc | 1 + .config/zathura/zathurarc | 1 + .local/share/larbs/readme.mom | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/wal/templates/zathurarc b/.config/wal/templates/zathurarc index 53737238..242bf9a2 100644 --- a/.config/wal/templates/zathurarc +++ b/.config/wal/templates/zathurarc @@ -1,3 +1,4 @@ +set sandbox none set statusbar-h-padding 0 set statusbar-v-padding 0 set page-padding 1 diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index dc45337a..f1bae202 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -1,3 +1,4 @@ +set sandbox none set statusbar-h-padding 0 set statusbar-v-padding 0 set page-padding 1 diff --git a/.local/share/larbs/readme.mom b/.local/share/larbs/readme.mom index c759c5b3..392ba22f 100644 --- a/.local/share/larbs/readme.mom +++ b/.local/share/larbs/readme.mom @@ -276,7 +276,7 @@ In the Linux terminal, those binds have other more important purposes, so you ca Additionally, I've set vim to use the clipboard as the default buffer, which means when you copy or delete something in vim, it will be in your system clipboard as well, so you can \f(CWctrl-v\fP it into your browser instance, etc. You can also paste material copied from other programs into vim with the typical vim bindings. .HEADING 2 "How do I change the background/wallpaper?" .PP -The system will always read the file \f(CW~/.config/wall.png\fP as the wallpaper. +The system will always read the link \f(CW~/.local/share/bg\fP as the wallpaper. The script \f(CWsetbg\fP, if run on an image will set it as the persistent background. When using the file manager, you can simply hover over an image name and type \f(CWbg\fP and this will run \f(CWsetbg\fP. .HEADING 2 "How I change the colorscheme?" From 3936ffe5e2b494e65fc5a44927fe67311c8c51ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Nied=C5=BAwiedzi=C5=84ski?= Date: Thu, 17 Sep 2020 15:52:30 +0200 Subject: [PATCH 12/36] Use mutt-wizard sync (#815) --- .local/bin/statusbar/mailbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index ca77f5ca..5a674287 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -5,7 +5,7 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e neomutt ;; - 2) setsid -f mailsync >/dev/null ;; + 2) setsid -f mw sync >/dev/null ;; 3) notify-send "πŸ“¬ Mail module" "\- Shows unread mail - Shows πŸ”ƒ if syncing mail - Left click opens neomutt From 189d9072cd1e6e00872f42a92c0401212508edfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Corr=C3=AAa?= Date: Fri, 18 Sep 2020 11:29:23 -0300 Subject: [PATCH 13/36] Fix typo (#817) --- .local/bin/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index e04bac0b..6652edd2 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -10,7 +10,7 @@ weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum -# precipication chance and the daily high and low from the downloaded file and +# precipitation chance and the daily high and low from the downloaded file and # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/β˜”/g;1q" | tr -d '\n')" From 80e868e4afd7332390ee781f33e5841450eaaa77 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 21 Sep 2020 08:20:39 -0400 Subject: [PATCH 14/36] revert to fix #810 --- .xprofile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.xprofile b/.xprofile index 2bdbb5b8..861443b8 100755 --- a/.xprofile +++ b/.xprofile @@ -7,12 +7,6 @@ # Add this when you include flatpak in your system dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY -# Autostart Pulseaudio if installed and not already started by init. -# Chromium/Brave doesn't automatically start Pulse for some reason. -[ -x /usr/bin/pulseaudio ] && - ! pidof pulseaudio >/dev/null && - setsid -f pulseaudio --start >/dev/null 2>&1 - 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 From 3b642aaa9e2c83be0c69bcaeeb29527e7c6b4471 Mon Sep 17 00:00:00 2001 From: Spenser Truex Date: Wed, 23 Sep 2020 06:36:59 -0700 Subject: [PATCH 15/36] Typo. (#818) Co-authored-by: Spenser Truex --- .config/ranger/README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/ranger/README.MD b/.config/ranger/README.MD index 45111514..a78ee5a5 100644 --- a/.config/ranger/README.MD +++ b/.config/ranger/README.MD @@ -9,7 +9,7 @@ These are the basic key binds in ranger, even outside of my configs. Note that t + dd -- cut selected files + yy -- copy/yank selected files + pp -- paste/move cut/copied files -+ / -- search, when (n/N) next/previos result ++ / -- search, when (n/N) next/previous result + zh or CTRL-h -- show hidden files + Renaming files: + cw -- rename file from scratch From b768fc601e9b587aa800cd0656a8eee170bd1c93 Mon Sep 17 00:00:00 2001 From: Igor Line Date: Wed, 23 Sep 2020 15:37:24 +0200 Subject: [PATCH 16/36] Use mw sync on F8 (#819) Related to https://github.com/LukeSmithxyz/voidrice/pull/815 --- .config/i3/config | 2 +- .config/sxhkd/sxhkdrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 5553699c..5647389a 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -229,7 +229,7 @@ bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" bindsym $mod+F5 exec --no-startup-id $netrefresh bindsym $mod+F6 exec --no-startup-id torwrap bindsym $mod+F7 exec --no-startup-id td-toggle -bindsym $mod+F8 exec --no-startup-id mailsync +bindsym $mod+F8 exec --no-startup-id mw sync bindsym $mod+F9 exec --no-startup-id dmenumount bindsym $mod+F10 exec --no-startup-id dmenuumount bindsym $mod+F11 exec --no-startup-id ducksearch diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 1b893724..6c7c2e4f 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -157,7 +157,7 @@ super + F7 td-toggle # sync email super + F8 - mailsync + mw sync # Mount a USB drive or Android device super + {F9,F10} {dmenumount,dmenuumount} From aff828d935a1d032c3a2e1735ac58a56b679078d Mon Sep 17 00:00:00 2001 From: David Delarosa Date: Thu, 24 Sep 2020 23:38:20 +0300 Subject: [PATCH 17/36] reload tmux config from correct path (#820) --- .config/tmux/tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index d7e74f73..c74458e5 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -27,7 +27,7 @@ unbind j unbind C-b # unbind default leader key unbind '"' # unbind horizontal split unbind % # unbind vertical split -bind-key r source-file ~/.tmux.conf +bind-key r source-file ~/.config/tmux/tmux.conf bind-key c split-window -v # split pane horizontally bind-key v split-window -h # split pane vertically bind-key Space list-panes From 39320cf1eac171ff5ecc847c8e9d36ff92329735 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 25 Sep 2020 11:41:55 -0400 Subject: [PATCH 18/36] cleanup --- .local/bin/statusbar/torrent | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.local/bin/statusbar/torrent b/.local/bin/statusbar/torrent index 9e1da3a6..d2e08857 100755 --- a/.local/bin/statusbar/torrent +++ b/.local/bin/statusbar/torrent @@ -1,20 +1,14 @@ #!/bin/sh transmission-remote -l | grep % | - sed " # This first sed command is to ensure a desirable order with sort - s/.*Stopped.*/A/g; - s/.*Seeding.*/Z/g; - s/.*100%.*/N/g; - s/.*Idle.*/B/g; - s/.*Uploading.*/L/g; - s/.*%.*/M/g" | - sort -h | uniq -c | sed " # Now we replace the standin letters with icons. - s/A/πŸ›‘/g; - s/B/πŸ•°/g; - s/L/πŸ”Ό/g; - s/M/πŸ”½/g; - s/N/βœ…/g; - s/Z/🌱/g" | awk '{print $2 $1}' | paste -sd ' ' + sed " # The letters are for sorting and will not appear. + s/.*Stopped.*/A πŸ›‘/; + s/.*Seeding.*/Z 🌱/; + s/.*100%.*/N βœ…/; + s/.*Idle.*/B πŸ•°οΈ/; + s/.*Uploading.*/L ⬆️/; + s/.*%.*/M ⬇️/" | + sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e tremc ;; From 687e2e1ef63ffab7bb2edd4661843efe7ddefaca Mon Sep 17 00:00:00 2001 From: Manuel <64824522+maltalef101@users.noreply.github.com> Date: Wed, 30 Sep 2020 16:15:01 -0300 Subject: [PATCH 19/36] Added support for flac tags via metaflac (#823) --- .local/bin/tag | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.local/bin/tag b/.local/bin/tag index c23be4e6..8462b99a 100755 --- a/.local/bin/tag +++ b/.local/bin/tag @@ -55,5 +55,13 @@ Date=$date Genre=$genre Comment=$comment" | opustags -i -S "$file" ;; *.mp3) eyeD3 -Q --remove-all -a "$artist" -A "$album" -t "$title" -n "$track" -N "$total" -Y "$date" "$file" ;; + *.flac) echo "TITLE=$title +ARTIST=$artist +ALBUM=$album +TRACKNUMBER=$track +TOTALTRACKS=$total +DATE=$date +GENRE=$genre +DESCRIPTION=$comment" | metaflac --remove-all-tags --import-tags-from=- "$file" ;; *) echo "File type not implemented yet." ;; esac From ce1be2e37e016beb00f57af2b374730aab1fb70b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 11 Oct 2020 15:19:46 -0400 Subject: [PATCH 20/36] weather -> forecast --- .local/bin/statusbar/{weather => forecast} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .local/bin/statusbar/{weather => forecast} (100%) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/forecast similarity index 100% rename from .local/bin/statusbar/weather rename to .local/bin/statusbar/forecast From 3f4ea160b94565f2867c38d8433cf19c4ccb9188 Mon Sep 17 00:00:00 2001 From: karioki Date: Mon, 12 Oct 2020 02:08:55 +0530 Subject: [PATCH 21/36] Expanding shell vars before passing to the files (#827) --- .local/bin/shortcuts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index ed4f89f9..ea463d72 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -15,17 +15,19 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. +eval "echo \"$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/directories")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42cd %s && ls -a\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42cd %s; and ls -a\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; - printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" + printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }" # Format the `files` file in the correct syntax and sent it to both configs. +eval "echo \"$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/files")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; - printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" "${XDG_CONFIG_HOME:-$HOME/.config}/files" + printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" }" From cb5d88c8f3813826dc5bfa2508bd86ace4613f62 Mon Sep 17 00:00:00 2001 From: Luke Bubar <43391582+lukerb52@users.noreply.github.com> Date: Mon, 19 Oct 2020 09:09:03 -0400 Subject: [PATCH 22/36] Add C++ support to compiler script. (#828) --- .local/bin/compiler | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/compiler b/.local/bin/compiler index 1892d5fb..c56a25a5 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -30,6 +30,7 @@ case "$ext" in [0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; c) cc "$file" -o "$base" && "$base" ;; go) go run "$file" ;; + cpp) g++ "$file" -o "$base" && "$base" ;; h) sudo make install ;; m) octave "$file" ;; md) if [ -x "$(command -v lowdown)" ]; then From 06bec852386d57daf6cff778eacc691fa50d2fc1 Mon Sep 17 00:00:00 2001 From: majamin <45718559+majamin@users.noreply.github.com> Date: Thu, 22 Oct 2020 11:27:50 -0700 Subject: [PATCH 23/36] kill and start only current user's session (#829) --- .local/bin/sysact | 4 ++-- .zprofile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 0a7cdd02..e73981fc 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -10,8 +10,8 @@ esac cmds="\ πŸ”’ lock slock -πŸšͺ leave dwm kill -TERM $(pidof -s dwm) -β™» renew dwm kill -HUP $(pidof -s dwm) +πŸšͺ leave dwm kill -TERM $(pgrep -u $USER "\bdwm$") +β™» renew dwm kill -HUP $(pgrep -u $USER "\bdwm$") 🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate} πŸ”ƒ reboot ${reb:-sudo -A reboot} πŸ–₯ shutdown ${shut:-sudo -A shutdown -h now}" diff --git a/.zprofile b/.zprofile index e7b62f61..d122b67c 100644 --- a/.zprofile +++ b/.zprofile @@ -131,8 +131,8 @@ ex=🎯:\ [ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 & if pacman -Qs libxft-bgra >/dev/null 2>&1; then - # Start graphical server on tty1 if not already running. - [ "$(tty)" = "/dev/tty1" ] && ! pidof Xorg >/dev/null 2>&1 && exec startx + # Start graphical server on user's current tty if not already running. + [[ -n "$(tty)" && -z $(pgrep -u $USER "\bXorg$") ]] && exec startx else echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm. Please run: From f08e37bdad7aa7c69c7529fe9e48939a4b21d9cc Mon Sep 17 00:00:00 2001 From: PCFreak2000 <16918533+PCFreak2000@users.noreply.github.com> Date: Sat, 24 Oct 2020 17:43:19 +0200 Subject: [PATCH 24/36] Added missing value for parameter (#830) The value of the "-c" parameter was missing, so the check for an active internet connection as well as the whole script failed. --- .local/bin/cron/checkup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup index bf7f85d6..4cfb856a 100755 --- a/.local/bin/cron/checkup +++ b/.local/bin/cron/checkup @@ -2,7 +2,7 @@ # Syncs repositories and downloads updates, meant to be run as a cronjob. -ping -q -c example.org > /dev/null || exit +ping -q -c 1 example.org > /dev/null || exit notify-send "πŸ“¦ Repository Sync" "Checking for package updates..." From 494d1679d5f3957e473992a6e7f4a13325cb2735 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 1 Nov 2020 20:38:23 -0500 Subject: [PATCH 25/36] slider, to make image/meme slideshow video --- .local/bin/slider | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 .local/bin/slider diff --git a/.local/bin/slider b/.local/bin/slider new file mode 100755 index 00000000..0fa6f880 --- /dev/null +++ b/.local/bin/slider @@ -0,0 +1,69 @@ +#!/bin/sh + +# Give a file with images and timecodes and creates a video slideshow of them. +# +# Timecodes must be in format 00:00:00. +# +# Imagemagick and ffmpeg required. + +# TODO: +# - add the ability to include text, using imagemagick text to image feature. + + +[ -z "$1" ] && echo "Usage: + first arg: file with timecodes + second arg: audio file (optional)" && exit 1 + +prepdir="$1-src" +prepfile="$prepdir/$1.prep" +outfile="$1.mp4" + +totaldur="$(ffmpeg -i "$2" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//)" +totseconds="$(date '+%s' -d "$totaldur")" + +mkdir -p "$prepdir" + +echo "Preparing images... May take a while depending on the number of files." +{ + +while read -r x; +do + # Get the time from the first column. + time="${x%% *}" + seconds="$(date '+%s' -d "$time")" + # Duration is not used on the first looped item. + duration="$((seconds - prevseconds))" + + # Get the filename from the rest. + filename="${x#* }" + base="$(basename "$filename")" + base="${base%.*}.jpg" + + # Resize and read the image file, but not if already done. + [ ! -f "$prepdir/$base" ] && + convert -size 1920x1080 canvas:black -gravity center "$filename" -resize 1920x1080 -composite "$prepdir/$base" + + # If the first line, do not write yet. + [ "$time" = "00:00:00" ] || echo "file '$prevbase' +duration $duration" + + # Keep the information required for the next file. + prevbase="$base" + prevtime="$time" + prevseconds="$(date '+%s' -d "$prevtime")" +done < "$1" +# Do last file which must be given twice as follows +echo "file '$base' +duration $((totseconds-seconds)) +file '$base'" +} > "$prepfile" + +if [ -f "$2" ]; then + ffmpeg -y -f concat -safe 0 -i "$prepfile" -i "$2" -c:a aac -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile" +else + ffmpeg -y -f concat -safe 0 -i "$prepfile" -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile" +fi + +# Might also try: +# -vf "fps=${fps:-24},format=yuv420p" "$outfile" +# but has given some problems. From f770ac9df144ff24f7790aa23087abf000d656ff Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 1 Nov 2020 20:38:58 -0500 Subject: [PATCH 26/36] weechat var --- .zprofile | 1 + 1 file changed, 1 insertion(+) diff --git a/.zprofile b/.zprofile index e7b62f61..b2425eef 100644 --- a/.zprofile +++ b/.zprofile @@ -36,6 +36,7 @@ export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg" export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison" export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history" +export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat" # Other program settings: export DICS="/usr/share/stardict/dic/" From 611645af973a4757ad35ca8be34ff33693573e27 Mon Sep 17 00:00:00 2001 From: Epacnoss <49815482+Epacnoss@users.noreply.github.com> Date: Sun, 8 Nov 2020 12:57:37 +0000 Subject: [PATCH 27/36] Add support for Org-Mode files. (#837) --- .local/bin/compiler | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index c56a25a5..d50c393e 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -3,7 +3,7 @@ # This script will compile or run another finishing operation on a document. I # have this script run via vim. # -# Compiles .tex. groff (.mom, .ms), .rmd, .md. Opens .sent files as sent +# Compiles .tex. groff (.mom, .ms), .rmd, .md, .org. Opens .sent files as sent # presentations. Runs scripts based on extention or shebang # # Note that .tex files which you wish to compile with XeLaTeX should have the @@ -49,5 +49,6 @@ case "$ext" in scad) openscad -o "$base".stl "$file" ;; sent) setsid -f sent "$file" 2>/dev/null ;; tex) textype "$file" ;; + org) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; esac From 7f139718e9d729f073dcb8d63ffe957229576c2c Mon Sep 17 00:00:00 2001 From: Hekuran <62762955+narukeh@users.noreply.github.com> Date: Mon, 9 Nov 2020 00:49:34 +0000 Subject: [PATCH 28/36] UAE - update autisticly efficient (#838) --- .local/bin/dmenuhandler | 25 +++++++++++++++---------- .local/bin/linkhandler | 9 +++++---- .local/bin/qndl | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index 5bdd1314..e5de8ef9 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -2,15 +2,20 @@ # Feed this script a link and it will give dmenu # some choice programs to use to open it. +feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}" -case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in - "copy url") echo "$1" | xclip -selection clipboard ;; - mpv) setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;; - "mpv (loop)") setsid -f mpv -quiet --loop "$1" >/dev/null 2>&1 ;; - "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; - "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; - browser) setsid -f "$BROWSER" "$1" >/dev/null 2>&1 ;; - feh) setsid -f feh "$1" >/dev/null 2>&1 ;; - w3m) w3m "$1" >/dev/null 2>&1 ;; - "mpv (float)") setsid -f mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 ;; +case "$(printf "Copy URL\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dl\\nqueue yt-dl audio" | dmenu -i -p "Open it with?")" in + "copy url") echo "$feed" | xclip -selection clipboard ;; + mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;; + "mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;; + "mpv float") setsid -f "$TERMINAL" -e mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$feed" >/dev/null 2>&1 ;; + "queue yt-dl") qndl "$feed" >/dev/null 2>&1 ;; + "queue yt-dl audio") qndl "$feed" 'youtube-dl --add-metadata -icx -f bestaudio/best' >/dev/null 2>&1 ;; + "queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;; + PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; + sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; + vim) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; + setbg) curl -L "$feed" > $XDG_CACHE_HOME/pic ; xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 ;; + browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;; + lynx) lynx "$feed" >/dev/null 2>&1 ;; esac diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index ee5d1705..04934e58 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -13,10 +13,11 @@ case "$1" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*) setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif) - curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; + curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; + *pdf|*cbz|*cbr) + curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source*) - setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;; + qndl "$1" 'curl -LO' >/dev/null 2>&1 ;; *) - if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR" "$1" - else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi ;; + [ -f "$1" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$1" >/dev/null 2>&1 || setsid -f "$BROWSER" "$1" >/dev/null 2>&1 esac diff --git a/.local/bin/qndl b/.local/bin/qndl index f5bd14f2..f6fbe87c 100755 --- a/.local/bin/qndl +++ b/.local/bin/qndl @@ -5,7 +5,7 @@ base="$(basename "$1")" notify-send "⏳ Queuing $base..." cmd="$2" -[ -z "$cmd" ] && cmd="youtube-dl --add-metadata" +[ -z "$cmd" ] && cmd="youtube-dl --add-metadata -ic" idnum="$(tsp $cmd "$1")" realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")" tsp -D "$idnum" mv "$base" "$realname" From ae2db4ee1afe40b4e8f8009aaa0000fbb77d629b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 8 Nov 2020 20:17:46 -0500 Subject: [PATCH 29/36] fix #836 --- .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 b3f40c99..b078a786 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -84,7 +84,7 @@ set clipboard+=unnamedplus nnoremap S :%s//g " Compile document, be it groff/LaTeX/markdown/etc. - map c :w! \| !compiler % + map c :w! \| !compiler "%" " Open corresponding .pdf/.html or preview map p :!opout % From be8ff717b176d281e954329c3dfdb1f508531e25 Mon Sep 17 00:00:00 2001 From: "M. Yas. Davoodeh" <30480116+Davoodeh@users.noreply.github.com> Date: Tue, 10 Nov 2020 00:33:38 +0330 Subject: [PATCH 30/36] Use Emacs to compile org files (#839) --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index d50c393e..ff76add9 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -49,6 +49,6 @@ case "$ext" in scad) openscad -o "$base".stl "$file" ;; sent) setsid -f sent "$file" 2>/dev/null ;; tex) textype "$file" ;; - org) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; + org) emacs "$file" --batch -u "$USER" -f org-latex-export-to-pdf ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; esac From aea27f3f2bcebaffdd6db6b74e9ad0aecd91a54b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 11 Nov 2020 17:03:55 -0500 Subject: [PATCH 31/36] slider now takes text and has many nice options --- .local/bin/slider | 103 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 79 insertions(+), 24 deletions(-) diff --git a/.local/bin/slider b/.local/bin/slider index 0fa6f880..950b4967 100755 --- a/.local/bin/slider +++ b/.local/bin/slider @@ -6,26 +6,76 @@ # # Imagemagick and ffmpeg required. -# TODO: -# - add the ability to include text, using imagemagick text to image feature. +# Application cache if not stated elsewhere. +cache="${XDG_CACHE_HOME:-$HOME/.cache}/slider" +while getopts "hvrpi:c:a:o:d:f:t:e:x:" o; do case "${o}" in + c) bgc="$OPTARG" ;; + t) fgc="$OPTARG" ;; + i) file="$OPTARG" ;; + a) audio="$OPTARG" ;; + o) outfile="$OPTARG" ;; + d) prepdir="$OPTARG" ;; + r) redo="$OPTARG" ;; + s) ppt="$OPTARG" ;; + e) endtime="$OPTARG" ;; + x) res="$OPTARG" + echo "$res" | grep -qv "^[0-9]\+x[0-9]\+$" && + echo "Resolution must be dimensions separated by a 'x': 1280x720, etc." && + exit 1 ;; + p) echo "Purge old build files in $cache? [y/N]" + read -r confirm + echo "$confirm" | grep -iq "^y$" && rm -rf "$cache" && echo "Done." + exit ;; + v) verbose=True ;; + *) echo "$(basename "$0") usage: + -i input timecode list (required) + -a audio file + -c color of background (use html names, black is default) + -t text color for text slides (white is default) + -s text font size for text slides (150 is default) + -o output video file + -e if no audio given, the time in seconds that the last slide will be shown (5 is default) + -x resolution (1920x1080 is default) + -d tmp directory + -r rerun imagemagick commands even if done previously (in case files or background has changed) + -p purge old build files instead of running + -v be verbose" && exit 1 -[ -z "$1" ] && echo "Usage: - first arg: file with timecodes - second arg: audio file (optional)" && exit 1 +esac done -prepdir="$1-src" -prepfile="$prepdir/$1.prep" -outfile="$1.mp4" +# Check that the input file looks like it should. +{ head -n 1 "$file" 2>/dev/null | grep -q "^00:00:00 " ;} || { + echo "Give an input file with -i." && + echo "The file should look as this example: -totaldur="$(ffmpeg -i "$2" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//)" -totseconds="$(date '+%s' -d "$totaldur")" +00:00:00 first_image.jpg +00:00:03 otherdirectory/next_image.jpg +00:00:09 this_image_starts_at_9_seconds.jpg +etc... +Timecodes and filenames must be separated by Tabs." && + exit 1 + } + +if [ -n "${audio+x}" ]; then + # Check that the audio file looks like an actual audio file. + case "$(file --dereference --brief --mime-type -- "$audio")" in + audio/*) ;; + *) echo "That doesn't look like an audio file."; exit 1 ;; + esac + totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))" + endtime="$((totseconds-seconds))" +fi + +prepdir="${prepdir:-$cache/$file}" +outfile="${outfile:-$file.mp4}" +prepfile="$prepdir/$file.prep" + +[ -n "${verbose+x}" ] && echo "Preparing images... May take a while depending on the number of files." mkdir -p "$prepdir" -echo "Preparing images... May take a while depending on the number of files." { - while read -r x; do # Get the time from the first column. @@ -34,14 +84,20 @@ do # Duration is not used on the first looped item. duration="$((seconds - prevseconds))" - # Get the filename from the rest. - filename="${x#* }" - base="$(basename "$filename")" + # Get the filename/text content from the rest. + content="${x#* }" + base="$(basename "$content")" base="${base%.*}.jpg" - # Resize and read the image file, but not if already done. - [ ! -f "$prepdir/$base" ] && - convert -size 1920x1080 canvas:black -gravity center "$filename" -resize 1920x1080 -composite "$prepdir/$base" + if [ -f "$content" ]; then + # If images have already been made in a previous run, do not recreate + # them unless -r was given. + { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && + convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" + else + { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && + convert -size "${res:-1920x1080}" -background "${bgc-black}" -fill "${fgc:-white}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" + fi # If the first line, do not write yet. [ "$time" = "00:00:00" ] || echo "file '$prevbase' @@ -51,17 +107,16 @@ duration $duration" prevbase="$base" prevtime="$time" prevseconds="$(date '+%s' -d "$prevtime")" -done < "$1" +done < "$file" # Do last file which must be given twice as follows echo "file '$base' -duration $((totseconds-seconds)) +duration ${endtime:-5} file '$base'" } > "$prepfile" - -if [ -f "$2" ]; then - ffmpeg -y -f concat -safe 0 -i "$prepfile" -i "$2" -c:a aac -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile" +if [ -n "${audio+x}" ]; then + ffmpeg -hide_banner -y -f concat -safe 0 -i "$prepfile" -i "$audio" -c:a aac -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile" else - ffmpeg -y -f concat -safe 0 -i "$prepfile" -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile" + ffmpeg -hide_banner -y -f concat -safe 0 -i "$prepfile" -vsync vfr -c:v libx264 -pix_fmt yuv420p "$outfile" fi # Might also try: From 340995f6f9a8c7b80f8f0b4a8057f3c1ef4649c7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 11 Nov 2020 17:04:28 -0500 Subject: [PATCH 32/36] compiler tweaks --- .local/bin/compiler | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index ff76add9..3c2d204a 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -4,7 +4,7 @@ # have this script run via vim. # # Compiles .tex. groff (.mom, .ms), .rmd, .md, .org. Opens .sent files as sent -# presentations. Runs scripts based on extention or shebang +# presentations. Runs scripts based on extention or shebang. # # Note that .tex files which you wish to compile with XeLaTeX should have the # string "xelatex" somewhere in a comment/command in the first 5 lines. @@ -14,23 +14,24 @@ dir=${file%/*} base="${file%.*}" ext="${file##*.}" -cd "$dir" || exit +cd "$dir" || exit 1 textype() { \ command="pdflatex" - ( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" + ( head -n5 "$file" | grep -qi 'xelatex' ) && command="xelatex" $command --output-directory="$dir" "$base" && - grep -i addbibresource "$file" >/dev/null && + grep -qi addbibresource "$file" && biber --input-directory "$dir" "$base" && $command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" } case "$ext" in + # Try to keep these cases in alphabetical order. [0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; c) cc "$file" -o "$base" && "$base" ;; - go) go run "$file" ;; cpp) g++ "$file" -o "$base" && "$base" ;; + go) go run "$file" ;; h) sudo make install ;; m) octave "$file" ;; md) if [ -x "$(command -v lowdown)" ]; then @@ -42,13 +43,13 @@ case "$ext" in fi ; ;; mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;; ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;; + org) emacs "$file" --batch -u "$USER" -f org-latex-export-to-pdf ;; py) python "$file" ;; [rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;; rs) cargo build ;; - sass) sassc -a "$file" "$base.css" ;; + sass) sassc -a "$file" "$base.css" ;; scad) openscad -o "$base".stl "$file" ;; sent) setsid -f sent "$file" 2>/dev/null ;; tex) textype "$file" ;; - org) emacs "$file" --batch -u "$USER" -f org-latex-export-to-pdf ;; - *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; + *) head -n1 "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; esac From 11d4f16fb4c34834b1023c1ec808094dbca69d7b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 14 Nov 2020 15:09:25 -0500 Subject: [PATCH 33/36] close #832 proper user id --- .local/bin/cron/{IMPORTANT_NOTE.md => README.md} | 2 +- .local/bin/cron/cronbat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .local/bin/cron/{IMPORTANT_NOTE.md => README.md} (73%) diff --git a/.local/bin/cron/IMPORTANT_NOTE.md b/.local/bin/cron/README.md similarity index 73% rename from .local/bin/cron/IMPORTANT_NOTE.md rename to .local/bin/cron/README.md index f5a130b9..fa0c3540 100644 --- a/.local/bin/cron/IMPORTANT_NOTE.md +++ b/.local/bin/cron/README.md @@ -5,7 +5,7 @@ These cronjobs have components that require information about your current displ When you add them as cronjobs, I recommend you precede the command with commands as those below: ``` -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus; export DISPLAY=:0; . $HOME/.zprofile; then_command_goes_here +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus; export DISPLAY=:0; . $HOME/.zprofile; then_command_goes_here ``` This ensures that notifications will display, xdotool commands will function and environmental variables will work as well. diff --git a/.local/bin/cron/cronbat b/.local/bin/cron/cronbat index 2dc0950f..bd953c7a 100755 --- a/.local/bin/cron/cronbat +++ b/.local/bin/cron/cronbat @@ -5,5 +5,5 @@ [ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit [ "$(cat /sys/class/power_supply/BAT0/capacity)" -lt 25 ] && -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus && +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus && notify-send -u critical "Battery critically low." From 3215e7b4bb25f04db9caa4677caf32899de3e4c9 Mon Sep 17 00:00:00 2001 From: Shaw Date: Sat, 14 Nov 2020 20:10:19 +0000 Subject: [PATCH 34/36] Add video selection to dmenurecord (#825) --- .local/bin/dmenurecord | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index 49a2fbf8..b1a034a3 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -80,11 +80,12 @@ audio() { \ } askrecording() { \ - choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:") + choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:") case "$choice" in screencast) screencast;; audio) audio;; video) video;; + *selected) videoselected;; webcam) webcam;; "webcam (hi-def)") webcamhidef;; esac @@ -95,11 +96,28 @@ asktoend() { \ [ "$response" = "Yes" ] && killrecording } +videoselected() +{ + slop -f "%x %y %w %h" > /tmp/slop + read -r X Y W H < /tmp/slop + rm /tmp/slop + + ffmpeg \ + -f x11grab \ + -framerate 60 \ + -video_size "$W"x"$H" \ + -i :0.0+"$X,$Y" \ + -c:v libx264 -qp 0 -r 30 \ + "$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" & + echo $! > /tmp/recordingpid + updateicon "⏺️" +} case "$1" in screencast) screencast;; audio) audio;; video) video;; + *selected) videoselected;; kill) killrecording;; *) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;; esac From 97358cfe8180b1abfe0d1fe06799277c06fa8f8a Mon Sep 17 00:00:00 2001 From: Astronach <16743141+Astronach@users.noreply.github.com> Date: Sat, 14 Nov 2020 21:11:08 +0100 Subject: [PATCH 35/36] add vpn indicator to internet status modul (#796) for me /sys/class/net/tun*/operstate show unknown in every state, but ./net/tun* only exists, if vpn is on --- .local/bin/statusbar/internet | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index d8bd8969..ee1a1607 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -2,6 +2,7 @@ # Show wifi πŸ“Ά and percent strength or πŸ“‘ if none. # Show 🌐 if connected to ethernet or ❎ if none. +# Show πŸ”’ if a vpn connection is active case $BLOCK_BUTTON in 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; @@ -10,6 +11,7 @@ case $BLOCK_BUTTON in πŸ“Ά: wifi connection with quality ❎: no ethernet 🌐: ethernet working +πŸ”’: vpn is active " ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac @@ -19,4 +21,4 @@ case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in 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 2>/dev/null)" +printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/πŸ”’/" /sys/class/net/tun*/operstate 2>/dev/null)" From 38815c3ad1a3ab75892b8146b424a2bc5e7c84cc Mon Sep 17 00:00:00 2001 From: Arthur Bais Date: Sat, 14 Nov 2020 22:12:38 +0200 Subject: [PATCH 36/36] add peertube torrents from newsboat (#760) * Create peertubetorrent * macro to torrent new videos on peertube * fix typo * rebind --- .config/newsboat/config | 4 +++- .local/bin/peertubetorrent | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .local/bin/peertubetorrent diff --git a/.config/newsboat/config b/.config/newsboat/config index b5035b8d..e9179910 100644 --- a/.config/newsboat/config +++ b/.config/newsboat/config @@ -35,9 +35,11 @@ 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 -f mpv" ; 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 d set browser "dmenuhandler" ; open-in-browser ; set browser linkhandler macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler macro C set browser "youtube-viewer --comments=%u" ; open-in-browser ; set browser linkhandler +macro p set browser "peertubetorrent %u 480" ; open-in-browser ; set browser linkhandler +macro P set browser "peertubetorrent %u 1080" ; open-in-browser ; set browser linkhandler highlight all "---.*---" yellow highlight feedlist ".*(0/0))" black diff --git a/.local/bin/peertubetorrent b/.local/bin/peertubetorrent new file mode 100644 index 00000000..56f2476e --- /dev/null +++ b/.local/bin/peertubetorrent @@ -0,0 +1,7 @@ +#!/bin/sh +# torrent peertube videos, requires the transadd script +# first argument is the video link, second is the quality (480 or 1080) +# 13/07/20 - Arthur Bais + +link="$(echo "$1" | sed "s/videos\/watch/download\/torrents/")""-$2.torrent" +transadd "$link"