Initial commit

This commit is contained in:
2025-07-11 18:08:12 +03:00
commit 74c6a29a13
478 changed files with 23775 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
complete -c aichat -s m -l model -x -a "(aichat --list-models)" -d 'Select a LLM model' -r
complete -c aichat -l prompt -d 'Use the system prompt'
complete -c aichat -s r -l role -x -a "(aichat --list-roles)" -d 'Select a role' -r
complete -c aichat -s s -l session -x -a "(aichat --list-sessions)" -d 'Start or join a session' -r
complete -c aichat -l empty-session -d 'Ensure the session is empty'
complete -c aichat -l save-session -d 'Ensure the new conversation is saved to the session'
complete -c aichat -s a -l agent -x -a "(aichat --list-agents)" -d 'Start a agent' -r
complete -c aichat -l agent-variable -d 'Set agent variables'
complete -c aichat -l rag -x -a"(aichat --list-rags)" -d 'Start a RAG' -r
complete -c aichat -l rebuild-rag -d 'Rebuild the RAG to sync document changes'
complete -c aichat -l macro -x -a"(aichat --list-macros)" -d 'Execute a macro' -r
complete -c aichat -l serve -d 'Serve the LLM API and WebAPP'
complete -c aichat -s e -l execute -d 'Execute commands in natural language'
complete -c aichat -s c -l code -d 'Output code only'
complete -c aichat -s f -l file -d 'Include files, directories, or URLs' -r -F
complete -c aichat -s S -l no-stream -d 'Turn off stream mode'
complete -c aichat -l dry-run -d 'Display the message without sending it'
complete -c aichat -l info -d 'Display information'
complete -c aichat -l sync-models -d 'Sync models updates'
complete -c aichat -l list-models -d 'List all available chat models'
complete -c aichat -l list-roles -d 'List all roles'
complete -c aichat -l list-sessions -d 'List all sessions'
complete -c aichat -l list-agents -d 'List all agents'
complete -c aichat -l list-rags -d 'List all RAGs'
complete -c aichat -l list-macros -d 'List all macros'
complete -c aichat -s h -l help -d 'Print help'
complete -c aichat -s V -l version -d 'Print version'

View File

@@ -0,0 +1,55 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
alias cl="clear"
alias rad="rad-tui"
alias ai="aichat"
alias ai-commit="git diff --staged | ai -r commit-message | hx"
alias ai-emoji-commit="git diff --staged | ai -r emoji-commit-message | hx"
alias ai-branch="git diff --staged | ai -r git-branch | hx"
alias ai-spell="vipe | ai -r improve-writing | hx"
alias ai-email="vipe | ai -r email-answer | hx"
alias ai-linkedin="vipe | ai -r linked-answer | hx"
alias aic="ai-commit"
alias aiec="ai-emoji-commit"
alias aib="ai-branch"
alias ais="ai-spell"
alias aie="ai-email"
alias ail="ai-linkedin"
alias lgit="lazygit"
alias ldocker="lazydocker"
alias conf="z ~/.config"
alias nixos="z /etc/nixos"
alias store="z /nix/store"
alias nswitch="sudo nixos-rebuild switch --flake /etc/nixos#isitreal-laptop"
alias nswitchu="sudo nix flake update --flake /etc/nixos; and sudo nixos-rebuild switch --flake /etc/nixos#isitreal-laptop --upgrade"
alias nau="sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos"
alias nsgc="sudo nix-store --gc"
alias ngc="sudo nix-collect-garbage -d"
alias ngc7="sudo nix-collect-garbage --delete-older-than 7d"
alias ngc14="sudo nix-collect-garbage --delete-older-than 14d"
# if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]
# exec Hyprland
# end
set -gx EDITOR hx
set -gx VOLUME_STEP 5
set -gx BRIGHTNESS_STEP 5
set -gx PATH $HOME/.cargo/bin $PATH
set fish_vi_force_cursor
set fish_cursor_default block
set fish_cursor_insert line blink
set fish_cursor_visual underscore blink
set -Ux FZF_DEFAULT_OPTS "\
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
--color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796"
starship init fish | source
zoxide init fish | source
direnv hook fish | source

