From 8c00641c17a78154576189720379e39ea7dde870 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 10 Aug 2022 08:55:30 +0200 Subject: [PATCH 01/11] qutebrowser: Change image viewing hints from rapid Changed the hinting style for image viewing from rapid hinting to normal, single link hinting. In the future I will have to think more about image viewing shortcuts in general: I want to be able to open the current page, a single link (default) and multiple links in quick succession - how to accomplish without overloading the lleader+i mapping terribly? Plus, ideally I would want there to be a shortcut to open both links (hint links) and images themselves (hint images) which may require even further mappings. --- qutebrowser/.config/qutebrowser/maps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/.config/qutebrowser/maps.py b/qutebrowser/.config/qutebrowser/maps.py index faca87c..2b1a0d6 100644 --- a/qutebrowser/.config/qutebrowser/maps.py +++ b/qutebrowser/.config/qutebrowser/maps.py @@ -50,7 +50,7 @@ config.bind(leader + "tV", "set tabs.position left") config.bind(lleader + "M", "spawn umpv {url}") config.bind(lleader + "m", "hint links spawn umpv {hint-url}") config.bind(lleader + "I", "spawn nsxiv-rifle {url}") -config.bind(lleader + "i", "hint --rapid links spawn nsxiv-rifle {hint-url}") +config.bind(lleader + "i", "hint links spawn nsxiv-rifle {hint-url}") # bind youtube-dl to download the current page/links config.bind(lleader + "dM", "spawn vidl {url}") From 524272f0631cd313bac40f9db94b773760e19596 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 10 Aug 2022 08:59:20 +0200 Subject: [PATCH 02/11] services: Remove a slew of X-related services These were largely remaining systemd services after I removed X and that now dangle in limbo without working correctly. Two services are not X related, which are the two dropdowns that I rarely use anymore on riverwm. May substitute them for something similar soon but do not need them at the moment. --- .../default.target.wants/an2linuxserver.service | 1 - .../default.target.wants/dropdown-terminal.service | 1 - .../user/default.target.wants/dropdown-todo.service | 1 - .../user/default.target.wants/flashfocus.service | 1 - .../user/default.target.wants/greenclip.service | 1 - .../default.target.wants/x-started-confirm.service | 1 - .../.config/systemd/user/dropdown-terminal.service | 13 ------------- services/.config/systemd/user/dropdown-todo.service | 13 ------------- services/.config/systemd/user/flashfocus.service | 12 ------------ .../systemd/user/greenclip.service.d/override.conf | 3 --- .../.config/systemd/user/x-started-confirm.service | 10 ---------- 11 files changed, 57 deletions(-) delete mode 120000 services/.config/systemd/user/default.target.wants/an2linuxserver.service delete mode 120000 services/.config/systemd/user/default.target.wants/dropdown-terminal.service delete mode 120000 services/.config/systemd/user/default.target.wants/dropdown-todo.service delete mode 120000 services/.config/systemd/user/default.target.wants/flashfocus.service delete mode 120000 services/.config/systemd/user/default.target.wants/greenclip.service delete mode 120000 services/.config/systemd/user/default.target.wants/x-started-confirm.service delete mode 100644 services/.config/systemd/user/dropdown-terminal.service delete mode 100644 services/.config/systemd/user/dropdown-todo.service delete mode 100644 services/.config/systemd/user/flashfocus.service delete mode 100644 services/.config/systemd/user/greenclip.service.d/override.conf delete mode 100644 services/.config/systemd/user/x-started-confirm.service diff --git a/services/.config/systemd/user/default.target.wants/an2linuxserver.service b/services/.config/systemd/user/default.target.wants/an2linuxserver.service deleted file mode 120000 index 35bb9b7..0000000 --- a/services/.config/systemd/user/default.target.wants/an2linuxserver.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/user/an2linuxserver.service \ No newline at end of file diff --git a/services/.config/systemd/user/default.target.wants/dropdown-terminal.service b/services/.config/systemd/user/default.target.wants/dropdown-terminal.service deleted file mode 120000 index 3b1a59e..0000000 --- a/services/.config/systemd/user/default.target.wants/dropdown-terminal.service +++ /dev/null @@ -1 +0,0 @@ -../dropdown-terminal.service \ No newline at end of file diff --git a/services/.config/systemd/user/default.target.wants/dropdown-todo.service b/services/.config/systemd/user/default.target.wants/dropdown-todo.service deleted file mode 120000 index 9044c18..0000000 --- a/services/.config/systemd/user/default.target.wants/dropdown-todo.service +++ /dev/null @@ -1 +0,0 @@ -../dropdown-todo.service \ No newline at end of file diff --git a/services/.config/systemd/user/default.target.wants/flashfocus.service b/services/.config/systemd/user/default.target.wants/flashfocus.service deleted file mode 120000 index 2305e41..0000000 --- a/services/.config/systemd/user/default.target.wants/flashfocus.service +++ /dev/null @@ -1 +0,0 @@ -../flashfocus.service \ No newline at end of file diff --git a/services/.config/systemd/user/default.target.wants/greenclip.service b/services/.config/systemd/user/default.target.wants/greenclip.service deleted file mode 120000 index daa9093..0000000 --- a/services/.config/systemd/user/default.target.wants/greenclip.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/user/greenclip.service \ No newline at end of file diff --git a/services/.config/systemd/user/default.target.wants/x-started-confirm.service b/services/.config/systemd/user/default.target.wants/x-started-confirm.service deleted file mode 120000 index 973183e..0000000 --- a/services/.config/systemd/user/default.target.wants/x-started-confirm.service +++ /dev/null @@ -1 +0,0 @@ -../x-started-confirm.service \ No newline at end of file diff --git a/services/.config/systemd/user/dropdown-terminal.service b/services/.config/systemd/user/dropdown-terminal.service deleted file mode 100644 index d541a9d..0000000 --- a/services/.config/systemd/user/dropdown-terminal.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Terminal window hidden to be called at any point -Requires=x-started-confirm.service -After=x-started-confirm.service - -[Service] -Type=simple -# workaround to allow relative executable invocation (i.e. current users' home dir) -ExecStart=/bin/bash -c 'kitty --title "dropdown-terminal" --class scratchpad' -Restart=always - -[Install] -WantedBy=default.target diff --git a/services/.config/systemd/user/dropdown-todo.service b/services/.config/systemd/user/dropdown-todo.service deleted file mode 100644 index ed6a646..0000000 --- a/services/.config/systemd/user/dropdown-todo.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Todo.md hidden vim instance -Requires=x-started-confirm.service -After=x-started-confirm.service - -[Service] -Type=simple -# workaround to allow relative executable invocation (i.e. current users' home dir) -ExecStart=/bin/bash -c 'kitty --title "dropdown-todo" --class scratchpad nvim -c ":set nonumber norelativenumber noshowmode noruler laststatus=0 noshowcmd shortmess=F | :Limelight" %h/documents/records/todo.md' -Restart=always - -[Install] -WantedBy=default.target diff --git a/services/.config/systemd/user/flashfocus.service b/services/.config/systemd/user/flashfocus.service deleted file mode 100644 index ddd6c02..0000000 --- a/services/.config/systemd/user/flashfocus.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Perform windows animations on focus -PartOf=graphical-session.target -Requires=x-started-confirm.service -After=x-started-confirm.service - -[Service] -ExecStart=/usr/bin/flashfocus -Restart=on-failure - -[Install] -WantedBy=default.target diff --git a/services/.config/systemd/user/greenclip.service.d/override.conf b/services/.config/systemd/user/greenclip.service.d/override.conf deleted file mode 100644 index 673779e..0000000 --- a/services/.config/systemd/user/greenclip.service.d/override.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Unit] -Requires=x-started-confirm.service -After=x-started-confirm.service diff --git a/services/.config/systemd/user/x-started-confirm.service b/services/.config/systemd/user/x-started-confirm.service deleted file mode 100644 index 11c74f1..0000000 --- a/services/.config/systemd/user/x-started-confirm.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Monitor status of X server start - -[Service] -Type=oneshot -ExecStart=/bin/bash -c '%h/.local/share/services/x-started-confirm.sh' -RestartSec=2 - -[Install] -WantedBy=default.target From 179840e4c0c8f70292754619ef3398712e0ae796 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 10 Aug 2022 09:01:09 +0200 Subject: [PATCH 03/11] sh: Add vim personal knowledge base alias Added alias `vw` to open the index page of my PKB (essentially the start page of my wiki) using my zettelkasten.nvim plugin. --- sh/.config/sh/alias | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index fd8fe99..54e9ea5 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -10,8 +10,9 @@ unalias -a # v shorthand for neovim if exist nvim; then alias v="nvim" - alias vs="nvim -c 'ScratchPad'" alias vim="nvim" + alias vs="nvim -c 'ScratchPad'" # open an empty 'scratchpad' which simply disappears after use + alias vw="nvim -c \"lua require 'zettelkasten'.index_open()\"" # open to personal wiki elif exist vim; then alias v="vim" else From b67ceb13309a15483583d3710f065fe953ed36fc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 17:49:00 +0200 Subject: [PATCH 04/11] git: Update commit signature key --- git/.config/git/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/.config/git/config b/git/.config/git/config index 4697b86..d42caec 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -1,7 +1,7 @@ [user] email = marty.oehme@gmail.com name = Marty Oehme - signingkey = B7538B8F50A1C800 + signingkey = 73BA40D5AFAF49C9 [init] defaultBranch = main [alias] From b8e97120d9a8294157c7bd44c26b8abbe94cfa4a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 17:52:33 +0200 Subject: [PATCH 05/11] qutebrowser: Rewrite medium urls to use scribe.rip --- qutebrowser/.config/qutebrowser/url.py | 1 + qutebrowser/.local/bin/qutedmenu | 2 ++ 2 files changed, 3 insertions(+) diff --git a/qutebrowser/.config/qutebrowser/url.py b/qutebrowser/.config/qutebrowser/url.py index 3e8b367..01bc9df 100644 --- a/qutebrowser/.config/qutebrowser/url.py +++ b/qutebrowser/.config/qutebrowser/url.py @@ -38,6 +38,7 @@ redirects = { "www.instagram.com": "bibliogram.art", "wikipedia.org": "wikiless.org", "en.wikipedia.org": "wikiless.org", + "medium.com": "scribe.rip", } diff --git a/qutebrowser/.local/bin/qutedmenu b/qutebrowser/.local/bin/qutedmenu index 39e3c8a..a6b69b8 100755 --- a/qutebrowser/.local/bin/qutedmenu +++ b/qutebrowser/.local/bin/qutedmenu @@ -1,6 +1,8 @@ #!/usr/bin/env bash # Open any of: quickmarks, bookmarks and browser history via dmenu (or rofi) # Handle open -s && open -t with bemenu +# +# Requires sqlite3 binary installed to traverse the history. #:bind o spawn --userscript /path/to/userscripts/qutedmenu open #:bind O spawn --userscript /path/to/userscripts/qutedmenu tab From cb698090c694af99003af82bfcc36b17d4a83dac Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 17:54:24 +0200 Subject: [PATCH 06/11] scripts: Fix nsxiv-rifle to work with symlinks --- scripts/.local/bin/nsxiv-rifle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/.local/bin/nsxiv-rifle b/scripts/.local/bin/nsxiv-rifle index 60b0e3d..a961295 100755 --- a/scripts/.local/bin/nsxiv-rifle +++ b/scripts/.local/bin/nsxiv-rifle @@ -20,7 +20,7 @@ cleanup() { } from_local() { - fpath="$(realpath "$1")" + fpath="$(realpath -e "$1")" ln -s "$fpath" "$cache_dir" } @@ -71,5 +71,5 @@ while [ -n "$1" ]; do shift done -[ "$(find "$cache_dir" -type f -print | wc -l)" -ne 0 ] && +[ "$(find -L "$cache_dir" -type f -print | wc -l)" -ne 0 ] && nsxiv -p "$cache_dir" From 7a18bc4a2120810f37b52e18f4fcfc4687145dc0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 17:55:27 +0200 Subject: [PATCH 07/11] zsh: Make c-e always switch to editor Added always listening to c-e to switch to edit current line in editor, regardless of already being in vi-command mode or not. --- zsh/.config/zsh/.zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index efd8c82..d475cca 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -70,13 +70,13 @@ prompt pure # load additional aliases if [ -d "$CONFDIR/sh/alias.d" ]; then for _alias in "$CONFDIR/sh/alias.d"/*.sh; do - . "$_alias" + source "$_alias" done unset _alias fi if [ -d "$ZSHCONFDIR/alias.d" ]; then for _alias in "$ZSHCONFDIR/alias.d"/*.sh; do - . "$_alias" + source "$_alias" done unset _alias fi @@ -171,6 +171,7 @@ bindkey -M isearch '^N' history-incremental-search-forward # Send command to editor and back for execution zle -N edit-command-line bindkey '^e' edit-command-line +bindkey -M vicmd '^e' edit-command-line # Deduplicate PATH - remove any duplicate entries from PATH # from: https://unix.stackexchange.com/questions/40749/remove-duplicate-path-entries-with-awk-command From 53c6373b00c3f0f9b0daff4a569f484cb273dce0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 18:02:38 +0200 Subject: [PATCH 08/11] riverwm: Fix rivercarro and brightness on launch Automatically set brightness to 70% on startup. Fixed options passed to rivercarro tiling manager (for current rivercarro version, will have to be changed in future again). --- wayland/.config/river/init | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wayland/.config/river/init b/wayland/.config/river/init index ee0b9cd..010d5e5 100755 --- a/wayland/.config/river/init +++ b/wayland/.config/river/init @@ -57,7 +57,7 @@ riverctl map normal $mod+Shift Space spawn "clipman pick --tool=bemenu" riverctl map normal $mod+Shift R spawn "$term --class float -e qalc" # Open emoji picker -riverctl map normal $mod+Shift E spawn "bemoji -t" +riverctl map normal $mod+Shift E spawn "bemoji -nt" # Open translation helper riverctl map normal $mod+Shift T spawn "bemenu-translate" @@ -240,5 +240,6 @@ exec wl-paste -t text --watch clipman store & riverctl default-layout rivercarro & # start layouting engine killall rivercarro -exec rivercarro -main-ratio 0.65 -view-padding 6 -outer-padding 6 & -# brightnessctl set 100% +exec rivercarro -main-ratio 0.65 & +# exec rivercarro -main-ratio 0.65 -view-padding 6 -outer-padding 6 & # -> does not work with current rivercarro version (0.1.4) +brightnessctl set 70% From 209ac92eb5ae485547db29eb6db024520b58864c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 18:04:49 +0200 Subject: [PATCH 09/11] wayland: Set fontconfig dpi for external screen Correctly set dpi for currently connected screen of 24". --- wayland/.config/fontconfig/fonts.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wayland/.config/fontconfig/fonts.conf b/wayland/.config/fontconfig/fonts.conf index 0bdef5b..97c38de 100644 --- a/wayland/.config/fontconfig/fonts.conf +++ b/wayland/.config/fontconfig/fonts.conf @@ -41,7 +41,7 @@ false - 92 + 93 From 485730ba8390cac9b04e49950b6bd7964eeef7c2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 18:05:39 +0200 Subject: [PATCH 10/11] tmux: Change todo.session burndown display Changed to display overall accumulation of tasks again. Would overall probably be best to display a combination of accomplished and still to be done tasks. --- tmux/.config/tmux/sessions/todo.session | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux/.config/tmux/sessions/todo.session b/tmux/.config/tmux/sessions/todo.session index d0faa7e..7fd71ad 100644 --- a/tmux/.config/tmux/sessions/todo.session +++ b/tmux/.config/tmux/sessions/todo.session @@ -4,7 +4,7 @@ new-window -n dash send-keys "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task next" C-m split-window -h -l 71 send-keys "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task summary" C-m -split-window -v "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task end.after=tod-3m or entry.after=tod-1m burndown" +split-window -v "cd ${XDG_DATA_HOME:-~/.local/share}/task/; fd . | entr -c task status:pending or +ACTIVE burndown" select-pane -t 1 split-window -v -l 5 send-keys "t" Space From a3b00c4693d6822acfe08b0a88f7600946efe304 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 8 Oct 2022 18:13:43 +0200 Subject: [PATCH 11/11] mpv: Fix sponsorblock code and formatting Fixed global variable naming (capitalized) and let code be formatted by formatter. --- .../mpv/scripts/sponsorblock_minimal.lua | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/mpv/.config/mpv/scripts/sponsorblock_minimal.lua b/mpv/.config/mpv/scripts/sponsorblock_minimal.lua index a681c93..1940bc8 100644 --- a/mpv/.config/mpv/scripts/sponsorblock_minimal.lua +++ b/mpv/.config/mpv/scripts/sponsorblock_minimal.lua @@ -5,7 +5,6 @@ -- -- original from https://codeberg.org/jouni/mpv_sponsorblock_minimal -- adapted for local playback skipping and some refactoring by me - local options = { API = "https://sponsor.ajay.app/api/skipSegments", @@ -15,36 +14,39 @@ local options = { local function getranges() local args = { - "curl", - "-s", - "-d", - "videoID="..youtube_id, - "-d", - "categories=["..options.categories.."]", - "-G", - options.API} - local sponsors = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args}) + "curl", "-s", "-d", "videoID=" .. Youtube_id, "-d", + "categories=[" .. options.categories .. "]", "-G", options.API + } + local sponsors = mp.command_native({ + name = "subprocess", + capture_stdout = true, + playback_only = false, + args = args + }) - if string.match(sponsors.stdout,"%[(.-)%]") then - ranges = {} - for i in string.gmatch(string.sub(sponsors.stdout,2,-2),"%[(.-)%]") do - k,v = string.match(i,"(%d+.?%d*),(%d+.?%d*)") - ranges[k] = v - end + if string.match(sponsors.stdout, "%[(.-)%]") then + Ranges = {} + for i in string.gmatch(string.sub(sponsors.stdout, 2, -2), "%[(.-)%]") do + local k, v = string.match(i, "(%d+.?%d*),(%d+.?%d*)") + Ranges[k] = v end - return end + return +end -local function skip_ads(name,pos) +local function skip_ads(name, pos) if pos ~= nil then - for k,v in pairs(ranges) do + for k, v in pairs(Ranges) do if tonumber(k) <= pos and tonumber(v) > pos then - --this message may sometimes be wrong - --it only seems to be a visual thing though - mp.osd_message("[sponsorblock] skipping forward "..math.floor(tonumber(v)-mp.get_property("time-pos")).."s") - --need to do the +0.01 otherwise mpv will start spamming skip sometimes - --example: https://www.youtube.com/watch?v=4ypMJzeNooo - mp.set_property("time-pos",tonumber(v)+0.01) + -- this message may sometimes be wrong + -- it only seems to be a visual thing though + mp.osd_message("[sponsorblock] skipping forward " .. + math.floor( + tonumber(v) - mp.get_property("time-pos")) .. + "s") + -- need to do the +0.01 otherwise mpv will start spamming skip sometimes + -- example: https://www.youtube.com/watch?v=4ypMJzeNooo + mp.set_property("time-pos", tonumber(v) + 0.01) return end end @@ -54,19 +56,23 @@ end local function file_loaded() local video_path = mp.get_property("path") - local youtube_id1 = string.match(video_path, "https?://youtu%.be/([%w-_]+).*") - local youtube_id2 = string.match(video_path, "https?://w?w?w?%.?youtube%.com/v/([%w-_]+).*") + local youtube_id1 = string.match(video_path, + "https?://youtu%.be/([%w-_]+).*") + local youtube_id2 = string.match(video_path, + "https?://w?w?w?%.?youtube%.com/v/([%w-_]+).*") local youtube_id3 = string.match(video_path, "/watch.*[?&]v=([%w-_]+).*") local youtube_id4 = string.match(video_path, "/embed/([%w-_]+).*") - local localytfile = string.match(video_path, "-([%a%d%-_]+)%.[mw][kpe][v4b][m]?$") - youtube_id = youtube_id1 or youtube_id2 or youtube_id3 or youtube_id4 or localytfile - if not youtube_id or string.len(youtube_id) < 11 then return end - youtube_id = string.sub(youtube_id, 1, 11) + local localytfile = string.match(video_path, + "-([%a%d%-_]+)%.[mw][kpe][v4b][m]?$") + Youtube_id = youtube_id1 or youtube_id2 or youtube_id3 or youtube_id4 or + localytfile + if not Youtube_id or string.len(Youtube_id) < 11 then return end + Youtube_id = string.sub(Youtube_id, 1, 11) getranges() - if ranges then + if Ranges then ON = true - mp.add_key_binding("b","sponsorblock",toggle) + mp.add_key_binding("b", "sponsorblock", toggle) mp.observe_property("time-pos", "native", skip_ads) end return