commit 47c70dcbbdd7a922a531e1a61171c0dbb8945307 parent f6e42dd2b26c6498d643e5355ef2cc72d0b3123f Author: mtmn <miro@haravara.org> Date: Fri, 10 Apr 2026 13:32:17 +0200 feat: add yank-todo-txt Diffstat:
| A | modules/mixins/dotfiles/bin/yank-todo-txt | | | 32 | ++++++++++++++++++++++++++++++++ |
| M | modules/mixins/dotfiles/config/river/init | | | 4 | +++- |
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/modules/mixins/dotfiles/bin/yank-todo-txt b/modules/mixins/dotfiles/bin/yank-todo-txt @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +todo_file=~/misc/notes/nota/todo.txt + +if [[ -n "$1" ]]; then + url="$1" +else + wl_focused_title="$(wlr-river-title)" + if [[ "$wl_focused_title" == *"Mozilla Firefox"* ]]; then + /usr/bin/wtype "yy" && sleep 0.5 + url=$(wl-paste 2>/dev/null) + else + notify-send -u critical "Error" "Focused window is not a web browser ($wl_focused_title)" + exit 1 + fi +fi + +if [[ -z "$url" ]]; then + notify-send "No url found" + exit 1 +fi + +if [[ ! "$url" =~ ^https?:// ]]; then + notify-send "Invalid format" "$url" + exit 1 +fi + +if printf "\n%s\ntodo: %s" "$(date --rfc-3339=s)" "$url" >>"$todo_file"; then + notify-send "Added" "$url" +else + notify-send -u critical "Error" "$url" +fi diff --git a/modules/mixins/dotfiles/config/river/init b/modules/mixins/dotfiles/config/river/init @@ -40,7 +40,6 @@ riverctl map normal Control+$mod l spawn "monofetch" riverctl map normal $mod+Shift o spawn "todomenu $dmenu_args" riverctl map normal $alt+Shift d spawn "clipmenu $dmenu_args" riverctl map normal $alt+Shift l spawn "langmenu $dmenu_args" -riverctl map normal $alt+Shift t spawn "tempmenu $dmenu_args" riverctl map normal $alt+Shift m spawn "plsmenu $dmenu_args" riverctl map normal $alt+Shift h spawn "huemenu $dmenu_args" @@ -53,6 +52,9 @@ riverctl map normal $alt+Shift p spawn "passmenu $dmenu_args" riverctl map normal $mod+Shift s spawn "screenshot" riverctl map normal $alt+Shift s spawn "screenshot" +riverctl map normal $mod+Shift t spawn "yank-todo-txt" +riverctl map normal $alt+Shift t spawn "tempmenu $dmenu_args" + riverctl map normal None XF86AudioMute spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && (wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q MUTED && echo 0 > $wobsock) || wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > $wobsock" riverctl map normal None XF86AudioLowerVolume spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > $wobsock" riverctl map normal None XF86AudioRaiseVolume spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > $wobsock"