View File

@@ -0,0 +1,32 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR --export FZF_DEFAULT_OPTS:\x2d\x2dcolor\x3dbg\x2b\x3a\x23363a4f\x2cbg\x3a\x2324273a\x2cspinner\x3a\x23f4dbd6\x2chl\x3a\x23ed8796\x20\x2d\x2dcolor\x3dfg\x3a\x23cad3f5\x2cheader\x3a\x23ed8796\x2cinfo\x3a\x23c6a0f6\x2cpointer\x3a\x23f4dbd6\x20\x2d\x2dcolor\x3dmarker\x3a\x23f4dbd6\x2cfg\x2b\x3a\x23cad3f5\x2cprompt\x3a\x23c6a0f6\x2chl\x2b\x3a\x23ed8796
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:blue
SETUVAR fish_color_comment:red
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:green
SETUVAR fish_color_error:brred
SETUVAR fish_color_escape:brcyan
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:brcyan
SETUVAR fish_color_param:cyan
SETUVAR fish_color_quote:yellow
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d111
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr

View File

@@ -0,0 +1,8 @@
function aichat_fish
set -l _old (commandline)
if test -n $_old
echo -n "⌛"
commandline -f repaint
commandline (aichat -e $_old)
end
end

View File

@@ -0,0 +1,33 @@
function airplane_mode_toggle
set backup_file ~/.cache/airplane_backup
if test -e $backup_file
# Read network states from the backup file
set -l wifi_status (cat $backup_file | grep -o 'wifi:\(on\|off\)$' | cut -d':' -f2)
set -l bluetooth_status (cat $backup_file | grep -o 'bluetooth:\(on\|off\)$' | cut -d':' -f2)
# Restore network states
if test "$wifi_status" = on
rfkill unblock wifi
# else
# rfkill block wifi
end
if test "$bluetooth_status" = on
rfkill unblock bluetooth
# else
# rfkill block bluetooth
end
# Remove the backup file
rm $backup_file
else
# Backup the current network states and turn off all networks
echo "wifi:$(rfkill list wifi | grep -q "Soft blocked: no" && echo "on" || echo "off")" >$backup_file
echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >>$backup_file
# Add more lines to backup other network types if needed
rfkill block wifi
rfkill block bluetooth
end
end

View File

@@ -0,0 +1,11 @@
function archive-preview
set archive "$argv[1]"
set supported_archive_formats tar.gz tar.bz2 tar.xz zip rar 7z
for format in $supported_archive_formats
if string match -q "application/$format" (file -b --mime-type "$archive")
ouch list --tree --no "$archive"
exit 0
end
end
end

View File

@@ -0,0 +1,3 @@
function autostart
pypr & hyprpaper & waybar & poweralertd -s & wl-paste --type text --watch cliphist store & wl-paste --type image --watch cliphist store & wl-clip-persist --clipboard regular & avizo-service & systemctl --user start psi-notify
end

View File

@@ -0,0 +1,4 @@
function back-op
cd ..
commandline -f repaint
end

View File

@@ -0,0 +1,4 @@
function backtrack-op
cd -
commandline -f repaint
end

View File

@@ -0,0 +1,13 @@
function bluetooth_toggle
set bluetooth_status (rfkill list bluetooth | grep -i -o "Soft blocked: yes")
set backup_file ~/.cache/airplane_backup
if [ -z "$bluetooth_status" ]
rfkill block bluetooth
else
rfkill unblock bluetooth
if test -e $backup_file
rm $backup_file
end
end
end

View File

@@ -0,0 +1,10 @@
function bookmark_add
if [ -z $(wl-paste) ]
dunstify "Bookmarks" "Can`t add empty space" -u critical -t 2000
else if grep -q "^$(wl-paste)\$" .bookmarks
dunstify "Bookmarks" "Bookmark '$(wl-paste)' already exists" -u critical -t 2000
else
wl-paste >> .bookmarks;
dunstify "Bookmarks" "Bookmark '$(wl-paste)' was added" -t 2000
end
end

