From 5a82682813b52b837a7125d020ea8a2d70ff8061 Mon Sep 17 00:00:00 2001 From: Jurn Wubben Date: Sun, 30 Nov 2025 20:07:59 +0100 Subject: [PATCH] Hyprland made screenshot bindings work with pc; Fish made scp work again; recording now works with multiple screens. --- private_dot_config/hypr/land/binds.conf | 9 +- private_dot_config/hypr/land/defaults.conf | 3 + .../hypr/scripts/executable_recording.sh | 21 ++- .../private_fish/conf.d/atuin.fish | 4 + .../private_fish/conf.d/theme.fish.tmpl | 164 +++++++++++------- .../private_fish/functions/bleprinter.fish | 4 + .../private_fish/functions/cat.fish | 4 + .../private_fish/functions/cdc.fish | 4 + .../private_fish/functions/cz.fish | 4 + .../private_fish/functions/du.fish | 4 + .../private_fish/functions/fish_greeting.fish | 4 + .../private_fish/functions/hx.fish | 4 + .../private_fish/functions/hxc.fish | 4 + .../private_fish/functions/hxs.fish | 4 + 14 files changed, 169 insertions(+), 68 deletions(-) diff --git a/private_dot_config/hypr/land/binds.conf b/private_dot_config/hypr/land/binds.conf index 81561fe..e8f5c7d 100644 --- a/private_dot_config/hypr/land/binds.conf +++ b/private_dot_config/hypr/land/binds.conf @@ -4,13 +4,14 @@ bind = $mod SHIFT, Return, exec, $browser bind = $mod, a, exec, $audio bind = $mod, n, exec, $networking bind = $mod, b, exec, $bluetooth -bind = $mod, p, exec, $display +bind = $mod SHIFT, p, exec, $display bind = $mod, d, exec, $menu bind = $mod, escape, exec, $lock -bind = CTRL, Print, exec, ~/.config/hypr/scripts/recording.sh -bind = , Print, exec, mkdir -p ~/Pictures/Screenshots && grim -t ppm -o "$(hyprctl activeworkspace -j | jq -r '.monitor')" - | satty -f - -o ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png - +bind = CTRL, Print, exec, $screenshot +bind = $mod CTRL, p, exec, $screenshot +bind = , Print, exec, $rec +bind = $mod, p, exec, $rec bind = $mod, Q, killactive bind = $mod, F, fullscreen diff --git a/private_dot_config/hypr/land/defaults.conf b/private_dot_config/hypr/land/defaults.conf index d20cbc0..97febd1 100644 --- a/private_dot_config/hypr/land/defaults.conf +++ b/private_dot_config/hypr/land/defaults.conf @@ -13,5 +13,8 @@ $bluetooth = $terminal /usr/bin/bluetui $display = /usr/bin/nwg-displays -w ~/.config/hypr/land/workspaces.conf -m ~/.config/hypr/land/monitors.conf $menu = /usr/bin/rofi -show drun -theme ~/.config/rofi/themes/launcher-theme.rasi +# Screenshotting +$screenshot = ~/.config/hypr/scripts/recording.sh +$rec = mkdir -p ~/Pictures/Screenshots && grim -t ppm -o "$(hyprctl activeworkspace -j | jq -r '.monitor')" - | satty -f - -o ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png # Other applications $browser = /usr/bin/firefox diff --git a/private_dot_config/hypr/scripts/executable_recording.sh b/private_dot_config/hypr/scripts/executable_recording.sh index 9c221b5..ece7cb2 100644 --- a/private_dot_config/hypr/scripts/executable_recording.sh +++ b/private_dot_config/hypr/scripts/executable_recording.sh @@ -1,6 +1,23 @@ #!/bin/env bash -pgrep -x "wf-recorder" && pkill -INT -x wf-recorder && notify-send -h string:wf-recorder:record -t 1000 "Finished Recording" && exit 0 +for i in "pgrep" "pkill" "jq" "hyprctl" "wf-recorder" "notify-send" "hyprland-share-picker"; do + if builtin type -P "$i" &> /dev/null; then continue; fi + + notify-send -h string:wf-recorder:record -t 1000 "Missing dependencies, can't record."; + echo "Missing dependencies." + exit 1 +done + +pgrep -x "wf-recorder" && \ + pkill -INT -x wf-recorder && \ + notify-send -h string:wf-recorder:record -t 1000 "Finished Recording" && \ + exit 0 + +display=$(hyprland-share-picker | sed -r 's/.+:([^@]+)(@.+)?/\1/') +if [ -z "$display" ]; then + notify-send "Please select a display" + exit 1 +fi for i in $(seq 1 3); do notify-send -h string:wf-recorder:record -t 1000 "Recording in:" "$((4 - $i))" @@ -11,4 +28,4 @@ dateTime=$(date +%m-%d-%Y-%H:%M:%S) dir="$HOME/Videos/ScreenRecordings" mkdir -p "$dir" -wf-recorder -f "$dir/$dateTime.mp4" +wf-recorder -o "$display" -f "$dir/$dateTime.mp4" diff --git a/private_dot_config/private_fish/conf.d/atuin.fish b/private_dot_config/private_fish/conf.d/atuin.fish index aa7e94a..4e3865d 100644 --- a/private_dot_config/private_fish/conf.d/atuin.fish +++ b/private_dot_config/private_fish/conf.d/atuin.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + set -gx ATUIN_SESSION (atuin uuid) set --erase ATUIN_HISTORY_ID diff --git a/private_dot_config/private_fish/conf.d/theme.fish.tmpl b/private_dot_config/private_fish/conf.d/theme.fish.tmpl index 14519df..35d3300 100644 --- a/private_dot_config/private_fish/conf.d/theme.fish.tmpl +++ b/private_dot_config/private_fish/conf.d/theme.fish.tmpl @@ -1,60 +1,100 @@ -set color00 {{substr 0 2 .colors.base00}}/{{substr 2 4 .colors.base00}}/{{substr 4 6 .colors.base00}} # Base 00 - Black -set color01 {{substr 0 2 .colors.base08}}/{{substr 2 4 .colors.base08}}/{{substr 4 6 .colors.base08}} # Base 08 - Red -set color02 {{substr 0 2 .colors.base0B}}/{{substr 2 4 .colors.base0B}}/{{substr 4 6 .colors.base0B}} # Base 0B - Green -set color03 {{substr 0 2 .colors.base0A}}/{{substr 2 4 .colors.base0A}}/{{substr 4 6 .colors.base0A}} # Base 0A - Yellow -set color04 {{substr 0 2 .colors.base0D}}/{{substr 2 4 .colors.base0D}}/{{substr 4 6 .colors.base0D}} # Base 0D - Blue -set color05 {{substr 0 2 .colors.base0E}}/{{substr 2 4 .colors.base0E}}/{{substr 4 6 .colors.base0E}} # Base 0E - Magenta -set color06 {{substr 0 2 .colors.base0C}}/{{substr 2 4 .colors.base0C}}/{{substr 4 6 .colors.base0C}} # Base 0C - Cyan -set color07 {{substr 0 2 .colors.base05}}/{{substr 2 4 .colors.base05}}/{{substr 4 6 .colors.base05}} # Base 05 - White -set color08 {{substr 0 2 .colors.base03}}/{{substr 2 4 .colors.base03}}/{{substr 4 6 .colors.base03}} # Base 03 - Bright Black +if not status is-interactive + exit +end + +set color00 30/34/46 # Base 00 - Black +set color01 e7/82/84 # Base 08 - Red +set color02 a6/d1/89 # Base 0B - Green +set color03 e5/c8/90 # Base 0A - Yellow +set color04 8c/aa/ee # Base 0D - Blue +set color05 ca/9e/e6 # Base 0E - Magenta +set color06 81/c8/be # Base 0C - Cyan +set color07 c6/d0/f5 # Base 05 - White +set color08 51/57/6d # Base 03 - Bright Black set color09 $color01 # Base 08 - Bright Red set color10 $color02 # Base 0B - Bright Green set color11 $color03 # Base 0A - Bright Yellow set color12 $color04 # Base 0D - Bright Blue set color13 $color05 # Base 0E - Bright Magenta set color14 $color06 # Base 0C - Bright Cyan -set color15 {{substr 0 2 .colors.base07}}/{{substr 2 4 .colors.base07}}/{{substr 4 6 .colors.base07}} # Base 07 - Bright White -set color16 {{substr 0 2 .colors.base09}}/{{substr 2 4 .colors.base09}}/{{substr 4 6 .colors.base09}} # Base 09 -set color17 {{substr 0 2 .colors.base0F}}/{{substr 2 4 .colors.base0F}}/{{substr 4 6 .colors.base0F}} # Base 0F -set color18 {{substr 0 2 .colors.base01}}/{{substr 2 4 .colors.base01}}/{{substr 4 6 .colors.base01}} # Base 01 -set color19 {{substr 0 2 .colors.base02}}/{{substr 2 4 .colors.base02}}/{{substr 4 6 .colors.base02}} # Base 02 -set color20 {{substr 0 2 .colors.base04}}/{{substr 2 4 .colors.base04}}/{{substr 4 6 .colors.base04}} # Base 04 -set color21 {{substr 0 2 .colors.base06}}/{{substr 2 4 .colors.base06}}/{{substr 4 6 .colors.base06}} # Base 06 +set color15 ba/bb/f1 # Base 07 - Bright White +set color16 ef/9f/76 # Base 09 +set color17 ee/be/be # Base 0F +set color18 29/2c/3c # Base 01 +set color19 41/45/59 # Base 02 +set color20 62/68/80 # Base 04 +set color21 f2/d5/cf # Base 06 set colorfg $color07 # Base 05 - White set colorbg $color00 # Base 00 - Black if test -n "$TMUX" -# Tell tmux to pass the escape sequences through -# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) -function put_template; printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $argv; end; -function put_template_var; printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $argv; end; -function put_template_custom; printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $argv; end; + # Tell tmux to pass the escape sequences through + # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) + function put_template + printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $argv + end + + function put_template_var + printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $argv + end + + function put_template_custom + printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $argv + end + else if string match 'screen*' $TERM # [ "${TERM%%[-.]*}" = "screen" ] -# GNU screen (screen, screen-256color, screen-256color-bce) -function put_template; printf '\033P\033]4;%d;rgb:%s\007\033\\' $argv; end; -function put_template_var; printf '\033P\033]%d;rgb:%s\007\033\\' $argv; end; -function put_template_custom; printf '\033P\033]%s%s\007\033\\' $argv; end; + # GNU screen (screen, screen-256color, screen-256color-bce) + function put_template + printf '\033P\033]4;%d;rgb:%s\007\033\\' $argv + end + + function put_template_var + printf '\033P\033]%d;rgb:%s\007\033\\' $argv + end + + function put_template_custom + printf '\033P\033]%s%s\007\033\\' $argv + end + else if string match 'linux*' $TERM # [ "${TERM%%-*}" = "linux" ] -function put_template; test $argv[1] -lt 16 && printf "\e]P%x%s" $argv[1] (echo $argv[2] | sed 's/\///g'); end; -function put_template_var; true; end; -function put_template_custom; true; end; + function put_template + test $argv[1] -lt 16 && printf "\e]P%x%s" $argv[1] (echo $argv[2] | sed 's/\///g') + end + + function put_template_var + true + end + + function put_template_custom + true + end + else -function put_template; printf '\033]4;%d;rgb:%s\033\\' $argv; end; -function put_template_var; printf '\033]%d;rgb:%s\033\\' $argv; end; -function put_template_custom; printf '\033]%s%s\033\\' $argv; end; + function put_template + printf '\033]4;%d;rgb:%s\033\\' $argv + end + + function put_template_var + printf '\033]%d;rgb:%s\033\\' $argv + end + + function put_template_custom + printf '\033]%s%s\033\\' $argv + end + end # 16 color space -put_template 0 $color00 -put_template 1 $color01 -put_template 2 $color02 -put_template 3 $color03 -put_template 4 $color04 -put_template 5 $color05 -put_template 6 $color06 -put_template 7 $color07 -put_template 8 $color08 -put_template 9 $color09 +put_template 0 $color00 +put_template 1 $color01 +put_template 2 $color02 +put_template 3 $color03 +put_template 4 $color04 +put_template 5 $color05 +put_template 6 $color06 +put_template 7 $color07 +put_template 8 $color08 +put_template 9 $color09 put_template 10 $color10 put_template 11 $color11 put_template 12 $color12 @@ -72,30 +112,30 @@ put_template 21 $color21 # foreground / background / cursor color if test -n "$ITERM_SESSION_ID" -# iTerm2 proprietary escape codes -put_template_custom Pg {{.colors.base05}} # foreground -put_template_custom Ph {{.colors.base00}} # background -put_template_custom Pi {{.colors.base05}} # bold color -put_template_custom Pj {{.colors.base02}} # selection color -put_template_custom Pk {{.colors.base05}} # selected text color -put_template_custom Pl {{.colors.base05}} # cursor -put_template_custom Pm {{.colors.base00}} # cursor text + # iTerm2 proprietary escape codes + put_template_custom Pg c6d0f5 # foreground + put_template_custom Ph 303446 # background + put_template_custom Pi c6d0f5 # bold color + put_template_custom Pj 414559 # selection color + put_template_custom Pk c6d0f5 # selected text color + put_template_custom Pl c6d0f5 # cursor + put_template_custom Pm 303446 # cursor text else -put_template_var 10 $colorfg -if [ "$BASE16_SHELL_SET_BACKGROUND" != false ] - put_template_var 11 $colorbg - if string match 'rxvt*' $TERM # [ "${TERM%%-*}" = "rxvt" ] - put_template_var 708 $colorbg # internal border (rxvt) - end -end -put_template_custom 12 ";7" # cursor (reverse video) + put_template_var 10 $colorfg + if [ "$BASE16_SHELL_SET_BACKGROUND" != false ] + put_template_var 11 $colorbg + if string match 'rxvt*' $TERM # [ "${TERM%%-*}" = "rxvt" ] + put_template_var 708 $colorbg # internal border (rxvt) + end + end + put_template_custom 12 ";7" # cursor (reverse video) end # set syntax highlighting colors -set -U fish_color_autosuggestion {{.colors.base02}} +set -U fish_color_autosuggestion 414559 set -U fish_color_cancel -r set -U fish_color_command green #white -set -U fish_color_comment {{.colors.base02}} +set -U fish_color_comment 414559 set -U fish_color_cwd green set -U fish_color_cwd_root red set -U fish_color_end brblack #blue @@ -106,11 +146,11 @@ set -U fish_color_host normal set -U fish_color_match --background=brblue set -U fish_color_normal normal set -U fish_color_operator blue #green -set -U fish_color_param {{.colors.base04}} +set -U fish_color_param 626880 set -U fish_color_quote yellow #brblack set -U fish_color_redirection cyan -set -U fish_color_search_match bryellow --background={{.colors.base02}} -set -U fish_color_selection white --bold --background={{.colors.base02}} +set -U fish_color_search_match bryellow --background=414559 +set -U fish_color_selection white --bold --background=414559 set -U fish_color_status red set -U fish_color_user brgreen set -U fish_color_valid_path --underline diff --git a/private_dot_config/private_fish/functions/bleprinter.fish b/private_dot_config/private_fish/functions/bleprinter.fish index c5e1699..b82b17f 100644 --- a/private_dot_config/private_fish/functions/bleprinter.fish +++ b/private_dot_config/private_fish/functions/bleprinter.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function bleprinter --wraps='ble-serial -d 60:6E:41:58:9A:3F -s 000018f0-0000-1000-8000-00805f9b34fb -r 00000000-0000-0000-0000-000000002af0 -w 00000000-0000-0000-0000-000000002af1 -p /tmp/ttyMPT2 -m 512 --write-with-response' --description 'alias bleprinter=ble-serial -d 60:6E:41:58:9A:3F -s 000018f0-0000-1000-8000-00805f9b34fb -r 00000000-0000-0000-0000-000000002af0 -w 00000000-0000-0000-0000-000000002af1 -p /tmp/ttyMPT2 -m 512 --write-with-response' ble-serial -d 60:6E:41:58:9A:3F -s 000018f0-0000-1000-8000-00805f9b34fb -r 00000000-0000-0000-0000-000000002af0 -w 00000000-0000-0000-0000-000000002af1 -p /tmp/ttyMPT2 -m 512 --write-with-response $argv end diff --git a/private_dot_config/private_fish/functions/cat.fish b/private_dot_config/private_fish/functions/cat.fish index 9106247..6a7bf24 100644 --- a/private_dot_config/private_fish/functions/cat.fish +++ b/private_dot_config/private_fish/functions/cat.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function cat --wraps=bat --description 'alias cat=bat' bat $argv end diff --git a/private_dot_config/private_fish/functions/cdc.fish b/private_dot_config/private_fish/functions/cdc.fish index 5c98af2..198d06c 100644 --- a/private_dot_config/private_fish/functions/cdc.fish +++ b/private_dot_config/private_fish/functions/cdc.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function cdc --wraps='chezmoi cd' --description 'alias cdc=chezmoi cd' chezmoi cd $argv end diff --git a/private_dot_config/private_fish/functions/cz.fish b/private_dot_config/private_fish/functions/cz.fish index 35ab0e5..fef0784 100644 --- a/private_dot_config/private_fish/functions/cz.fish +++ b/private_dot_config/private_fish/functions/cz.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function cz --wraps=chezmoi --description 'alias cz=chezmoi' chezmoi $argv end diff --git a/private_dot_config/private_fish/functions/du.fish b/private_dot_config/private_fish/functions/du.fish index 0bb9c03..5374f5b 100644 --- a/private_dot_config/private_fish/functions/du.fish +++ b/private_dot_config/private_fish/functions/du.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function du --wraps=dua --description 'alias du=dua' dua $argv end diff --git a/private_dot_config/private_fish/functions/fish_greeting.fish b/private_dot_config/private_fish/functions/fish_greeting.fish index 1ffc30c..19547ca 100644 --- a/private_dot_config/private_fish/functions/fish_greeting.fish +++ b/private_dot_config/private_fish/functions/fish_greeting.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function fish_greeting end diff --git a/private_dot_config/private_fish/functions/hx.fish b/private_dot_config/private_fish/functions/hx.fish index a9499fa..cf87850 100644 --- a/private_dot_config/private_fish/functions/hx.fish +++ b/private_dot_config/private_fish/functions/hx.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function hx --wraps=helix --description 'alias hx=helix' helix $argv end diff --git a/private_dot_config/private_fish/functions/hxc.fish b/private_dot_config/private_fish/functions/hxc.fish index 28a975e..f452faf 100644 --- a/private_dot_config/private_fish/functions/hxc.fish +++ b/private_dot_config/private_fish/functions/hxc.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function hxc --wraps='chezmoi edit' --description 'alias hxc=chezmoi edit' chezmoi edit $argv end diff --git a/private_dot_config/private_fish/functions/hxs.fish b/private_dot_config/private_fish/functions/hxs.fish index 547482d..a3e6ef5 100644 --- a/private_dot_config/private_fish/functions/hxs.fish +++ b/private_dot_config/private_fish/functions/hxs.fish @@ -1,3 +1,7 @@ +if not status is-interactive + exit +end + function hxs --wraps=sudoedit --description 'alias hxs=sudoedit' sudoedit $argv end