From 5c07f66f92482d85215419472326d911b06ad8fd Mon Sep 17 00:00:00 2001 From: = Date: Tue, 14 Jan 2025 21:16:50 -0500 Subject: [PATCH] ghostty, sway keybinds --- dot_xonshrc | 39 +++++++++++++++++++++++++++++++ private_dot_config/ghostty/config | 3 ++- private_dot_config/sway/keybinds | 9 +++---- 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 dot_xonshrc diff --git a/dot_xonshrc b/dot_xonshrc new file mode 100644 index 0000000..b25d0fb --- /dev/null +++ b/dot_xonshrc @@ -0,0 +1,39 @@ +source-bash ~/.envrc --overwrite-aliases +# Zoxide +execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide') + +xontrib load coreutils +xontrib load vox +xontrib load autovox +xontrib load prompt_starship +xontrib load bashisms +xontrib load sh + + +# TODO: Does this work? +def yy(args=None): + import tempfile + """ + Yazi file manager wrapper that follows directory changes. + Usage: y() or y('some/path') + """ + with tempfile.NamedTemporaryFile(prefix='yazi-cwd.', suffix='.tmp') as tmp: + # Build command arguments + cmd_args = ['yazi'] + if args: + cmd_args.append(str(args)) + cmd_args.append(f'--cwd-file={tmp.name}') + + # Run yazi + @(cmd_args) + + # Read new working directory + try: + with open(tmp.name) as f: + new_cwd = f.read().strip() + + # Change directory if valid and different + if new_cwd and os.path.isdir(new_cwd) and new_cwd != os.getcwd(): + cd @(new_cwd) + except (IOError, OSError): + pass diff --git a/private_dot_config/ghostty/config b/private_dot_config/ghostty/config index 7506e6d..3e0c58e 100644 --- a/private_dot_config/ghostty/config +++ b/private_dot_config/ghostty/config @@ -24,7 +24,8 @@ palette = 4=#334773 palette = 5=#a34a78 palette = 6=#2a97b1 palette = 7=#9a9ab8 -palette = 8=#504573 +# palette = 8=#504573 +palette = 8=#74689F palette = 9=#ed8096 palette = 10=#a0dc9b palette = 11=#c1b254 diff --git a/private_dot_config/sway/keybinds b/private_dot_config/sway/keybinds index 4219566..2cace6a 100644 --- a/private_dot_config/sway/keybinds +++ b/private_dot_config/sway/keybinds @@ -162,11 +162,12 @@ bindsym XF86MonBrightnessDown exec brightnessctl -e s 5%- bindsym $mod+b exec xdg-open http:// -bindsym $mod+Shift+e exec rofi -show p -modi p:'rofi-power-menu --symbols-font "Symbols Nerd Font Mono"' -theme lunar-witch -bindsym $mod+space exec rofi -combi-modi "drun#run" -show combi -show-icons -theme lunar-witch +# bindsym $mod+Shift+e exec zsh -c "rofi -show p -modi p:'rofi-power-menu --symbols-font \"Symbols Nerd Font Mono\"' -theme lunar-witch" +bindsym $mod+Shift+e exec zsh -c "rofi -show p -modi p:'rofi-power-menu' -theme lunar-witch" +bindsym $mod+space exec zsh -c "rofi -combi-modi 'drun#run' -show combi -show-icons -theme lunar-witch" -bindsym Print exec grim - | tee "$XDG_PICTURES_DIR/screenshots/$(date -Is).png" | wl-copy -t image/png -bindsym Shift+Print exec grim -g "$(slurp)" - | tee "$XDG_PICTURES_DIR/screenshots/$(date -Is).png" | wl-copy -t image/png +bindsym Print exec zsh -c 'grim - | tee "$XDG_PICTURES_DIR/screenshots/$(date -Is).png" | wl-copy -t image/png' +bindsym Shift+Print exec zsh -c 'grim -g "$(slurp)" - | tee "$XDG_PICTURES_DIR/screenshots/$(date -Is).png" | wl-copy -t image/png' bindsym Ctrl+Print exec TEMP=$(mktemp); grim -g "$(slurp)" $TEMP && notify-send "$TEMP" && flatpak run org.gimp.GIMP -- $TEMP bindsym $mod+Shift+v exec cliphist list | rofi -dmenu -display-columns 2 -p "Select item to copy" -lines 10 -width 35 -theme lunar-witch | cliphist decode | wl-copy