View File

@@ -0,0 +1,7 @@
function bookmark_delete
set bookmark $(cat .bookmarks | rofi -dmenu -p 'delete bookmark')
if not [ -z $bookmark ]
sed -i -e /$bookmark/d .bookmarks
dunstify "Bookmarks" "Bookmark '$bookmark' was deleted" -t 2000
end
end

View File

@@ -0,0 +1,3 @@
function bookmark_to_type
cat .bookmarks | rofi -dmenu -p bookmarks | tr -d '\n' | wtype -
end

View File

@@ -0,0 +1,9 @@
function check_airplane_mode
set backup_file ~/.cache/airplane_backup
if test -e $backup_file
echo "{ \"text\":\"󰀝\", \"tooltip\": \"airplane-mode <span color='#a6da95'>on</span>\", \"class\": \"on\" }"
else
echo "{ \"text\":\"󰀞\", \"tooltip\": \"airplane-mode <span color='#ee99a0'>off</span>\", \"class\": \"off\" }"
end
end

View File

@@ -0,0 +1,7 @@
function check_geo_module
set target_process "geoclue"
if pgrep $target_process > /dev/null
echo "{\"text\":\"󰆤\", \"tooltip\":\"Geopositioning\", \"alt\":\"Geo\"}"
end
end

View File

@@ -0,0 +1,9 @@
function check_night_mode
set target_process wlsunset
if pgrep $target_process >/dev/null
echo "{ \"text\":\"󱩌\", \"tooltip\": \"night-mode <span color='#a6da95'>on</span>\", \"class\": \"on\" }"
else
echo "{ \"text\":\"󱩍\", \"tooltip\": \"night-mode <span color='#ee99a0'>off</span>\", \"class\": \"off\" }"
end
end

View File

@@ -0,0 +1,7 @@
function check_recording
set target_process wl-screenrec
if pgrep $target_process >/dev/null
echo "{\"text\":\"\", \"tooltip\":\"Recording\", \"alt\":\"Recording\"}"
end
end

View File

@@ -0,0 +1,11 @@
function check_webcam
set process_pids (fuser /dev/video0 | awk '{print $2}' | sort -u)
if test -n "$process_pids"
set processes ""
for process_pid in $process_pids
set process_name (ps -q $process_pid -o comm=)
set processes "$processes\n<span color='#eed49f'>$process_name($process_pid)</span>"
end
echo "{\"text\":\"󰖠\", \"tooltip\":\"webcam is used by: $processes\", \"alt\":\"Webcam\"}"
end
end

View File

@@ -0,0 +1,4 @@
function clear-op
clear
commandline -f repaint
end

View File

@@ -0,0 +1,4 @@
function clipboard_clear
rm "$HOME/.cache/cliphist/db"
dunstify Clipboard Cleared -t 2000
end

View File

@@ -0,0 +1,7 @@
function clipboard_delete_item
set clip $(cliphist list | rofi -dmenu -p 'clipboard delete item')
if not [ -z $clip ]
echo $clip | cliphist delete
dunstify "Clipboard" "Clip '$clip' was deleted" -t 2000
end
end

View File

@@ -0,0 +1,3 @@
function clipboard_to_type
cliphist list | rofi -dmenu -p clipboard | cliphist decode | wtype -
end

View File

@@ -0,0 +1,7 @@
function clipboard_to_wlcopy
set clip $(cliphist list | rofi -dmenu -p 'clipboard copy')
if not [ -z $clip ]
echo $clip | cliphist decode | wl-copy
dunstify "Clipboard" "Clip '$clip' was copied" -t 2000
end
end

View File

@@ -0,0 +1,4 @@
function dir-preview
set dir "$argv[1]"
lsd --tree --depth=1 --color=always --icon=always --icon-theme=fancy "$dir"
end

View File

