diff --git a/git/.config/git/config b/git/.config/git/config index f443789..beefbcb 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -1,7 +1,7 @@ [user] email = marianoz@posteo.net name = Mariano Z. - signingkey = 13D35660EC8E8AA03D4370A83FA93CB876C8FFAA + signingkey = E54F23DDA33256B4BC82B7184C73BAD25156DACE [core] autocrlf = input diff --git a/gnupg/.gnupg/gpg-agent.conf b/gnupg/.gnupg/gpg-agent.conf index f52ffae..241c605 100644 Binary files a/gnupg/.gnupg/gpg-agent.conf and b/gnupg/.gnupg/gpg-agent.conf differ diff --git a/gnupg/.gnupg/gpg.conf b/gnupg/.gnupg/gpg.conf index c59138f..22dd95d 100644 Binary files a/gnupg/.gnupg/gpg.conf and b/gnupg/.gnupg/gpg.conf differ diff --git a/gnupg/.gnupg/sshcontrol b/gnupg/.gnupg/sshcontrol index aaac24e..c7646d4 100644 Binary files a/gnupg/.gnupg/sshcontrol and b/gnupg/.gnupg/sshcontrol differ diff --git a/local-bin/.local/bin/code.sh b/local-bin/.local/bin/code.sh index df57521..8d14696 100755 --- a/local-bin/.local/bin/code.sh +++ b/local-bin/.local/bin/code.sh @@ -1,12 +1,12 @@ -#!/bin/bash -MODULE_URL="mzunino.com.uy/go/code" +#!/usr/bin/env bash +MODULE_URL="github.com/marianozunino/code/v2" BINARY_NAME="code" TARGET_DIR="$HOME/.local/bin" BINARY_PATH="$TARGET_DIR/$BINARY_NAME" if [ ! -x "$BINARY_PATH" ]; then notify-send "📦 Installing $BINARY_NAME" "Installing from $MODULE_URL..." - GO111MODULE=on GOBIN="$TARGET_DIR" go install "$MODULE_URL@master" || { + GO111MODULE=on GOBIN="$TARGET_DIR" go install "$MODULE_URL@v2.0.2" || { notify-send -u critical "Installation Failed" "Failed to install $BINARY_NAME from $MODULE_URL" exit 1 } diff --git a/local-bin/.local/bin/dbeaver-backup.sh b/local-bin/.local/bin/dbeaver-backup.sh index 07626b1..07162e6 100755 --- a/local-bin/.local/bin/dbeaver-backup.sh +++ b/local-bin/.local/bin/dbeaver-backup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # DBeaver Profile Backup Script # This script creates a backup of DBeaver profiles and configurations diff --git a/local-bin/.local/bin/dbeaver-restore.sh b/local-bin/.local/bin/dbeaver-restore.sh index 35a143e..57deb07 100755 --- a/local-bin/.local/bin/dbeaver-restore.sh +++ b/local-bin/.local/bin/dbeaver-restore.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # DBeaver Profile Restore Script # This script restores a DBeaver backup created with the backup script diff --git a/local-bin/.local/bin/fix-git.sh b/local-bin/.local/bin/fix-git.sh index d273ef4..1a58470 100755 --- a/local-bin/.local/bin/fix-git.sh +++ b/local-bin/.local/bin/fix-git.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash OLD_URL=$(git remote get-url origin) if [[ $OLD_URL == "https://github.com"* ]]; then diff --git a/local-bin/.local/bin/font-manager b/local-bin/.local/bin/font-manager index 88cdbda..6ba896c 100755 --- a/local-bin/.local/bin/font-manager +++ b/local-bin/.local/bin/font-manager @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ~/.local/bin/font-manager # This script extracts font archives and rebuilds font cache # Enhanced version with better integration and error handling diff --git a/local-bin/.local/bin/goq.sh b/local-bin/.local/bin/goq.sh index 5319f8b..a410470 100755 --- a/local-bin/.local/bin/goq.sh +++ b/local-bin/.local/bin/goq.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash MODULE_URL="github.com/marianozunino/goq" BINARY_NAME="goq" TARGET_DIR="$HOME/.local/bin" diff --git a/local-bin/.local/bin/leapp.sh b/local-bin/.local/bin/leapp.sh index d9a61f9..745213a 100755 --- a/local-bin/.local/bin/leapp.sh +++ b/local-bin/.local/bin/leapp.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash REPO="noovolari/leapp" BINARY_NAME="leapp" TARGET_DIR="$HOME/.local/bin" diff --git a/local-bin/.local/bin/lock.sh b/local-bin/.local/bin/lock.sh index 157db44..7a8b16d 100755 --- a/local-bin/.local/bin/lock.sh +++ b/local-bin/.local/bin/lock.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash swaylock -f \ --screenshots \ --clock \ diff --git a/local-bin/.local/bin/maintenance.sh b/local-bin/.local/bin/maintenance.sh index 3aaf24d..51339a5 100755 --- a/local-bin/.local/bin/maintenance.sh +++ b/local-bin/.local/bin/maintenance.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Make sure we're running as root or with sudo if [ "$(id -u)" -ne 0 ]; then diff --git a/local-bin/.local/bin/nosql.sh b/local-bin/.local/bin/nosql.sh index 212f0d2..a5997ed 100755 --- a/local-bin/.local/bin/nosql.sh +++ b/local-bin/.local/bin/nosql.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash BINARY_NAME="nosql" TARGET_DIR="$HOME/.local/bin" BINARY_PATH="$TARGET_DIR/$BINARY_NAME" diff --git a/local-bin/.local/bin/openlens.sh b/local-bin/.local/bin/openlens.sh index 0ad43cd..fe04101 100755 --- a/local-bin/.local/bin/openlens.sh +++ b/local-bin/.local/bin/openlens.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash REPO="MuhammedKalkan/OpenLens" BINARY_NAME="openlens" TARGET_DIR="$HOME/.local/bin" diff --git a/local-bin/.local/bin/randwall b/local-bin/.local/bin/randwall index f882d37..e10c4f3 100755 --- a/local-bin/.local/bin/randwall +++ b/local-bin/.local/bin/randwall @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Kill any existing swaybg or feh instances pkill swaybg diff --git a/local-bin/.local/bin/redis.sh b/local-bin/.local/bin/redis.sh index 1e397c1..fed9860 100755 --- a/local-bin/.local/bin/redis.sh +++ b/local-bin/.local/bin/redis.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash REPO="qishibo/AnotherRedisDesktopManager" BINARY_NAME="redis" TARGET_DIR="$HOME/.local/bin" diff --git a/local-bin/.local/bin/rop.sh b/local-bin/.local/bin/rop.sh index 5b80c1b..121d1de 100755 --- a/local-bin/.local/bin/rop.sh +++ b/local-bin/.local/bin/rop.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash MODULE_URL="github.com/marianozunino/rop" BINARY_NAME="rop" TARGET_DIR="$HOME/.local/bin" diff --git a/local-bin/.local/bin/screenshot-upload b/local-bin/.local/bin/screenshot-upload index 4615333..d408643 100755 --- a/local-bin/.local/bin/screenshot-upload +++ b/local-bin/.local/bin/screenshot-upload @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash file=/tmp/$(date "+%Y%m%d-%H%M%S")_screenshot.png grim -g "$(slurp)" "$file" && diff --git a/local-bin/.local/bin/sdm-ui.sh b/local-bin/.local/bin/sdm-ui.sh index b0457c6..c33f85a 100755 --- a/local-bin/.local/bin/sdm-ui.sh +++ b/local-bin/.local/bin/sdm-ui.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash MODULE_URL="github.com/marianozunino/sdm-ui" BINARY_NAME="sdm-ui" TARGET_DIR="$HOME/.local/bin" diff --git a/local-bin/.local/bin/sm.sh b/local-bin/.local/bin/sm.sh index bfcfb9a..dec2670 100755 --- a/local-bin/.local/bin/sm.sh +++ b/local-bin/.local/bin/sm.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash BINARY_NAME="sm" TARGET_DIR="$HOME/.local/bin" BINARY_PATH="$TARGET_DIR/$BINARY_NAME" diff --git a/local-bin/.local/bin/waybar.sh b/local-bin/.local/bin/waybar.sh index 1cb365b..9c5ff0f 100755 --- a/local-bin/.local/bin/waybar.sh +++ b/local-bin/.local/bin/waybar.sh @@ -1,11 +1,11 @@ -#!/bin/bash +#!/usr/bin/env bash CONFIG_FILES="$HOME/.config/waybar/config.jsonc $HOME/.config/waybar/style.css" trap "killall waybar" EXIT while true; do - waybar & - inotifywait -e create,modify $CONFIG_FILES - killall waybar + waybar & + inotifywait -e create,modify $CONFIG_FILES + killall waybar done diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 0b971d3..dbcbba7 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -1,5 +1,6 @@ # Include system defaults -include /etc/sway/config.d/* +# include /etc/sway/config.d/* +exec systemd-cat --identifier=sway dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway # Include custom configuration modules include ~/.config/sway/config.d/variables diff --git a/sway/.config/sway/config.d/appearance b/sway/.config/sway/config.d/appearance index 237c49a..7a165f7 100644 --- a/sway/.config/sway/config.d/appearance +++ b/sway/.config/sway/config.d/appearance @@ -15,13 +15,13 @@ gaps outer 5 xwayland enable # SwayFX Settings -smart_corner_radius on -corner_radius 10 - -default_dim_inactive 0.05 -blur enable -blur_passes 1 -blur_radius 1 -layer_effects "waybar" "blur enable"; shadows enable -shadows on -shadow_blur_radius 20 +# smart_corner_radius on +# corner_radius 10 +# +# default_dim_inactive 0.05 +# blur enable +# blur_passes 1 +# blur_radius 1 +# layer_effects "waybar" "blur enable"; shadows enable +# shadows on +# shadow_blur_radius 20 diff --git a/sway/.config/sway/config.d/autostart b/sway/.config/sway/config.d/autostart index d7f5e7d..997fead 100644 --- a/sway/.config/sway/config.d/autostart +++ b/sway/.config/sway/config.d/autostart @@ -1,28 +1,28 @@ # vim: ft=swayconfig # System Services exec { - /usr/lib/mate-polkit/polkit-mate-authentication-agent-1 + # /usr/lib/mate-polkit/polkit-mate-authentication-agent-1 blueman-applet nm-applet swaync wlsunset -l -34.9 -L -56.2 -t 4500 -g 0.9 easyeffects --gapplication-service } - -# User Interface +# +# # User Interface exec { ~/.local/bin/randwall ~/.local/bin/waybar.sh } - +# # Applications exec { $term --class="uy.com.mzunino" slack davmail - betterbird - zen-browser - obsidian - localsend + thunderbird + zen + # obsidian + localsend_app vesktop } diff --git a/sway/.config/sway/config.d/keybindings b/sway/.config/sway/config.d/keybindings index bd2cac7..2e01494 100644 --- a/sway/.config/sway/config.d/keybindings +++ b/sway/.config/sway/config.d/keybindings @@ -16,7 +16,7 @@ bindgesture swipe:down workspace prev bindsym { $mod+Return exec $term $mod+d exec rofi -show combi -combi-modi "window,drun" -modi combi - $mod+t exec ~/.local/bin/code.sh -s ~/.local/bin/fuzzel.lua + $mod+t exec ~/.local/bin/code.sh -s ~/.local/bin/rofi.yaml $mod+shift+t exec ~/.local/bin/present $mod+n exec ~/.local/bin/sdm-ui.sh dmenu $mod+o exec ~/.local/bin/launch-or-focus obsidian "cd /home/forbi/Documents/Vault && $term --class obsidian nvim" diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 2af518d..f384825 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -15,6 +15,7 @@ setw -g aggressive-resize on # Only resize screen if smaller scree set -g history-limit 10000 # Store 10k lines of history set-option -g allow-rename off # Disable automatic window renaming set-option -s set-clipboard on # Enable clipboard support +setw -g mode-keys vi # Use vi keys in copy mode # Key Bindings @@ -35,6 +36,25 @@ bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5 +# Vim-like copy mode navigation +bind-key -T copy-mode-vi h send-keys -X cursor-left +bind-key -T copy-mode-vi j send-keys -X cursor-down +bind-key -T copy-mode-vi k send-keys -X cursor-up +bind-key -T copy-mode-vi l send-keys -X cursor-right +bind-key -T copy-mode-vi w send-keys -X next-word +bind-key -T copy-mode-vi b send-keys -X previous-word +bind-key -T copy-mode-vi 0 send-keys -X start-of-line +bind-key -T copy-mode-vi $ send-keys -X end-of-line +bind-key -T copy-mode-vi G send-keys -X history-bottom +bind-key -T copy-mode-vi g send-keys -X history-top +bind-key -T copy-mode-vi / command-prompt -T search -I "#{pane_current_path}" "send -X search-forward \"%%\"" +bind-key -T copy-mode-vi ? command-prompt -T search -I "#{pane_current_path}" "send -X search-backward \"%%\"" +bind-key -T copy-mode-vi n send-keys -X search-again +bind-key -T copy-mode-vi N send-keys -X search-reverse +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel +bind-key -T copy-mode-vi Escape send-keys -X cancel + # Move pane to a different window bind-key m choose-window -F "#{window_index}: #{window_name}" "join-pane -h -t %%" bind-key M choose-window -F "#{window_index}: #{window_name}" "join-pane -v -t %%" @@ -85,7 +105,7 @@ set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(🔍),}" set -g @catppuccin_window_default_text "#W" # Determine status modules based on hostname -run-shell "if [ $(hostname) = 't14' ]; then \ +run-shell "if [ $(hostname) = 'fw' ]; then \ tmux set -g @catppuccin_status_modules_right 'date_time battery session'; \ else \ tmux set -g @catppuccin_status_modules_right 'date_time session'; \ diff --git a/waybar/.config/waybar/common.jsonc b/waybar/.config/waybar/common.jsonc index 39dc9ee..376158a 100644 --- a/waybar/.config/waybar/common.jsonc +++ b/waybar/.config/waybar/common.jsonc @@ -123,16 +123,16 @@ ] } }, - "pulseaudio#microphone": { - "format": "{format_source}", - "format-source": " {volume}%", - "format-source-muted": " Muted", - "on-click": "wpctl set-mute @DEFAULT_SOURCE@ toggle", - "on-click-right": "pavucontrol", - "on-scroll-up": "wpctl set-volume -l 1 @DEFAULT_SOURCE@ 5%+", - "on-scroll-down": "wpctl set-volume -l 1 @DEFAULT_SOURCE@ 5%-", - "scroll-step": 5 - }, + // "pulseaudio#microphone": { + // "format": "{format_source}", + // "format-source": " {volume}%", + // "format-source-muted": " Muted", + // "on-click": "wpctl set-mute @DEFAULT_SOURCE@ toggle", + // "on-click-right": "pavucontrol", + // "on-scroll-up": "wpctl set-volume -l 1 @DEFAULT_SOURCE@ 5%+", + // "on-scroll-down": "wpctl set-volume -l 1 @DEFAULT_SOURCE@ 5%-", + // "scroll-step": 5 + // }, "temperature": { "thermal-zone": 1, "format": " {temperatureC}°C", diff --git a/waybar/.config/waybar/config.jsonc b/waybar/.config/waybar/config.jsonc index c487136..66b7b94 100644 --- a/waybar/.config/waybar/config.jsonc +++ b/waybar/.config/waybar/config.jsonc @@ -45,21 +45,21 @@ "custom/wf-recorder", "custom/randwall", "pulseaudio", - "custom/vpn", + // "custom/vpn", "custom/notification", "tray", "clock" ], "output": [ "HDMI-A-1" - ], - "custom/vpn": { - "format": "{}", - "return-type": "json", - "interval": 1, - "exec": "/home/forbi/.local/bin/vpn", - "on-click": "/home/forbi/.local/bin/vpn toggle" - } + ] + // "custom/vpn": { + // "format": "{}", + // "return-type": "json", + // "interval": 1, + // "exec": "/home/forbi/.local/bin/vpn", + // "on-click": "/home/forbi/.local/bin/vpn toggle" + // } }, { "include": [ @@ -73,10 +73,10 @@ "custom/playerlabel" ], "modules-right": [ - "custom/microphone", + // "custom/microphone", "custom/randwall", "pulseaudio", - "custom/vpn", + // "custom/vpn", "custom/notification", "backlight", "battery", @@ -85,20 +85,20 @@ ], "output": [ "eDP-1" - ], - "custom/vpn": { - "format": "{}", - "return-type": "json", - "interval": 1, - "exec": "/home/forbi/.local/bin/vpn", - "on-click": "/home/forbi/.local/bin/vpn toggle" - }, - "custom/microphone": { - "format": "{}", - "return-type": "json", - "exec": "~/.config/waybar/scripts/mic-status.sh --monitor", - "restart-interval": 1, - "on-click": "pavucontrol -t 4" - } + ] + // "custom/vpn": { + // "format": "{}", + // "return-type": "json", + // "interval": 1, + // "exec": "/home/forbi/.local/bin/vpn", + // "on-click": "/home/forbi/.local/bin/vpn toggle" + // } + // "custom/microphone": { + // "format": "{}", + // "return-type": "json", + // "exec": "~/.config/waybar/scripts/mic-status.sh --monitor", + // "restart-interval": 1, + // "on-click": "pavucontrol -t 4" + // } } ] diff --git a/waybar/.config/waybar/style.css b/waybar/.config/waybar/style.css index e6ea0f8..0c29a45 100644 --- a/waybar/.config/waybar/style.css +++ b/waybar/.config/waybar/style.css @@ -25,7 +25,7 @@ tooltip { #workspaces button { color: #fff; border-radius: 10px; - padding: 0px; + padding: 5px; margin: 4px 4px; } diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile index 960327f..714bfb9 100644 --- a/zsh/.config/zsh/.zprofile +++ b/zsh/.config/zsh/.zprofile @@ -11,5 +11,6 @@ export ZDOTDIR=${ZDOTDIR:-~/.config/zsh} if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then #exec niri exec sway + # exec niri fi diff --git a/zsh/.config/zsh/alias.zsh b/zsh/.config/zsh/alias.zsh index de340bf..51afeee 100644 --- a/zsh/.config/zsh/alias.zsh +++ b/zsh/.config/zsh/alias.zsh @@ -1,6 +1,6 @@ # Package management alias fly='flyctl' -alias yay="paru --bottomup" +# alias yay="paru --bottomup" alias yeet="sudo pacman -Rns" alias orphan="doas pacman -Rns (pacman -Qtdq)" @@ -44,7 +44,6 @@ alias gho="gh browse" alias gh-clone='gc' alias task='go-task' alias sdu='sdm-ui fzf' -alias fd='/bin/fd' # Tmux @@ -58,6 +57,8 @@ alias doomconf="vim ~/.config/gzdoom/gzdoom.ini" alias pluginconf="vim ~/.config/nvim/plugins.vim" alias i3conf="vim ~/.config/i3/config" alias cssh="vim ~/.ssh/config" +alias sm="sublime_merge" +alias nv = "nix run github:vic/nix-versions --"; function vimwhich { nvim $(which $1) diff --git a/zsh/.config/zsh/completions.zsh b/zsh/.config/zsh/completions.zsh index 4b4440d..8ac07bc 100644 --- a/zsh/.config/zsh/completions.zsh +++ b/zsh/.config/zsh/completions.zsh @@ -46,3 +46,45 @@ _kf_completion() { # Register the completion compdef _kf_completion kf + + +_yay_completion() { + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + opts="-Syyu -Syu -Ss -S -R -Q -Si -Sc help install remove list clean" + + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 +} + +# For zsh: +_yay_zsh_completion() { + local -a opts + opts=( + '-Syyu:Update system' + '-Syu:Update system' + '-Ss:Search packages' + '-S:Install system-wide' + '-R:Remove package' + '-Q:List installed' + '-Si:Package info' + '-Sc:Clean cache' + 'help:Show help' + 'install:Install to user env' + 'remove:Remove from user env' + 'list:List installed packages' + 'clean:Clean nix store' + ) + _describe 'yay commands' opts +} + +# Enable completion based on shell +if [[ -n "${BASH_VERSION:-}" ]]; then + complete -F _yay_completion yay +elif [[ -n "${ZSH_VERSION:-}" ]]; then + compdef _yay_zsh_completion yay +fi + diff --git a/zsh/.config/zsh/functions.zsh b/zsh/.config/zsh/functions.zsh index 04b8e41..2a10023 100644 --- a/zsh/.config/zsh/functions.zsh +++ b/zsh/.config/zsh/functions.zsh @@ -23,7 +23,7 @@ function open { echo "Opens files using the system default application" return 1 fi - + for i in "$@"; do if [[ ! -e "$i" ]]; then echo "Warning: '$i' does not exist" >&2 @@ -39,12 +39,12 @@ function fopen() { echo "Error: fd is not installed" >&2 return 1 fi - + if ! command -v fzf >/dev/null 2>&1; then echo "Error: fzf is not installed" >&2 return 1 fi - + local selected selected=$(fd "$@" | fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}') [[ -n "$selected" ]] && setsid nohup xdg-open "$selected" >/dev/null 2>&1 & @@ -57,7 +57,7 @@ function fopen() { # Smart package manager detection and execution function _package_manager { local pkg_manager="" - + # Detect package manager based on lock files if [[ -f bun.lockb ]]; then pkg_manager="bun" @@ -95,7 +95,7 @@ function dc() { echo "If no message provided, uses timestamp-based message" return 0 fi - + if ! git rev-parse --is-inside-work-tree &>/dev/null; then echo "Error: Not in a git repository" >&2 return 1 @@ -139,7 +139,7 @@ function git-clean() { echo "Protects main, master, and develop branches" return 0 fi - + if ! git rev-parse --is-inside-work-tree &>/dev/null; then echo "Error: Not in a git repository" >&2 return 1 @@ -174,22 +174,13 @@ function git-clean() { fi } -# Open Sublime Merge -function sm { - if [[ ! -f /opt/sublime_merge/sublime_merge ]]; then - echo "Error: Sublime Merge not found at /opt/sublime_merge/sublime_merge" >&2 - return 1 - fi - /opt/sublime_merge/sublime_merge "$@" -} - # Quick access to Neovim config function vimrc { if [[ -z "$XDG_CONFIG_HOME" ]]; then echo "Error: XDG_CONFIG_HOME not set" >&2 return 1 fi - + local original_dir=$(pwd) cd "$XDG_CONFIG_HOME/nvim" || { echo "Error: Cannot access $XDG_CONFIG_HOME/nvim" >&2 @@ -199,13 +190,29 @@ function vimrc { cd "$original_dir" } + +function nixrc { + if [[ -z "$XDG_CONFIG_HOME" ]]; then + echo "Error: XDG_CONFIG_HOME not set" >&2 + return 1 + fi + + local original_dir=$(pwd) + cd "$XDG_CONFIG_HOME/nixos" || { + echo "Error: Cannot access $XDG_CONFIG_HOME/nixos" >&2 + return 1 + } + nvim + cd "$original_dir" +} + # Quick access to Zsh config function zshrc { if [[ -z "$XDG_CONFIG_HOME" ]]; then echo "Error: XDG_CONFIG_HOME not set" >&2 return 1 fi - + local original_dir=$(pwd) cd "$XDG_CONFIG_HOME/zsh" || { echo "Error: Cannot access $XDG_CONFIG_HOME/zsh" >&2 @@ -224,19 +231,19 @@ function expose() { echo "Example: expose 3000 # Exposes localhost:3000" return 0 fi - + if [[ -z "$1" ]]; then echo "Error: Port number required" >&2 echo "Usage: expose " >&2 return 1 fi - + # Validate port number if ! [[ "$1" =~ ^[0-9]+$ ]] || [[ "$1" -lt 1 ]] || [[ "$1" -gt 65535 ]]; then echo "Error: Invalid port number. Must be between 1-65535" >&2 return 1 fi - + # Check if port is already in use if lsof -i ":$1" >/dev/null 2>&1; then echo "Warning: Port $1 is already in use" >&2 @@ -249,7 +256,7 @@ function expose() { return 1 fi fi - + echo "Creating SSH tunnel for port $1..." ssh marianozunino@srv.us -R 1:localhost:"$1" } @@ -263,19 +270,19 @@ function ppid { echo "Alias: pport" return 0 fi - + if [[ -z "$1" ]]; then echo "Error: Port number required" >&2 echo "Usage: ppid " >&2 return 1 fi - + # Validate port number if ! [[ "$1" =~ ^[0-9]+$ ]] || [[ "$1" -lt 1 ]] || [[ "$1" -gt 65535 ]]; then echo "Error: Invalid port number. Must be between 1-65535" >&2 return 1 fi - + lsof -i ":$1" } @@ -295,7 +302,7 @@ function kf { echo "Example: kf prod my-service" return 0 fi - + if [[ -z "$1" ]]; then echo "Error: Cluster name required" >&2 echo "Usage: kf [service-name]" >&2 @@ -314,7 +321,7 @@ function kf { echo "Error: kubefwd is not installed" >&2 return 1 fi - + echo "Starting kubefwd for cluster: $cluster" sudo -E kubefwd svc -n "${namespace}" -x "${cluster}" ${svc_filter} } @@ -347,15 +354,15 @@ function wacom { echo "Supports both Wayland and X11 sessions" return 0 fi - + if [[ "$XDG_SESSION_TYPE" = "wayland" ]]; then if ! command -v otd >/dev/null 2>&1; then echo "Error: opentabletdriver (otd) not found" >&2 return 1 fi - + systemctl --user enable opentabletdriver --now - + local config_file="$HOME/Sync/System/Configs/wacom/wacom.json" if [[ -f "$config_file" ]]; then otd loadsettings "$config_file" @@ -368,14 +375,14 @@ function wacom { echo "Error: xsetwacom not found" >&2 return 1 fi - + xsetwacom --set "Wacom One by Wacom S Pen stylus" ResetArea xsetwacom --set "Wacom One by Wacom S Pen stylus" MapToOutput DisplayPort-0 xsetwacom --set "Wacom One by Wacom S Pen stylus" Rotate half xsetwacom --set "Wacom One by Wacom S Pen eraser" ResetArea xsetwacom --set "Wacom One by Wacom S Pen eraser" MapToOutput DisplayPort-0 - + echo "Wacom configured for X11" fi } @@ -389,13 +396,13 @@ function cat { echo "Automatically adjusts output for SSH sessions" return 0 fi - + if ! command -v bat >/dev/null 2>&1; then echo "Warning: bat not found, falling back to system cat" >&2 command cat "$@" return $? fi - + if [[ -n "$SSH_TTY" ]] || [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_CONNECTION" ]]; then bat --plain --paging=never "$@" else @@ -413,7 +420,7 @@ function toggle_resolution() { echo " -m, --mirror Force mirror mode" return 0 fi - + local mirror_mode=false # Parse flags @@ -434,7 +441,7 @@ function toggle_resolution() { echo "Error: swaymsg not found. This function requires Sway window manager" >&2 return 1 fi - + # Check if jq is available if ! command -v jq >/dev/null 2>&1; then echo "Error: jq not found. Required for JSON parsing" >&2 @@ -501,18 +508,18 @@ function cb { echo "Launch Code::Blocks with high contrast theme" return 0 fi - + if [[ ! -f /usr/bin/codeblocks ]]; then echo "Error: Code::Blocks not found at /usr/bin/codeblocks" >&2 return 1 fi - + # Store original values local original_gtk_theme="$GTK_THEME" local original_gdk_theme="$GDK_THEME" local original_qt_style="$QT_STYLE_OVERRIDE" local original_xdg_desktop="$XDG_CURRENT_DESKTOP" - + # Set high contrast theme temporarily GTK_THEME=HighContrast \ GDK_THEME=HighContrast \ @@ -521,7 +528,7 @@ function cb { GTK2_RC_FILES="" \ GTK_RC_FILES="" \ /usr/bin/codeblocks "$@" - + # Restore original values export GTK_THEME="$original_gtk_theme" export GDK_THEME="$original_gdk_theme" @@ -539,13 +546,13 @@ function zrepo() { echo "Example: zrepo my-project" return 0 fi - + if [[ -z "$1" ]]; then echo "Error: Repository name required" >&2 echo "Usage: zrepo " >&2 return 1 fi - + # Validate repository name (basic check) if [[ ! "$1" =~ ^[a-zA-Z0-9_-]+$ ]]; then echo "Error: Repository name contains invalid characters" >&2 @@ -558,7 +565,7 @@ function zrepo() { local PATH_ON_SERVER="/var/git/$REPO.git" echo "Creating repository '$REPO' on $SERVER..." - + ssh "$SERVER" " if [ -d $PATH_ON_SERVER ]; then echo 'Error: Repository '$REPO' already exists' @@ -592,7 +599,7 @@ function _has { echo "Usage: _has " >&2 return 1 fi - + whence "$1" >/dev/null 2>&1 } @@ -604,12 +611,12 @@ function cdr { echo "Navigate to recently visited directories using fzf" return 0 fi - + if ! command -v fzf >/dev/null 2>&1; then echo "Error: fzf is not installed" >&2 return 1 fi - + local dir dir=$(dirs -pl | awk '!x[$0]++' | fzf --height 40% --reverse) [[ -n "$dir" ]] && cd "$dir" @@ -653,15 +660,15 @@ function font-switch() { echo "Example: font-switch jetbrains-mono" return 0 fi - + if [[ -z "$1" ]]; then echo "Available fonts:" font-manager list return 0 fi - + local font_name="$1" - + # Check if font exists if ! font-manager list | grep -q "$font_name"; then echo "Error: Font '$font_name' not found" >&2 @@ -669,17 +676,17 @@ function font-switch() { font-manager list >&2 return 1 fi - + echo "Switching to $font_name fonts..." font-manager clean font-manager extract "$font_name" - + # Reload terminal if in kitty if [[ "$TERM" == "xterm-kitty" ]] && command -v kitty >/dev/null 2>&1; then echo "Reloading kitty configuration..." kitty @ set-colors --all ~/.config/kitty/kitty.conf fi - + echo "Font switch complete!" } @@ -692,24 +699,107 @@ function font-preview() { echo "Example: font-preview jetbrains-mono" return 0 fi - + if [[ -z "$1" ]]; then echo "Error: Font name required" >&2 echo "Usage: font-preview [font-name]" >&2 return 1 fi - + local font_name="$1" local preview_text="The quick brown fox jumps over the lazy dog ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()_+-=[]{}|;':\",./<>?" - + echo "Previewing font: $font_name" echo "----------------------------------------" echo "$preview_text" | font-manager extract "$font_name" && echo "$preview_text" } +yay() { + case "$1" in + # System update + update|"-Syu") + echo "Updating NixOS system..." + nh os switch ~/.config/nixos --update + ;; + # Search packages + search|"-Ss") + [ -z "$2" ] && { echo "Usage: yay search "; return 1; } + echo "Searching for '$2'..." + nix search nixpkgs "$2" 2>/dev/null || nix-env -qaP | grep -i "$2" + ;; + + # Install package to user environment + install|"-S") + [ -z "$2" ] && { echo "Usage: yay install "; return 1; } + echo "Installing $2..." + nix-env -iA nixpkgs.$2 + ;; + + # Remove package + remove|"-R") + [ -z "$2" ] && { echo "Usage: yay remove "; return 1; } + echo "Removing $2..." + nix-env -e "$2" + ;; + + # List installed packages + list|"-Q") + echo "Installed packages:" + nix-env -q + ;; + + # Clean up + clean|"-Sc") + echo "Cleaning nix store..." + nix-collect-garbage + sudo nix-collect-garbage -d + ;; + + # Help + help|"-h") + bat -Pp << 'EOF' +yay - Simple NixOS package manager wrapper + +Commands: + yay Rebuild system + yay update Update system + yay search Search packages + yay install Install package (user) + yay remove Remove package + yay list List installed packages + yay clean Clean package cache + yay help Show this help + +Note: For system packages, edit ~/.config/nixos/configuration.nix +EOF + ;; + + # Default: rebuild system + "") + echo "Rebuilding NixOS system..." + nh os switch ~/.config/nixos + ;; + + # Try to install unknown commands + *) + if [[ ! "$1" =~ ^- ]]; then + echo "Installing '$1'..." + nix-env -iA nixpkgs.$1 + else + echo "Unknown option: $1" + echo "Run 'yay help' for available commands" + return 1 + fi + ;; + esac +} + +function nas() { + rclone mount --vfs-cache-mode writes --dir-cache-time 5s --no-check-certificate --allow-other nas: /home/mzunino/nas +} diff --git a/zsh/.config/zsh/init.zsh b/zsh/.config/zsh/init.zsh index 77c35ec..da77361 100644 --- a/zsh/.config/zsh/init.zsh +++ b/zsh/.config/zsh/init.zsh @@ -76,10 +76,10 @@ source "$PLUGIN_DIR/minimal/minimal.zsh" # Source config files source "$ZDOTDIR/opts.zsh" source "$ZDOTDIR/rose-pine.sh" -source "$ZDOTDIR/maintenance.zsh" +#source "$ZDOTDIR/maintenance.zsh" # Defer loading zsh-defer source "$PLUGIN_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" for config in mise.zsh tmux.zsh functions.zsh alias.zsh keymap.zsh path.zsh pnpm.zsh; do zsh-defer source "$ZDOTDIR/$config" -done \ No newline at end of file +done diff --git a/zsh/.config/zsh/keymap.zsh b/zsh/.config/zsh/keymap.zsh index b360774..ecbe8fc 100644 --- a/zsh/.config/zsh/keymap.zsh +++ b/zsh/.config/zsh/keymap.zsh @@ -73,3 +73,19 @@ bindkey "^[[H" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line + +# Function to open NixOS config directory +function edit-nixos-config() { + # Store current directory + local original_dir="$PWD" + + # Build the command that will cd, run nvim, then cd back + BUFFER="cd ~/.config/nixos && nvim . && cd '$original_dir'" + zle accept-line +} +zle -N edit-nixos-config + +# Bind Ctrl+X then C in both insert and command modes +bindkey -M viins '^xc' edit-nixos-config +bindkey -M vicmd '^xc' edit-nixos-config + diff --git a/zsh/.config/zsh/zsh_history_fw b/zsh/.config/zsh/zsh_history_fw index a49ba33..dd56703 100644 Binary files a/zsh/.config/zsh/zsh_history_fw and b/zsh/.config/zsh/zsh_history_fw differ