From b7dfa5fdb2330f1e1cd222365055c3d45ad473be Mon Sep 17 00:00:00 2001 From: Rose Date: Fri, 10 Oct 2025 11:29:10 +0200 Subject: all: Rework system structure --- fish/.config/fish/config.fish | 34 --------------------- fish/.config/fish/fish_variables | 32 -------------------- fish/.config/fish/functions/fish_greeting.fish | 5 --- fish/.config/fish/functions/fish_prompt.fish | 42 -------------------------- fish/.local/bin/git.sh | 7 ----- fish/.local/bin/launch.sh | 3 -- fish/.local/bin/launchvm.sh | 3 -- fish/.local/bin/mediactl.sh | 19 ------------ fish/.local/bin/sysctls.sh | 7 ----- fish/.local/bin/upload.sh | 2 -- fish/.local/bin/vm.sh | 11 ------- fish/Config/fish/config.fish | 37 +++++++++++++++++++++++ fish/Config/fish/fish_variables | 32 ++++++++++++++++++++ fish/Config/fish/functions/fish_greeting.fish | 5 +++ fish/Config/fish/functions/fish_prompt.fish | 42 ++++++++++++++++++++++++++ fish/Local/bin/git.sh | 7 +++++ fish/Local/bin/launch.sh | 3 ++ fish/Local/bin/launchvm.sh | 3 ++ fish/Local/bin/mediactl.sh | 19 ++++++++++++ fish/Local/bin/sysctls.sh | 7 +++++ fish/Local/bin/upload.sh | 2 ++ fish/Local/bin/vm.sh | 11 +++++++ 22 files changed, 168 insertions(+), 165 deletions(-) delete mode 100644 fish/.config/fish/config.fish delete mode 100644 fish/.config/fish/fish_variables delete mode 100644 fish/.config/fish/functions/fish_greeting.fish delete mode 100644 fish/.config/fish/functions/fish_prompt.fish delete mode 100755 fish/.local/bin/git.sh delete mode 100755 fish/.local/bin/launch.sh delete mode 100755 fish/.local/bin/launchvm.sh delete mode 100755 fish/.local/bin/mediactl.sh delete mode 100755 fish/.local/bin/sysctls.sh delete mode 100755 fish/.local/bin/upload.sh delete mode 100755 fish/.local/bin/vm.sh create mode 100644 fish/Config/fish/config.fish create mode 100644 fish/Config/fish/fish_variables create mode 100644 fish/Config/fish/functions/fish_greeting.fish create mode 100644 fish/Config/fish/functions/fish_prompt.fish create mode 100755 fish/Local/bin/git.sh create mode 100755 fish/Local/bin/launch.sh create mode 100755 fish/Local/bin/launchvm.sh create mode 100755 fish/Local/bin/mediactl.sh create mode 100755 fish/Local/bin/sysctls.sh create mode 100755 fish/Local/bin/upload.sh create mode 100755 fish/Local/bin/vm.sh (limited to 'fish') diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish deleted file mode 100644 index f7b919a..0000000 --- a/fish/.config/fish/config.fish +++ /dev/null @@ -1,34 +0,0 @@ -if status is-interactive - alias w='dbus-run-session startxfce4 --wayland niri --session' - alias :vpn='doas /etc/init.d/wg-quick.vpn ' - alias :launch launch.sh - alias :media mediactl.sh - alias :sys sysctls.sh - alias :firefox "launch.sh firefox-bin" - alias :music "launch.sh qmmp" - alias :edit "launch.sh foot emacs -nw" - alias :files "launch.sh thunar" - alias :git git.sh - alias :upload upload.sh - alias :ytdlp "yt-dlp (wl-paste)" - alias :download "curl -SL (wl-paste) -o" - alias :play "mpv --keep-open (wl-paste) > /tmp/mpvout" - if test (hostname) = "bamboo" - alias :vm vm.sh - alias :launchvm launchvm.sh - alias :edge "launchvm.sh microsoft-edge-stable --ozone-platform=wayland" - end - #alias w='dbus-run-session startplasma-wayland' - #alias w='dbus-run-session sway' - # Commands to run in interactive sessions can go here -end -set SSH_AUTH_SOCK $XDG_RUNTIME_DIR/hissh-agent -set EDITOR emacs -set GPG_TTY (tty) -export SSH_AUTH_SOCK -export EDITOR -export GPG_TTY - -#if test "$TERM" = "xterm-kitty" -# tput cup $COLUMNS 0 -#end diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables deleted file mode 100644 index 72fe39c..0000000 --- a/fish/.config/fish/fish_variables +++ /dev/null @@ -1,32 +0,0 @@ -# This file contains fish universal variable definitions. -# VERSION: 3.0 -SETUVAR __fish_initialized:3400 -SETUVAR fish_color_autosuggestion:brblack -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:bryellow\x1e\x2d\x2dbackground\x3dbrblack -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_default_key_bindings -SETUVAR fish_pager_color_completion:normal -SETUVAR fish_pager_color_description:yellow\x1e\x2di -SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline -SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan -SETUVAR fish_pager_color_selected_background:\x2dr -SETUVAR fish_user_paths:/home/lain/\x2elocal/bin diff --git a/fish/.config/fish/functions/fish_greeting.fish b/fish/.config/fish/functions/fish_greeting.fish deleted file mode 100644 index 3b024f3..0000000 --- a/fish/.config/fish/functions/fish_greeting.fish +++ /dev/null @@ -1,5 +0,0 @@ -function fish_greeting - if test "$TERM" != "xterm-kitty" - /home/lain/.local/bin/nofetch - end -end diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish deleted file mode 100644 index 3a5c04d..0000000 --- a/fish/.config/fish/functions/fish_prompt.fish +++ /dev/null @@ -1,42 +0,0 @@ -function fish_prompt - if test "$TERM" = "xterm-kitty" - tput cup 0 0 - pwd - tput cup $COLUMNS 0 - echo -n "] " - else - orig_fish_prompt - end -end - -function orig_fish_prompt --description 'Write out the prompt' - set -l last_pipestatus $pipestatus - set -lx __fish_last_status $status # Export for __fish_print_pipestatus. - set -l normal (set_color normal) - set -q fish_color_status - or set -g fish_color_status red - - # Color the prompt differently when we're root - set -l color_cwd $fish_color_cwd - set -l suffix '%' - if functions -q fish_is_root_user; and fish_is_root_user - if set -q fish_color_cwd_root - set color_cwd $fish_color_cwd_root - end - set suffix '%' - end - - # Write pipestatus - # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. - set -l bold_flag --bold - set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation - if test $__fish_prompt_status_generation = $status_generation - set bold_flag - end - set __fish_prompt_status_generation $status_generation - set -l status_color (set_color $fish_color_status) - set -l statusb_color (set_color $bold_flag $fish_color_status) - set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) - - echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$suffix " " -end diff --git a/fish/.local/bin/git.sh b/fish/.local/bin/git.sh deleted file mode 100755 index 2d4eb43..0000000 --- a/fish/.local/bin/git.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/bash - -if [[ "$1" == "clean" ]]; then - git clean -fdX -else - git "$@" -fi diff --git a/fish/.local/bin/launch.sh b/fish/.local/bin/launch.sh deleted file mode 100755 index 169b911..0000000 --- a/fish/.local/bin/launch.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/bash - -$@ 2> /dev/null > /dev/null & disown diff --git a/fish/.local/bin/launchvm.sh b/fish/.local/bin/launchvm.sh deleted file mode 100755 index bd71fb4..0000000 --- a/fish/.local/bin/launchvm.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/bash - -waypipe ssh lain@ubuntu.bamboo $@ 2> /dev/null > /dev/null & disown diff --git a/fish/.local/bin/mediactl.sh b/fish/.local/bin/mediactl.sh deleted file mode 100755 index 40ef71a..0000000 --- a/fish/.local/bin/mediactl.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/bash - -if [[ "$1" == "status" ]]; then - qmmp --status -elif [[ "$1" == "play" ]]; then - qmmp -p -elif [[ "$1" == "pause" ]]; then - qmmp -u -elif [[ "$1" == "prev" ]]; then - qmmp --previous -elif [[ "$1" == "next" ]]; then - qmmp --next -elif [[ "$1" == "fwd" ]]; then - qmmp --seek-fwd "$2" -elif [[ "$1" == "bwd" ]]; then - qmmp --seek-bwd "$2" -else - qmmp "$@" -fi diff --git a/fish/.local/bin/sysctls.sh b/fish/.local/bin/sysctls.sh deleted file mode 100755 index ab72c13..0000000 --- a/fish/.local/bin/sysctls.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/bash - -if [[ "$1" == "poweroff" ]]; then - doas poweroff -elif [[ "$1" == "reboot" ]]; then - doas reboot -fi diff --git a/fish/.local/bin/upload.sh b/fish/.local/bin/upload.sh deleted file mode 100755 index 1ec895a..0000000 --- a/fish/.local/bin/upload.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -curl -F'file=@${1}' https://0x0.st diff --git a/fish/.local/bin/vm.sh b/fish/.local/bin/vm.sh deleted file mode 100755 index d56d201..0000000 --- a/fish/.local/bin/vm.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/bash - -if [[ "$1" == "stop" ]]; then - virsh -c qemu:///system shutdown "${@:2}" -elif [[ "$1" == "start" ]]; then - virsh -c qemu:///system start "${@:2}" -elif [[ "$1" == "files" ]]; then - sshfs -o default_permissions lain@ubuntu.bamboo:/home/lain /home/lain/Shared -else - virsh -c qemu:///system "$@" -fi diff --git a/fish/Config/fish/config.fish b/fish/Config/fish/config.fish new file mode 100644 index 0000000..af29a37 --- /dev/null +++ b/fish/Config/fish/config.fish @@ -0,0 +1,37 @@ +if status is-interactive + alias w='dbus-run-session startxfce4 --wayland niri --session' + alias :vpn='doas /etc/init.d/wg-quick.vpn ' + alias :launch launch.sh + alias :media mediactl.sh + alias :sys sysctls.sh + alias :firefox "launch.sh firefox-bin" + alias :music "launch.sh qmmp" + alias :edit "launch.sh foot emacs -nw" + alias :files "launch.sh thunar" + alias :git git.sh + alias :upload upload.sh + alias :ytdlp "yt-dlp (wl-paste)" + alias :download "curl -SL (wl-paste) -o" + alias :play "mpv --keep-open (wl-paste) > /tmp/mpvout" + if test (hostname) = "cherryblossom" + alias :phone "sshfs defaultuser@tulip:/home/defaultuser Phone -o allow_other" + end + if test (hostname) = "bamboo" + alias :vm vm.sh + alias :launchvm launchvm.sh + alias :edge "launchvm.sh microsoft-edge-stable --ozone-platform=wayland" + end + #alias w='dbus-run-session startplasma-wayland' + #alias w='dbus-run-session sway' + # Commands to run in interactive sessions can go here +end +set SSH_AUTH_SOCK $XDG_RUNTIME_DIR/hissh-agent +set EDITOR emacs +set GPG_TTY (tty) +export SSH_AUTH_SOCK +export EDITOR +export GPG_TTY + +#if test "$TERM" = "xterm-kitty" +# tput cup $COLUMNS 0 +#end diff --git a/fish/Config/fish/fish_variables b/fish/Config/fish/fish_variables new file mode 100644 index 0000000..72fe39c --- /dev/null +++ b/fish/Config/fish/fish_variables @@ -0,0 +1,32 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3400 +SETUVAR fish_color_autosuggestion:brblack +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:bryellow\x1e\x2d\x2dbackground\x3dbrblack +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_default_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:yellow\x1e\x2di +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr +SETUVAR fish_user_paths:/home/lain/\x2elocal/bin diff --git a/fish/Config/fish/functions/fish_greeting.fish b/fish/Config/fish/functions/fish_greeting.fish new file mode 100644 index 0000000..3b024f3 --- /dev/null +++ b/fish/Config/fish/functions/fish_greeting.fish @@ -0,0 +1,5 @@ +function fish_greeting + if test "$TERM" != "xterm-kitty" + /home/lain/.local/bin/nofetch + end +end diff --git a/fish/Config/fish/functions/fish_prompt.fish b/fish/Config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..3a5c04d --- /dev/null +++ b/fish/Config/fish/functions/fish_prompt.fish @@ -0,0 +1,42 @@ +function fish_prompt + if test "$TERM" = "xterm-kitty" + tput cup 0 0 + pwd + tput cup $COLUMNS 0 + echo -n "] " + else + orig_fish_prompt + end +end + +function orig_fish_prompt --description 'Write out the prompt' + set -l last_pipestatus $pipestatus + set -lx __fish_last_status $status # Export for __fish_print_pipestatus. + set -l normal (set_color normal) + set -q fish_color_status + or set -g fish_color_status red + + # Color the prompt differently when we're root + set -l color_cwd $fish_color_cwd + set -l suffix '%' + if functions -q fish_is_root_user; and fish_is_root_user + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + end + set suffix '%' + end + + # Write pipestatus + # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. + set -l bold_flag --bold + set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation + if test $__fish_prompt_status_generation = $status_generation + set bold_flag + end + set __fish_prompt_status_generation $status_generation + set -l status_color (set_color $fish_color_status) + set -l statusb_color (set_color $bold_flag $fish_color_status) + set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) + + echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$suffix " " +end diff --git a/fish/Local/bin/git.sh b/fish/Local/bin/git.sh new file mode 100755 index 0000000..2d4eb43 --- /dev/null +++ b/fish/Local/bin/git.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +if [[ "$1" == "clean" ]]; then + git clean -fdX +else + git "$@" +fi diff --git a/fish/Local/bin/launch.sh b/fish/Local/bin/launch.sh new file mode 100755 index 0000000..169b911 --- /dev/null +++ b/fish/Local/bin/launch.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +$@ 2> /dev/null > /dev/null & disown diff --git a/fish/Local/bin/launchvm.sh b/fish/Local/bin/launchvm.sh new file mode 100755 index 0000000..bd71fb4 --- /dev/null +++ b/fish/Local/bin/launchvm.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +waypipe ssh lain@ubuntu.bamboo $@ 2> /dev/null > /dev/null & disown diff --git a/fish/Local/bin/mediactl.sh b/fish/Local/bin/mediactl.sh new file mode 100755 index 0000000..40ef71a --- /dev/null +++ b/fish/Local/bin/mediactl.sh @@ -0,0 +1,19 @@ +#!/usr/bin/bash + +if [[ "$1" == "status" ]]; then + qmmp --status +elif [[ "$1" == "play" ]]; then + qmmp -p +elif [[ "$1" == "pause" ]]; then + qmmp -u +elif [[ "$1" == "prev" ]]; then + qmmp --previous +elif [[ "$1" == "next" ]]; then + qmmp --next +elif [[ "$1" == "fwd" ]]; then + qmmp --seek-fwd "$2" +elif [[ "$1" == "bwd" ]]; then + qmmp --seek-bwd "$2" +else + qmmp "$@" +fi diff --git a/fish/Local/bin/sysctls.sh b/fish/Local/bin/sysctls.sh new file mode 100755 index 0000000..ab72c13 --- /dev/null +++ b/fish/Local/bin/sysctls.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +if [[ "$1" == "poweroff" ]]; then + doas poweroff +elif [[ "$1" == "reboot" ]]; then + doas reboot +fi diff --git a/fish/Local/bin/upload.sh b/fish/Local/bin/upload.sh new file mode 100755 index 0000000..1ec895a --- /dev/null +++ b/fish/Local/bin/upload.sh @@ -0,0 +1,2 @@ +#!/bin/bash +curl -F'file=@${1}' https://0x0.st diff --git a/fish/Local/bin/vm.sh b/fish/Local/bin/vm.sh new file mode 100755 index 0000000..d56d201 --- /dev/null +++ b/fish/Local/bin/vm.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +if [[ "$1" == "stop" ]]; then + virsh -c qemu:///system shutdown "${@:2}" +elif [[ "$1" == "start" ]]; then + virsh -c qemu:///system start "${@:2}" +elif [[ "$1" == "files" ]]; then + sshfs -o default_permissions lain@ubuntu.bamboo:/home/lain /home/lain/Shared +else + virsh -c qemu:///system "$@" +fi -- cgit v1.2.3