@@ -0,0 +1,20 @@
function dunst_pause
set COUNT_WAITING (dunstctl count waiting)
set COUNT_DISPLAYED (dunstctl count displayed)
set ENABLED "{ \"text\": \"󰂜\", \"tooltip\": \"notifications <span color='#a6da95'>on</span>\", \"class\": \"on\" }"
set DISABLED "{ \"text\": \"󰪑\", \"tooltip\": \"notifications <span color='#ee99a0'>off</span>\", \"class\": \"off\" }"
if [ $COUNT_DISPLAYED != 0 ]
set ENABLED "{ \"text\": \"󰂚$COUNT_DISPLAYED\", \"tooltip\": \"$COUNT_DISPLAYED notifications\", \"class\": \"on\" }"
end
if [ $COUNT_WAITING != 0 ]
set DISABLED "{ \"text\": \"󰂛$COUNT_WAITING\", \"tooltip\": \"(silent) $COUNT_WAITING notifications\", \"class\": \"off\" }"
end
if dunstctl is-paused | rg -q "false"
echo $ENABLED
else
echo $DISABLED
end
end

View File

@@ -0,0 +1,3 @@
function fetch_music_player_data
playerctl -a metadata --format "{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"<i><span color='#a6da95'>{{playerName}}</span></i>: <b><span color='#f5a97f'>{{artist}}</span> - <span color='#c6a0f6'>{{markup_escape(title)}}</span></b>\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}" -F
end

View File

@@ -0,0 +1,4 @@
function file-preview
set file "$argv[1]"
bat --color=always --style=numbers,header-filesize,grid --line-range=:15 --wrap=auto "$file"
end

View File

@@ -0,0 +1,13 @@
function fish_greeting
set_color blue
echo " Distro:  NixOS"
set_color white
echo "󰅱 Langs:  Rust  Zig  Go  JS 󰛦 TS  Python  Lua  Wasm"
set_color green
echo " Shell: 󰈺 Fish"
set_color yellow
echo "󰟶 Mood: 👨‍💻"
set_color cyan
figlet random -f binary
# clear
end

View File

@@ -0,0 +1,26 @@
function fish_user_key_bindings
# Execute this once per mode that emacs bindings should be used in
fish_default_key_bindings -M insert
# Then execute the vi-bindings so they take precedence when there's a conflict.
# Without --no-erase fish_vi_key_bindings will default to
# resetting all bindings.
# The argument specifies the initial mode (insert, "default" or visual).
fish_vi_key_bindings --no-erase insert
# Nullify fzf default keybindings
bind \cT '' -M insert
bind \cR '' -M insert
bind \er fzf-history-widget -M insert
bind \ef fzf-file-preview-widget -M insert
bind \ec fzf-cd-preview-widget -M insert
bind \ep fzf-ps-widget -M insert
bind \e\f clear-op -M insert
bind \eb back-op -M insert
bind \eB backtrack-op -M insert
bind \e/ list-op -M insert
bind \ea aichat_fish -M insert
end

View File

@@ -0,0 +1,8 @@
function fzf-cd-preview-widget
set selected_dir (fd --type d --hidden --no-ignore --exclude .git --exclude .direnv | fzf --height 40% --reverse --preview 'dir-preview {}' --preview-window=right:40%)
if test -n "$selected_dir"
cd "$selected_dir"
end
commandline -f repaint
end

View File

@@ -0,0 +1,4 @@
function fzf-file-preview-widget
commandline -i (fd --hidden --no-ignore --exclude .git --exclude .direnv | fzf --height 40% --preview-window=right:40% --reverse --preview 'switch-preview {}')
commandline -f repaint
end

View File

@@ -0,0 +1,4 @@
function fzf-ps-widget
commandline -i (pgrep -a . | fzf --height 40%)
commandline -f repaint
end

View File

@@ -0,0 +1,9 @@
function image-preview
set image "$argv[1]"
# Retrieve the current terminal dimensions and reduce them slightly to avoid boundary issues
set term_width (math (tput cols) - 1)
set term_height (math (tput lines) - 1)
chafa "$image" --size="$term_width"x"$term_height"
end

View File

@@ -0,0 +1,6 @@
function list-op
echo \n
lsd -Alg
echo \n\n
commandline -f repaint
end

View File

@@ -0,0 +1,9 @@
function night_mode_toggle
set target_process wlsunset
if pgrep $target_process >/dev/null
killall -s SIGINT wlsunset
else
wlsunset
end
end

View File

@@ -0,0 +1,18 @@
function record_screen_gif
set target_process wl-screenrec
if pgrep $target_process >/dev/null
killall -s SIGINT $target_process
else
set geometry (slurp)
if not [ -z $geometry ]
set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S")")
dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Started  (GIF)" -t 2000
wl-screenrec -g "$geometry" -f "$HOME/Pictures/Records/$record_name.mp4" --encode-resolution 1920x1080
ffmpeg -i "$HOME/Pictures/Records/$record_name.mp4" "$HOME/Pictures/Records/$record_name.gif"
rm "$HOME/Pictures/Records/$record_name.mp4"
wl-copy -t text/uri-list file://$HOME/Pictures/Records/$record_name.gif\n
dunstify -i ~/.config/fish/icons/camera_gif_icon.png -r $(cd ~/Pictures/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (GIF)" -t 2000
end
end
end

View File

@@ -0,0 +1,16 @@
function record_screen_mp4
set target_process wl-screenrec
if pgrep $target_process >/dev/null
killall -s SIGINT $target_process
else
set geometry (slurp)
if not [ -z $geometry ]
set record_name $(echo "recrod-$(date +"%Y-%m-%d--%H:%M:%S")")
dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Started  (MP4)" -t 2000
wl-screenrec -g "$geometry" -f "$HOME/Videos/Records/$record_name.mp4"
wl-copy -t text/uri-list file://$HOME/Videos/Records/$record_name.mp4\n
dunstify -i ~/.config/fish/icons/camera_mp4_icon.png -r $(cd ~/Videos/Records/ && ls -1 | wc -l) "Recording Stopped 󰙧 (MP4)" -t 2000
end
end
end

View File

@@ -0,0 +1,3 @@
function screenshot_edit
swappy -f ~/Pictures/Screenshots/(cd ~/Pictures/Screenshots && ls -tA | head -n1 | awk '{print $NF}')
end

View File

@@ -0,0 +1,9 @@
function screenshot_to_clipboard
set screenshot_filename (echo "$HOME/Pictures/Screenshots/screenshot-$(date +"%Y-%m-%d--%H:%M:%S").png")
grim -g (slurp) $screenshot_filename
if [ -e $screenshot_filename ]
cat $screenshot_filename | wl-copy --type image/png
dunstify -i $screenshot_filename -r (cd ~/Pictures/Screenshots/ && ls -1 | wc -l) "Screenshots" "Screenshot was taken" -t 2000
end
end

View File

@@ -0,0 +1,20 @@
function switch-preview
set path "$argv[1]"
if test -f "$path"
if test ! -s "$path"
echo "File is empty"
else
archive-preview "$path"
if string match -q "image/*" (file -b --mime-type "$path")
image-preview "$path"
else
file-preview "$path"
end
end
else if test -d "$path"
dir-preview "$path"
else
echo "Preview unavailable"
end
end

View File

@@ -0,0 +1,3 @@
function tre
command tre $argv -e; and source /tmp/tre_aliases_$USER ^/dev/null
end

View File

@@ -0,0 +1,13 @@
function wifi_toggle
set wifi_status (rfkill list wifi | grep -i -o "Soft blocked: yes")
set backup_file ~/.cache/airplane_backup
if [ -z "$wifi_status" ]
rfkill block wifi
else
rfkill unblock wifi
if test -e $backup_file
rm $backup_file
end
end
end

View File

@@ -0,0 +1,5 @@
function wlogout_uniqe
if [ -z $(pidof wlogout) ]
wlogout
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB