diff options
36 files changed, 658 insertions, 302 deletions
diff --git a/bin/common/aumount b/bin/common/aumount new file mode 100755 index 0000000..19b33e0 --- /dev/null +++ b/bin/common/aumount @@ -0,0 +1,102 @@ +#!/bin/sh + +tmp="$(mktemp)" +test "$(id -u)" != "0" && sudo="sudo" + +die () +{ + echo "$@" >&2 +} + +# Read one character +read_char () +{ + die -n ">" + old_stty_cfg=$(stty -g) + stty raw + dd ibs=1 count=${1:-1} 2> /dev/null + stty $old_stty_cfg + die "" +} + +get_dev () +{ + grep "^$1\." "$tmp" | cut -f 2- -d ' ' +} + +# mount the device with $1 as the choice +mount () +{ + dev="$(get_dev "$1")" + test -z "$dev" && exit 1 + + die "Mounting /dev/$dev on /media/$dev" + mkdir -p /media/$dev + $sudo mount /dev/$dev /media/$dev > /dev/null 2>&1 || + return 1 +} + +# umount the device with $1 as the choice +umount () +{ + mountpoint="$(sed -n "${1}p" "$tmp" | + awk '{print $3}')" + test -z "$mountpoint" && exit 1 + + die "Unmounting $mountpoint" + $sudo umount "$mountpoint" || + return 1 +} + +ejekt () +{ + dev="$(get_dev "$1" | sed 's/.$//')" + test -z "$dev" && exit 1 + + die "Ejecting /dev/$dev" + $sudo eject /dev/$dev > /dev/null 2>&1 || + return 1 +} + +# print lsblk, use $1 to print only devices with mountpoints or without +pr_lsblk () +{ + clear + lsblk -o name,size,type,mountpoint + die "───────────────────────────────────" + lsblk --ascii -o name,mountpoint | + grep '^.-' | + while read line + do + words="$(printf "$line" | wc -w)" + test $words -eq ${1:-1} && continue + printf "%s\n" "$line" + done | + cut -f 2- -d "-" | + awk '{print NR ". " $0}' | + tee "$tmp" >&2 +} + +cleanup () +{ + rm -f "$tmp" +} + +trap cleanup EXIT INT + +die "m(ount) u(mount) (e)ject ?" +choice="$(read_char)" + +case $choice in + "m") i=2; cmd=mount ;; + "u") i=1; cmd=umount ;; + "e") i=2; cmd=ejekt ;; + *) exit 1 ;; +esac + +pr_lsblk $i +choice="$(read_char)" +printf "$choice" | grep -q "[0-9]" || exit 1 +$cmd $choice && + die "Successful." || + die "Failed." diff --git a/bin/common/cx b/bin/common/cx new file mode 100755 index 0000000..88fb817 --- /dev/null +++ b/bin/common/cx @@ -0,0 +1,2 @@ +#!/bin/sh +[ -x "$1" ] && chmod -x "$1" || chmod +x "$1" diff --git a/bin/common/drop_cache b/bin/common/drop_cache index 4833597..e4fc039 100755 --- a/bin/common/drop_cache +++ b/bin/common/drop_cache @@ -4,5 +4,5 @@ then echo "Please run as root." exit 1 fi -echo 3 | tee /proc/sys/vm/drop_caches >/dev/null +echo 3 > /proc/sys/vm/drop_caches echo "cache cleared." diff --git a/bin/common/saf b/bin/common/saf new file mode 100755 index 0000000..0c6fbc4 --- /dev/null +++ b/bin/common/saf @@ -0,0 +1,24 @@ +#!/bin/sh + +# Simple Ass Fetch by futxlii + +red="$(printf '\033[31m')" +green="$(printf '\033[32m')" +blue="$(printf '\033[34m')" +reset="$(printf '\033[0m')" + +for file in /etc/os-release /usr/lib/os-release +do + [ -f "$file" ] && . "$file" && break +done + +KERNEL="$(uname -r)" +UPTIME="$(uptime -p)"; UPTIME="${UPTIME##up }" +SHELL="$(basename "$SHELL")" + +cat <<EOF + ${red}- ${blue}${ID:-"unknown"} + ${red}- ${blue}$KERNEL + ${red}- ${blue}$UPTIME + ${red}- ${blue}$SHELL${reset} +EOF diff --git a/bin/common/sync-install.sh b/bin/common/sync-install.sh new file mode 100755 index 0000000..e26c74d --- /dev/null +++ b/bin/common/sync-install.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +die () +{ + echo "$@" >&2 +} + +read_char () +{ + old_stty_cfg=$(stty -g) + stty raw -echo + dd ibs=1 count=1 2> /dev/null + stty $old_stty_cfg +} + +confirm () +{ + printf "$1 " + read_char | grep "[yY]" +} + +usage() +{ + >&2 printf 'Usage: %s <remote> <destination>\n' "${0##*/}" +} + +[ $# -lt 2 ] && usage && exit 1 +REMOTE="$1" +DEST="$2" +SCRIPT="${3:-sync.sh}" + +if ! ssh $REMOTE test -w $DEST 2> /dev/null +then + die "Not a valid remote or destination." + exit 1 +fi + +die "─────────────────────────────────────────────────────────────" +cat <<EOF | tee "$SCRIPT" >&2 +#!/bin/sh + +THISDIR="\$(dirname "\$(readlink -f "\$0")")" +inotifywait -m -e create,modify,delete --format "%f" "\$THISDIR" | +while read FILE +do + rsync -aP "\$THISDIR/" "$REMOTE:$DEST" + sleep 1m +done +EOF +die "─────────────────────────────────────────────────────────────" +die "located at $(readlink -f "$SCRIPT")" + +if confirm "good?" +then + chmod +x "$SCRIPT" +else + rm -f "$SCRIPT" +fi diff --git a/bin/common/toush b/bin/common/toush new file mode 100755 index 0000000..dd675b9 --- /dev/null +++ b/bin/common/toush @@ -0,0 +1,14 @@ +#!/bin/sh +# fork of +# https://codeberg.org/futxlii/bin/toush :) + +shebang='#!/bin/sh' + +usage() { >&2 printf 'Usage: %s' "${0##*/}"; exit 1 ;} + +[ "$1" ] || usage +while [ "$1" ]; do + [ -f "$1" ] && usage + printf '%s\n\n' "$shebang" > "$1" && chmod +x "$1" + shift +done diff --git a/bin/common/wt b/bin/common/wt index 0568b99..d19539b 100755 --- a/bin/common/wt +++ b/bin/common/wt @@ -1,10 +1,7 @@ #!/bin/sh - -echo "$@" > /tmp/truewhile.tmp while true do - sh /tmp/truewhile.tmp - sleep 1 clear + $@ + sleep 1 done -rm /tmp/truewhile.tmp diff --git a/bin/common/y2feed b/bin/common/y2feed index 196ecb7..e30bccf 100755 --- a/bin/common/y2feed +++ b/bin/common/y2feed @@ -1,12 +1,5 @@ #!/bin/sh -ua="$(yt-dlp --dump-user-agent)" - -test -z "${url:=$1}" && - url="$(cat /dev/stdin)" - -url="http://youtube.com/$(echo "$url" | - awk -F '/' '{print $NF}')" -echo "url: $url" >&2 - -curl -L -s -H "$ua" "$url" | - pup 'link[title=RSS] attr{href}' +echo "url: $1" >&2 +curl -L -s "$1" | + pup 'link[title=RSS] attr{href}' | + tee /dev/stderr diff --git a/bin/extra/aivpn b/bin/extra/aivpn new file mode 100755 index 0000000..c67aa2c --- /dev/null +++ b/bin/extra/aivpn @@ -0,0 +1,39 @@ +#!/bin/sh + +die () +{ + echo "$@" >&2 +} + +if [ "$1" = "-k" ] +then + pgrep -f -- "ssh.*-L.*mc-wd" | + xargs kill + exit +fi + +# For when script calls itself +if [ -n "$PASSWORD" ] +then + pass show "$PASSWORD" && + exit + exit 1 +fi + +keyadd ehb/ai + +export SSH_ASKPASS="$0" +export SSH_ASKPASS_REQUIRE="prefer" +export PASSWORD=aluc + +die "I: Activating vpn" +ssh mc-wd rasdial "vpn.student.ehb.be" +ssh -f -N \ + -L 2222:10.2.160.41:22 \ + mc-wd + +ssh -t \ + -L 8188:localhost:8188 \ + mc-wd \ + ssh -N -L 8188:localhost:8188 luca@10.2.160.41 +die "[8188], [2222]" diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index c35f6d4..b680484 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -3,10 +3,7 @@ which swaylock grim pixelate > /dev/null || exit 1 umask 077 -monitors="$(hyprctl monitors -j | - jq -r '.[].name' | - tr '\n' ' ' | - sed 's,.$,,')" +monitors="$(hyprctl monitors -j | jq -r '.[].name' | xargs)" for monitor in $monitors do @@ -14,9 +11,9 @@ do grim -l 0 -o "$monitor" "$file" pixelate "$file" "$file" # Create image command for swaylock - icmd="$icmd --image $monitor:$file" + img_opt="--image $monitor:$file $img_opt" files="$files $file" done -swaylock -f -u $icmd +swaylock -f -u $img_opt shred -uz -- $files diff --git a/bin/guiscripts/startw b/bin/guiscripts/startw new file mode 100755 index 0000000..768f401 --- /dev/null +++ b/bin/guiscripts/startw @@ -0,0 +1,5 @@ +#!/bin/sh + +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" + +Hyprland diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 87559e9..a50f0fb 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -6,7 +6,7 @@ then menucmd="tofi --prompt pass:" elif [ "$MENUCMD" = "dmenu" ] then - menucmd="dmenu -l 4 -g 2 -x -i -p pass:" + menucmd="dmenu -l 4 -g 2 -i -p pass:" else menucmd="fzf --prompt pass:" fi @@ -17,6 +17,7 @@ do file="$file/$choice" done +test -z "$file" && exit 1 pass show -c "$file" && if [ -n "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null then diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index f03fd8e..443ed54 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,13 +1,14 @@ #!/bin/sh if [ "$MENUCMD" = "tofi" ] then - menucmd="tofi --width 10% --height 10% --padding-left 2%" + menucmd="tofi --width 10% --height 13% --padding-left 2%" elif [ "$MENUCMD" = "dmenu" ] then - menucmd="dmenu -g 2 -l 1" + menucmd="dmenu -g 2 -l 2" else menucmd="fzf" fi -choice="$(echo "poweroff\nreboot\nhibernate" | $menucmd)" -test -z "$choice" || doas "$choice" +choices="poweroff\nreboot\nhibernate\nsuspend" +choice="$(printf "$choices" | $menucmd)" +test -z "$choice" || systemctl "$choice" diff --git a/bin/serverscripts/dlcons b/bin/serverscripts/dlcons new file mode 100755 index 0000000..69d9484 --- /dev/null +++ b/bin/serverscripts/dlcons @@ -0,0 +1,2 @@ +#!/bin/sh +docker exec -it deluge deluge-console -c /config diff --git a/config/X/x11/xinitrc b/config/X/x11/xinitrc index d261b3f..5f595b1 100755 --- a/config/X/x11/xinitrc +++ b/config/X/x11/xinitrc @@ -6,21 +6,10 @@ sysmodmap=/etc/X11/xinit/.Xmodmap # merge in defaults and keymaps -if [ -f $sysresources ]; then - xrdb -merge $sysresources -fi - -if [ -f $sysmodmap ]; then - xmodmap $sysmodmap -fi - -if [ -f "$userresources" ]; then - xrdb -merge "$userresources" -fi - -if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" -fi +[ -f $sysresources ] && xrdb -merge $sysresources +[ -f $sysmodmap ] && xmodmap $sysmodmap +[ -f "$userresources" ] && xrdb -merge "$userresources" +[ -f "$usermodmap" ] && xmodmap "$usermodmap" if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do @@ -37,5 +26,6 @@ xmodmap -e "keycode 135 = Super_L" xautolock -time 5 -locker slock & gammastep -m randr & slstatus & +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" unclutter --timeout 3 --jitter 50 -b exec startdwm diff --git a/config/common/mpd/mpd.conf b/config/common/mpd/mpd.conf index 7ea7137..dda6f45 100644 --- a/config/common/mpd/mpd.conf +++ b/config/common/mpd/mpd.conf @@ -14,7 +14,7 @@ audio_output { audio_output { type "httpd" name "My HTTP Stream" - port "8000" + port "7721" always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. tags "yes" # httpd supports sending tags to listening streams. } diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index 7508667..409ad66 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -1,98 +1,47 @@ -# # By Nicholas Marriott. Public domain. # but -now- me. -# - -########################################################################### -################# MISC. ################################################### -########################################################################### -########################################################################### # Some tweaks to the status line set -g status-right "%H:%M" set -g window-status-current-style "underscore" - -# If running inside (nested) tmux ($TMUX is set), then change the status line to red -%if #{TMUX} -set -g status-bg red -%endif - # Enable RGB color if running in xterm set-option -sa terminal-overrides ",xterm*:Tc" - # Change the default $TERM to xterm-256color # Necessary because vim ctrl arrows must be defined through TERM set -g default-terminal "xterm-256color" set-window-option -g xterm-keys on - # No bells at all set -g bell-action none - # Keep windows around after they exit set -g remain-on-exit off - # More history lines set -g history-limit 16384 - # Base window is Numero Uno set -g base-index 1 set-window-option -g pane-base-index 1 - # Set vi mode when copying set-window-option -g mode-keys vi # compatibility with vim for focus based events set -g focus-events on -########################################################################### -################# KEYBINDINGS ############################################# -########################################################################### -########################################################################### - - +# KEYBINDINGS # Reload config file -unbind r bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf" - -########## CLIPBOARD ########## -unbind -T copy-mode-vi Space; #Default for begin-selection -unbind -T copy-mode-vi Enter; #Default for copy-selection +# Clipboard bind -T copy-mode-vi v send-keys -X begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -r -selection clipboard" bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -r -selection clipboard" - # Unbind ESC set -sg escape-time 0 - # Toggle status bar -unbind t bind t set-option status - # Toggle monitoring window activity bind m set monitor-activity\; display 'monitor-activity #{?monitor-activity,on,off}' - bind M run-shell "tmux set monitor-silence #{?monitor-silence,0,10}"\; display "monitor-silence #{?monitor-silence,on,off}" - - - - -# if-shell "true" { -# if-shell "#{?monitor-silence,true,false}" { -# set monitor-silence 0 -# } -# if-shell "#{?monitor-silence,false,true}" { -# set monitor-silence 10 -# } -# display "monitor-silence #{?monitor-silence,on,off} #{monitor-silence}" -# } - # Toggle synchronized panes (sending keys to every pane) -unbind y bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}' - # Paste from tmux buffer -unbind p bind p paste-buffer - # Kill all windows bind x confirm -p "Kill Pane?" kill-pane bind X confirm -p "Kill Window?" kill-window @@ -100,16 +49,10 @@ bind M-x confirm -p "Kill Session?" kill-session bind M-X confirm -p "Kill Server?" kill-server # Restart pane bind k run -C "respawn-pane -k; send-keys !! 'C-j'" - -########## SPLIT AND SWAP ########### # Splitting -unbind v bind v split-window -h -c "#{pane_current_path}" -unbind h bind h split-window -v -c "#{pane_current_path}" # Swapping left and right a la vim -unbind -n M-H -unbind -n M-L bind -n M-H swap-pane -U bind -n M-L swap-pane -D ## Resizing panes @@ -117,70 +60,31 @@ bind -r C-H resize-pane -L 5 bind -r C-J resize-pane -D 5 bind -r C-K resize-pane -U 5 bind -r C-L resize-pane -R 5 - -## Default keybindings for resizing -unbind C-Up -unbind C-Left -unbind C-Down -unbind C-Right -unbind M-Up -unbind M-Left -unbind M-Down -unbind M-Right - # Join and break windows -unbind j bind j command-prompt -1p "Take window:" "join-pane -s %%" -unbind J bind J command-prompt -1p "Send to window:" "join-pane -t \:%% ; select-window -l" # Break pane without losing focus -unbind b bind b break-pane -t : # Reset length and shit -unbind z bind z select-layout main-vertical - -########## NAVIGATION ########## # Pane navigating with h|j|k|l a la vim -unbind -n M-h -unbind -n M-j -unbind -n M-k -unbind -n M-l bind -n -N "select leftwards pane" M-h select-pane -L bind -n -N "select downwards pane" M-j select-pane -D bind -n -N "select upwards pane" M-k select-pane -U bind -n -N "select rightwards pane" M-l select-pane -R # Window navigating with M-u|i -unbind -n M-u -unbind -n M-i bind -n M-u previous-window bind -n M-i next-window # Session navigeting with S-M-u|i -unbind -n M-y -unbind -n M-o bind -n M-U switch-client -p bind -n M-I switch-client -n - -########## Windows ########## -# Rename window and open new window -unbind n # DEFAULT KEY: move to next window -unbind N -unbind w # DEFAULT KEY: change current window interactively aka choose-tree -zW +# Renaming bind n command-prompt "rename-window '%%'" bind N command-prompt "rename-session '%%'" -# Start new window where tmux started, will be home because of xmonad -bind w new-window -c "#{pane_current_path}" #-c "#{pane_current_path}" +# Starting new windows +bind w new-window -c "#{pane_current_path}" bind W new-session -c "$HOME" - # Show tree -unbind S bind S choose-tree -Z - -# Turn the mouse on, but without copy mode dragging -# set -g mouse on -# unbind -n MouseDrag1Pane -# unbind -T copy-mode MouseDrag1Pane - # Menu for mounting and ejecting devices. -unbind E bind E display-menu -T "#[align=centre]#I:#W" -x W -y W '' Mount 0 "display-popup -E 'amount'" diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index d1da9b3..7ee274f 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -142,13 +142,24 @@ ls.add_snippets("java", { }) ls.add_snippets("sh", { - s("TD", t "THISDIR=$(dirname $(readlink -f \"$0\"))"), + s("TD", t "THISDIR=\"$(dirname \"$(readlink -f \"$0\")\")\""), parse("fn", "$1 ()\n{\n\t$2\n}$0", {}), + -- Functions + parse("rchar", + [[ + read_char () + { + old_stty_cfg=$(stty -g) + stty raw -echo + dd ibs=1 count=1 2> /dev/null + stty \$old_stty_cfg + } + ]], {}), parse("fdie", [[ die () { - echo "\$1" >&2 + echo "\$@" >&2 } ]], {}), s("die", fmt( diff --git a/config/essentials/nvim/ftplugin/sh.lua b/config/essentials/nvim/ftplugin/sh.lua index 9290c29..01b20d6 100644 --- a/config/essentials/nvim/ftplugin/sh.lua +++ b/config/essentials/nvim/ftplugin/sh.lua @@ -2,4 +2,5 @@ vim.keymap.set("n", "<LocalLeader>t", "<cmd>s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2\" vim.keymap.set("n", "<LocalLeader>i", "<cmd>s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2: $\\2\"<cr>") vim.keymap.set("i", "<LocalLeader>t", "<cmd>s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2\"<cr><esc>A") vim.keymap.set("i", "<LocalLeader>i", "<cmd>s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2: $\\2\"<cr><esc>A") +vim.keymap.set({"i", "n"}, "<LocalLeader>v", "<esc>A)\"<esc>I\"$(<esc>I") vim.opt.formatoptions = "cqrnj" diff --git a/config/essentials/nvim/lua/user/cmp/setup.lua b/config/essentials/nvim/lua/user/cmp/setup.lua index 99f984d..8f8291e 100644 --- a/config/essentials/nvim/lua/user/cmp/setup.lua +++ b/config/essentials/nvim/lua/user/cmp/setup.lua @@ -6,8 +6,8 @@ cmp.setup({ end, }, window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ ['<C-b>'] = cmp.mapping.scroll_docs(-4), diff --git a/config/essentials/nvim/lua/user/live-server.lua b/config/essentials/nvim/lua/user/live-server.lua index dac3c19..197809d 100644 --- a/config/essentials/nvim/lua/user/live-server.lua +++ b/config/essentials/nvim/lua/user/live-server.lua @@ -5,7 +5,7 @@ local live_servers = {} function M.start_live_server() if vim.fn.executable('lsof') == 0 then print("Error: 'lsof' command not found") - elseif vim.fn.executable('lsof') == 0 then + elseif vim.fn.executable('live-server') == 0 then print("Error: 'live-server' command not found") return end diff --git a/config/essentials/nvim/lua/user/zk.lua b/config/essentials/nvim/lua/user/zk.lua index a5e06d8..613c8e5 100644 --- a/config/essentials/nvim/lua/user/zk.lua +++ b/config/essentials/nvim/lua/user/zk.lua @@ -50,6 +50,11 @@ require('telekasten').setup({ template_new_note = home .. "/" .. "templates/new_note.md", new_note_filename = "title", }, + C = { + home = home .. "/" .. "C", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, businessIT = { home = home .. "/" .. "businessIT", template_new_note = home .. "/" .. "templates/new_note.md", diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 83da0f6..d8675d4 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -3,12 +3,9 @@ if [[ "/dev/tty1" = "$TTY" || "/dev/tty2" = "$TTY" ]] && [[ "$(id -u)" -ne 0 ]] then clear - eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D 2> /dev/null)" - eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --noask --eval --quiet --agents ssh 2> /dev/null)" - clear if [ "/dev/tty1" = "$TTY" ] then - Hyprland > /dev/null 2>&1 + startw > /dev/null 2>&1 else startx > /dev/null 2>&1 fi @@ -28,7 +25,7 @@ zle -N add-surround surround zle -N change-surround surround compinit -if grep -qi "debian\|ubuntu" /etc/os-release 2>/dev/null +if grep -qi "debian\|ubuntu" /usr/lib/os-release /etc/os-release 2>/dev/null then sfiles=( /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh @@ -41,7 +38,7 @@ else fi sfiles+=( ~/.config/zsh/functions.zsh - ~/.config/zsh/aliases.zsh + ~/.config/zsh/aliases.sh ) for f in "${sfiles[@]}"; do test -f "$f" && source "$f" @@ -67,17 +64,14 @@ bindkey "^['" quote-line isTextFile() { - if [ ! -f "$1" ] - then + [ -f "$1" ] && + # will execute the file, I'd rather not have an error message + [ ${1::2} != "./" ] && + [ ${1::1} != "/" ] && + ! type "$1" > /dev/null && + # is text file? + file -b --mime-type "$1" | grep -q "^text/" || return 1 - fi - - file_type=$(file -b --mime-type "$1") - if [[ "$file_type" == text/* ]] - then - return - fi - return 1 } # rehash hook @@ -113,17 +107,13 @@ function osc7 { } add-zsh-hook -Uz chpwd osc7 command_not_found_handler () { - isTextFile "$1" || - echo "zsh: command not found: $1" >&2 -} -# open file with file name -open_file() { - if [ ${1:0:2} != "./" ] && isTextFile "$1" + if [[ -o interactive ]] && isTextFile "$1" then "$EDITOR" "$1" + else + echo "zsh: command not found: $1" >&2 fi } -add-zsh-hook -Uz preexec open_file # prompt PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ ' diff --git a/config/essentials/zsh/aliases.zsh b/config/essentials/zsh/aliases.sh index 09215b2..0c7c1ac 100644 --- a/config/essentials/zsh/aliases.zsh +++ b/config/essentials/zsh/aliases.sh @@ -1,28 +1,48 @@ #!/bin/zsh # s/alias \([^-]\)/alias -g \1 -if grep -qi "debian\|ubuntu" /etc/os-release 2> /dev/null +# Zsh specific aliases +if [ $SHELL = "/bin/zsh" ] then - alias aptup='apt update && apt upgrade -y' -fi + # googoo aliases + alias o.='o .' + alias go.='go .' + alias ogo.='ogo .' + alias o/='o /' + alias o/s='o /srv' + alias go/='go /' + alias go/s='go /srv' + alias ogo/='ogo /' + alias ogo/s='ogo /srv' -if [ "$WAYLAND_DISPLAY" ] -then - alias -g clipp='wl-copy -n' - alias -g clipo='wl-paste -n' -else - if which devour > /dev/null 2>&1 + if [ "$WAYLAND_DISPLAY" ] then - alias mpv='devour mpv' - alias zathura='devour zathura' + alias -g clipp='wl-copy -n' + alias -g clipo='wl-paste -n' + else + if which devour > /dev/null 2>&1 + then + alias mpv='devour mpv' + alias zathura='devour zathura' + fi + alias -g clipp='xclip -selection clipboard -r' + alias -g clipo='xclip -o -selection clipboard -r' fi - alias -g clipp='xclip -selection clipboard -r' - alias -g clipo='xclip -o -selection clipboard -r' + alias clipic='clipo > /tmp/pic.png' + + alias -g '...'='../..' + alias -g '....'='../../..' + alias -g bg='&; disown' + alias -g hl='--help |& less -r' +fi + + +if grep -qi "debian\|ubuntu" /etc/os-release 2> /dev/null +then + alias aptup='apt update && apt upgrade -y' fi -alias clipic='clipo > /tmp/pic.png' # Programs -alias vi='nvim' alias nb='newsboat' alias sr='surfraw' alias ccu='calcurse' @@ -72,6 +92,8 @@ alias dopacs='dopac -S' alias dopacc='dopac -Sc' alias doprm='dopac -Rns' +alias mpkg='makepkg -si' + which pikaur > /dev/null 2>&1 && alias yay='pikaur' alias yup='yay -Syu' @@ -84,6 +106,12 @@ alias yrm='yay -Rns' alias pkb='pkgfile -b' +# transmission +alias trr='transmission-remote debuc.com' +alias trls='transmission-remote debuc.com -t all -l' +alias tradd='transmission-remote debuc.com -a' +alias trclipo='transmission-remote debuc.com -a "$(clipo)"' + alias grub-update='doas grub-mkconfig -o /boot/grub/grub.cfg' # vim @@ -107,7 +135,8 @@ alias fif='find . -type "f" | grep' alias fid='find . -type "d" | grep' alias sxt='sxiv -t' alias wgsh='wget --quiet --show-progress' -alias ss4='ss -tln4p | cut -f1 -d,' +alias wgc='wgsh "$(clipo)"' +alias ss4='ss -tln4p' alias mdbw='mariadb -h 0.0.0.0 -u padmin -pbulbizarre padmindb' alias mdbwa='mariadb -h 10.3.50.5 -u padmin -pbulbizarre padmindb' @@ -124,11 +153,6 @@ alias qrclipo='qrencode -s 16 "$(clipo)" -o - | imv -w "imv - $(clipo)" -' alias airpods='bluetoothctl connect 60:93:16:24:00:10' alias hotpsot='nmcli dev wifi hotspot ifname wlan0 ssid wiefie password "peepeepoopoo"' alias wtip='wt ip -c -brief addr' -alias muttmail='echo -n "email set: " >&2 -ls $HOME/.config/mutt/configs | -fzf | -tee /dev/stderr | -xargs -I {} ln -sf "$HOME/.config/mutt/configs/{}" $HOME/.config/mutt/muttrc' alias fusephone='sshfs myphone: /media/phone' alias ttyper='ttyper -l english1000 -w 100' @@ -143,17 +167,12 @@ alias penv='python3 -m venv env' alias phttp='python3 -m http.server' alias pipreq='pip install -r requirements.txt' -alias -g '...'='../..' -alias -g '....'='../../..' -alias -g bg='&; disown' -alias cx='chmod +x' alias ch='chown ${USER}:${USER} -R' -alias -g hl='--help |& less -r' alias kll='killall' alias pi='ping archlinux.org -c4' alias sba='source env/bin/activate || source bin/activate' alias smc='systemctl' -alias ssc='doas smc' +alias ssc='doas systemctl' alias smcu='smc --user' alias zsr='source ${ZDOTDIR:-$HOME}/.zshrc && rehash' alias rh='rehash' @@ -162,6 +181,7 @@ alias dmci="doas make clean install" alias rmd='rm -f *.{orig,rej}' alias cdzot='mkdir -p /tmp/zottesite && cd /tmp/zottesite' alias gdate="date +%y%m%d_%H%M%S" +alias tpid='tail -f /dev/null --pid' alias vbm='vboxmanage' alias vbls='vbm list vms' @@ -170,59 +190,55 @@ alias vb='vbm startvm' # quick config alias ez='$EDITOR ${ZDOTDIR:-$HOME}/.zshrc' -alias eza='$EDITOR ${ZDOTDIR}/aliases.zsh' +alias eza='$EDITOR ${ZDOTDIR}/aliases.sh' alias ezf='$EDITOR ${ZDOTDIR}/functions.zsh' alias eto='$EDITOR ~/sync/TODO' -alias edw='$EDITOR ~/src/dwm/config.def.h' -alias edm='$EDITOR ~/src/dmenu/config.def.h' +alias edw='$EDITOR ~/proj/suckless/dwm/config.def.h' +alias edm='$EDITOR ~/proj/suckless/dmenu/config.def.h' alias ehst='$EDITOR $ZDOTDIR/histfile' alias ezh=' $EDITOR $HISTFILE' -alias est='$EDITOR ~/src/st/config.def.h' -alias esl='$EDITOR ~/src/slock/config.def.h' -alias esls='$EDITOR ~/src/slstatus/config.def.h' +alias est='$EDITOR ~/proj/suckless/st/config.def.h' +alias esl='$EDITOR ~/proj/suckless/slock/config.def.h' +alias esls='$EDITOR ~/proj/suckless/slstatus/config.def.h' alias ehy='$EDITOR ~/.config/hypr/hyprland.conf' alias cfd='$EDITOR config.def.h' -# quick cd +# /# quick cd
jV}k:!sort -t "'" -k 2
+alias cdl='cd $HOME/dl' +alias cdoc='cd $HOME/docs' alias cda='cd $HOME/docs/android/projects' +alias cdm='cd $HOME/music' +alias cdp='cd $HOME/pics' +alias cdpa='cd $HOME/pics/ai-outputs/' +alias cdpp='cd $HOME/proj/personal/' +alias chom='cd $HOME/proj/personal/homepage' +alias lov='cd $HOME/proj/personal/lola' +alias cdsw='cd $HOME/proj/personal/WheelAdvisor' +alias cddm='cd $HOME/proj/suckless/dmenu' +alias cdw='cd $HOME/proj/suckless/dwm' +alias cdslo='cd $HOME/proj/suckless/slock' +alias cdsl='cd $HOME/proj/suckless/slstatus' +alias cdst='cd $HOME/proj/suckless/st' +alias cdsta='cd $HOME/proj/suckless/stable-diffusion-webui' +alias cdsu='cd $HOME/proj/suckless/surf' alias cds='cd $HOME/src/' -alias cdsw='cd $HOME/src/WheelAdvisor' -alias cdw='cd $HOME/src/dwm' -alias cddm='cd $HOME/src/dmenu' -alias cdslo='cd $HOME/src/slock' -alias cdsl='cd $HOME/src/slstatus' -alias cdst='cd $HOME/src/st' -alias cdsta='cd $HOME/src/stable-diffusion-webui' -alias cdl='cd $HOME/dl' +alias cdsb='cd $HOME/src/build' +alias cdsc='cd $HOME/src/comfyui/' alias cdo='cd $HOME/src/dotfiles' -alias cdoc='cd $HOME/docs' alias cdi='cd $HOME/src/installdrier' alias cdia='cd $HOME/src/installdrier/arch' alias cdib='cd $HOME/src/installdrier/deb' -alias cdm='cd $HOME/music' -alias cdd='cd $HOME/dl' -alias cdp='cd $HOME/pics' -alias cdrs='cd /srv/' -alias cdng='cd /etc/nginx' alias czo='cd $HOME/zot/' +alias cdpw='cd ${PASSWORD_STORE_DIR:-$HOME/.password-store}' +alias cdng='cd /etc/nginx' +alias cdrs='cd /srv/' -# googoo aliases -alias o.='o .' -alias go.='go .' -alias ogo.='ogo .' -alias o/='o /' -alias o/s='o /srv' -alias go/='go /' -alias go/s='go /srv' -alias ogo/='ogo /' -alias ogo/s='ogo /srv' - +# fzf aliases alias fzps='ps aux | tail +2 | fzf | tee /dev/stderr | awk '\''{print $2}'\'' | clipp' alias asf='alias | fzf' alias fzh="tac $HISTFILE | fzf | tee /dev/stderr | clipp" +alias ffwin='hyprctl clients -j | jq '\''.[].pid'\'' | fzf --preview "hyprctl clients -j | jq '\''.[] | select(.pid == {}) | {class, title, workspace, xwayland}'\''"' alias pff='find ${PASSWORD_STORE_DIR:=$HOME/src/password-store/} -name "*.gpg" | sed -e "s@$PASSWORD_STORE_DIR/@@" -e '\''s/\.gpg$//'\'' | fzf | xargs pass show -c' - -alias -s zip='unzip -l' -alias -s tar='tar tf' +alias fzps='fzf --print0 | xargs -0I{}' alias dcb='docker build' alias dcbt='docker build -t' diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 487c247..671e6fb 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -2,7 +2,7 @@ die () { - echo "$1" >&2 + echo "$@" >&2 } awnk() { @@ -72,7 +72,8 @@ ipc () calc () { echo "$@" | bc -l } unique () { - f="/tmp/$(uuidgen)" + local f + f="$(mktemp)" awk '!x[$0]++' "$1" > "$f" mv "$f" "$1" } @@ -261,3 +262,27 @@ sms () { ssh phone sendmsg "$1" "'$2'" } + +trcp () +{ + scp "$1" db:/media/basilisk/downloads/transmission/torrents/ +} + +muttmail () +{ + die -n "email set: " + ls $HOME/.config/mutt/configs | + fzf | + tee /dev/stderr | + xargs -I {} ln -sf "$HOME/.config/mutt/configs/{}" $HOME/.config/mutt/muttrc + die -n 'Press [Enter to login]' + read && mutt +} + +resize () +{ + test $# -lt 2 && + printf "usage: %s <format> <file> [out]\n" "$0" >&2 && + return 1 + convert -resize $1^ -gravity center -crop $1+0+0 -- "$2" "${3:-$1}" +} diff --git a/config/extra/tridactyl/tridactylrc b/config/extra/tridactyl/tridactylrc index fa6ed1d..c48ffe1 100644 --- a/config/extra/tridactyl/tridactylrc +++ b/config/extra/tridactyl/tridactylrc @@ -1,61 +1,61 @@ -" General Settings -set newtab https://www.duckduckgo.com -set searchengine duckduckgo -set searchurls.wi https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s +set newtab http://localhost:28669 +set searchengine qwant + +" Searchurls +set searchurls.1x https://www.1377x.to/search/%s/1 +set searchurls.am https://www.amazon.com.be/s?k=%s +set searchurls.aur https://aur.archlinux.org/packages?O=0&K=%s +set searchurls.aw https://wiki.archlinux.org/title/%s +set searchurls.cnrtl http://www.cnrtl.fr/lexicographie/ +set searchurls.dhu https://hub.docker.com/search?q=%s set searchurls.g https://www.google.com/search?q=%s -set searchurls.y https://www.youtube.com/results?search_query=%s set searchurls.gm https://www.google.com/maps?q=%s -set searchurls.aw https://wiki.archlinux.org/title/%s -set searchurls.aur https://aur.archlinux.org/packages?O=0&K=%s -set searchurls.tw https://tweakers.net/zoeken/?keyword=%s +set searchurls.gwi https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&fulltext=Search&search= set searchurls.im https://www.imdb.com/find?q=%s -set searchurls.1x https://www.1377x.to/search/%s/1 -set searchurls.am https://www.amazon.com.be/s?k=%s -set searchurls.pyp https://pypi.org/search/?q=%s +set searchurls.lg https://libgen.gs/index.php?req=%s set searchurls.mc https://minecraft.fandom.com/wiki/%s set searchurls.mcf https://www.curseforge.com/minecraft/mc-mods/search?search=%s set searchurls.mcm https://modrinth.com/mods?q=%s -set searchurls.dhu https://hub.docker.com/search?q=%s -set searchurls.plu https://app.pluralsight.com/search/?q=%s -set searchurls.ru https://rutracker.org/forum/tracker.php?nm=%s -set searchurls.google https://www.google.com/search?q= -set searchurls.googlelucky https://www.google.com/search?btnI=I'm+Feeling+Lucky&q= -set searchurls.scholar https://scholar.google.com/scholar?q= -set searchurls.googleuk https://www.google.co.uk/search?q= -set searchurls.bing https://www.bing.com/search?q= -set searchurls.duckduckgo https://duckduckgo.com/?q= -set searchurls.yahoo https://search.yahoo.com/search?p= -set searchurls.twitter https://twitter.com/search?q= -set searchurls.wikipedia https://en.wikipedia.org/wiki/Special:Search/ -set searchurls.youtube https://www.youtube.com/results?search_query= -set searchurls.amazon https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords= -set searchurls.amazonuk https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords= -set searchurls.startpage https://startpage.com/do/search?language=english&cat=web&query= -set searchurls.github https://github.com/search?utf8=✓&q= -set searchurls.searx https://searx.me/?category_general=on&q= -set searchurls.cnrtl http://www.cnrtl.fr/lexicographie/ -set searchurls.osm https://www.openstreetmap.org/search?query= set searchurls.mdn https://developer.mozilla.org/en-US/search?q= -set searchurls.gentoo_wiki https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&fulltext=Search&search= +set searchurls.osm https://www.openstreetmap.org/search?query= +set searchurls.plu https://app.pluralsight.com/search/?q=%s +set searchurls.pyp https://pypi.org/search/?q=%s set searchurls.qwant https://www.qwant.com/?q= - +set searchurls.ru https://rutracker.org/forum/tracker.php?nm=%s +set searchurls.tw https://tweakers.net/zoeken/?keyword=%s +set searchurls.wi https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s +set searchurls.y https://www.youtube.com/results?search_query=%s " Binds + " vim macro: -" Ibind gnp tabopen yy2pwwdtojRwinbblrwkro +" yy2pwlrnjrpwitabbkiwin2j0 bind J tabnext bind K tabprev -" chat gpt -bind gnc tabopen https://chat.openai.com/chat + bind goc open https://chat.openai.com/chat -bind gwc winopen https://chat.openai.com/chat -" awesome pixel tutorials -bind gnp tabopen https://github.com/Siilwyn/awesome-pixel-art#tutorials +bind gnc winopen https://chat.openai.com/chat +bind gpc tabopen https://chat.openai.com/chat bind gop open https://github.com/Siilwyn/awesome-pixel-art#tutorials -bind gwp winopen https://github.com/Siilwyn/awesome-pixel-art#tutorials -" deluge -bind gnd tabopen http://192.168.178.52:8112/ -bind god open http://192.168.178.52:8112/ -bind gwd winopen http://192.168.178.52:8112/ +bind gnp winopen https://github.com/Siilwyn/awesome-pixel-art#tutorials +bind gpp tabopen https://github.com/Siilwyn/awesome-pixel-art#tutorials +bind godb open http://debuc.com:32095 +bind gndb winopen http://debuc.com:32095 +bind gpdb tabopen http://debuc.com:32095 +bind godc open http://debuc.com:8384 +bind gndc winopen http://debuc.com:8384 +bind gpdc tabopen http://debuc.com:8384 +bind godj open http://debuc.com:8096 +bind gndj winopen http://debuc.com:8096 +bind gpdj tabopen http://debuc.com:8096 +bind gods open http://debuc.com:5030 +bind gnds winopen http://debuc.com:5030 +bind gpds tabopen http://debuc.com:5030 +bind godt open http://debuc.com:9091 +bind gndt winopen http://debuc.com:9091 +bind gpdt tabopen http://debuc.com:9091 +bind gody open http://debuc.com:9010 +bind gndy winopen http://debuc.com:9010 +bind gpdy tabopen http://debuc.com:9010 " For syntax highlighting see https://github.com/tridactyl/vim-tridactyl " vim: set filetype=tridactyl diff --git a/config/home/.bashrc b/config/home/.bashrc new file mode 100644 index 0000000..33dbba4 --- /dev/null +++ b/config/home/.bashrc @@ -0,0 +1,9 @@ +SHELL=/bin/bash +PATH=$HOME/bin:$PATH +color1="\[\033[35m\]" +color2="\[\033[36m\]" +bold="\[\033[1m\]" +reset="\[\033[0m\]" +PS1="${color1}${bold} [\\u${reset}@${color2}${bold}\\h]${reset} \\w " +HISTFILE= +. $HOME/.config/zsh/aliases.sh diff --git a/config/hyprland/foot/foot.ini b/config/hyprland/foot/foot.ini index 8caee75..a1fc1e8 100644 --- a/config/hyprland/foot/foot.ini +++ b/config/hyprland/foot/foot.ini @@ -9,7 +9,7 @@ term=xterm-256color title="" # locked-title=no -font=monospace:size=11 +font=monospace:size=10.5 # font-bold=<bold variant of regular font> # font-italic=<italic variant of regular font> # font-bold-italic=<bold+italic variant of regular font> @@ -121,15 +121,15 @@ search-start=Control+Shift+r # minimize=none # maximize=none # fullscreen=none -# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +pipe-visible=[sh -c "cat > /tmp/footvisible"] Mod1+Shift+p # pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none # pipe-selected=[xargs -r firefox] none -# show-urls-launch=Control+Shift+u +show-urls-launch=Control+Shift+u show-urls-copy=Mod1+Shift+l # show-urls-persistent=none # prompt-prev=Control+Shift+z # prompt-next=Control+Shift+x -# unicode-input=none +unicode-input=none # noop=none [search-bindings] diff --git a/config/hyprland/hypr/binds.conf b/config/hyprland/hypr/binds.conf index 5c2dd99..eb3d4a2 100644 --- a/config/hyprland/hypr/binds.conf +++ b/config/hyprland/hypr/binds.conf @@ -123,3 +123,5 @@ bind = $mainMod ALT, S, exec, $HOME/.config/hypr/screenshot.sh -m bind = $mainMod SHIFT, S, exec, $HOME/.config/hypr/screenshot.sh -sc bind = $mainMod ALT SHIFT, S, exec, $HOME/.config/hypr/screenshot.sh -s bind = $mainMod CTRL, S, exec, $HOME/.config/hypr/screenshot.sh -f + +bind = $mainMod, D, exec, foot -e ssh -t db tmux a diff --git a/config/hyprland/hypr/hyprland.conf b/config/hyprland/hypr/hyprland.conf index 8aa437e..a8a99c2 100644 --- a/config/hyprland/hypr/hyprland.conf +++ b/config/hyprland/hypr/hyprland.conf @@ -82,6 +82,7 @@ gestures { } windowrulev2 = noanim, class:^(.*[Pp]inentry.*)$ +windowrulev2 = float, class:^(.*[Pp]inentry.*)$ windowrulev2 = noanim, class:dmenu layerrule = noanim, launcher diff --git a/config/hyprland/hypr/startup.sh b/config/hyprland/hypr/startup.sh index bd7b858..83fefe4 100755 --- a/config/hyprland/hypr/startup.sh +++ b/config/hyprland/hypr/startup.sh @@ -4,3 +4,4 @@ waybar & gammastep & wl-paste --watch cliphist store & keyadd id_rsa & +swayidle 300 locker & diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index 816a851..aadc6d3 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -2,7 +2,7 @@ "layer": "top", "modules-left": ["battery", "clock", "wlr/workspaces", "mpd"], "modules-center": ["hyprland/window"], - "modules-right": ["network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], + "modules-right": ["custom/wireguard", "network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], "wlr/workspaces": { "on-click": "activate", }, @@ -44,6 +44,11 @@ "default":["", "", "", "", ""] }, }, + "custom/wireguard": { + "exec": "ip addr show dev wg0", + "format": "wg0", + "restart-interval": 3, + }, "network": { "format-wifi": " ", "tooltip-format-wifi": "{ifname} {essid}", diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index eced638..19bb703 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -39,7 +39,7 @@ window#waybar.PCSX2 #window { #mpd, #battery, #window, -#network, #pulseaudio, #temperature, #cpu, #custom-memory { +#custom-wireguard, #network, #pulseaudio, #temperature, #cpu, #custom-memory { margin-left: 8px; padding-left: 16px; padding-right: 16px; @@ -48,7 +48,7 @@ window#waybar.PCSX2 #window { #workspaces, #mpd, #battery, #clock, #window, -#network, #pulseaudio, #temperature, #cpu, #custom-memory, #tray { +#custom-wireguard, #network, #pulseaudio, #temperature, #cpu, #custom-memory, #tray { border: solid @background 2px; margin-top: 4px; margin-bottom: 2px; @@ -112,6 +112,12 @@ window#waybar.PCSX2 #window { background: @color4; } +#custom-wireguard { + color: @color5; + border-color: @color8; + background: @background; +} + #network { color: @background; background: @color5; diff --git a/config/theme/mimeapps.list b/config/theme/mimeapps.list index 141c91f..20fdce3 100644 --- a/config/theme/mimeapps.list +++ b/config/theme/mimeapps.list @@ -1,2 +1,164 @@ [Default Applications] inode/directory=kitty-open.desktop +text/html=firefox.desktop +text/xml=firefox.desktop +application/xhtml+xml=firefox.desktop +application/vnd.mozilla.xul+xml=firefox.desktop +text/mml=firefox.desktop +x-scheme-handler/http=firefox.desktop +x-scheme-handler/https=firefox.desktop +application/x-xpinstall=firefox.desktop +application/pdf=org.pwmt.zathura-pdf-poppler.desktop +application/json=firefox.desktop +application/ogg=mpv.desktop +application/x-ogg=mpv.desktop +application/mxf=mpv.desktop +application/sdp=mpv.desktop +application/smil=mpv.desktop +application/x-smil=mpv.desktop +application/streamingmedia=mpv.desktop +application/x-streamingmedia=mpv.desktop +application/vnd.rn-realmedia=mpv.desktop +application/vnd.rn-realmedia-vbr=mpv.desktop +audio/aac=mpv.desktop +audio/x-aac=mpv.desktop +audio/vnd.dolby.heaac.1=mpv.desktop +audio/vnd.dolby.heaac.2=mpv.desktop +audio/aiff=mpv.desktop +audio/x-aiff=mpv.desktop +audio/m4a=mpv.desktop +audio/x-m4a=mpv.desktop +application/x-extension-m4a=mpv.desktop +audio/mp1=mpv.desktop +audio/x-mp1=mpv.desktop +audio/mp2=mpv.desktop +audio/x-mp2=mpv.desktop +audio/mp3=mpv.desktop +audio/x-mp3=mpv.desktop +audio/mpeg=mpv.desktop +audio/mpeg2=mpv.desktop +audio/mpeg3=mpv.desktop +audio/mpegurl=mpv.desktop +audio/x-mpegurl=mpv.desktop +audio/mpg=mpv.desktop +audio/x-mpg=mpv.desktop +audio/rn-mpeg=mpv.desktop +audio/musepack=mpv.desktop +audio/x-musepack=mpv.desktop +audio/ogg=mpv.desktop +audio/scpls=mpv.desktop +audio/x-scpls=mpv.desktop +audio/vnd.rn-realaudio=mpv.desktop +audio/wav=mpv.desktop +audio/x-pn-wav=mpv.desktop +audio/x-pn-windows-pcm=mpv.desktop +audio/x-realaudio=mpv.desktop +audio/x-pn-realaudio=mpv.desktop +audio/x-ms-wma=mpv.desktop +audio/x-pls=mpv.desktop +audio/x-wav=mpv.desktop +video/mpeg=mpv.desktop +video/x-mpeg2=mpv.desktop +video/x-mpeg3=mpv.desktop +video/mp4v-es=mpv.desktop +video/x-m4v=mpv.desktop +video/mp4=mpv.desktop +application/x-extension-mp4=mpv.desktop +video/divx=mpv.desktop +video/vnd.divx=mpv.desktop +video/msvideo=mpv.desktop +video/x-msvideo=mpv.desktop +video/ogg=mpv.desktop +video/quicktime=mpv.desktop +video/vnd.rn-realvideo=mpv.desktop +video/x-ms-afs=mpv.desktop +video/x-ms-asf=mpv.desktop +audio/x-ms-asf=mpv.desktop +application/vnd.ms-asf=mpv.desktop +video/x-ms-wmv=mpv.desktop +video/x-ms-wmx=mpv.desktop +video/x-ms-wvxvideo=mpv.desktop +video/x-avi=mpv.desktop +video/avi=mpv.desktop +video/x-flic=mpv.desktop +video/fli=mpv.desktop +video/x-flc=mpv.desktop +video/flv=mpv.desktop +video/x-flv=mpv.desktop +video/x-theora=mpv.desktop +video/x-theora+ogg=mpv.desktop +video/x-matroska=mpv.desktop +video/mkv=mpv.desktop +audio/x-matroska=mpv.desktop +application/x-matroska=mpv.desktop +video/webm=mpv.desktop +audio/webm=mpv.desktop +audio/vorbis=mpv.desktop +audio/x-vorbis=mpv.desktop +audio/x-vorbis+ogg=mpv.desktop +video/x-ogm=mpv.desktop +video/x-ogm+ogg=mpv.desktop +application/x-ogm=mpv.desktop +application/x-ogm-audio=mpv.desktop +application/x-ogm-video=mpv.desktop +application/x-shorten=mpv.desktop +audio/x-shorten=mpv.desktop +audio/x-ape=mpv.desktop +audio/x-wavpack=mpv.desktop +audio/x-tta=mpv.desktop +audio/AMR=mpv.desktop +audio/ac3=mpv.desktop +audio/eac3=mpv.desktop +audio/amr-wb=mpv.desktop +video/mp2t=mpv.desktop +audio/flac=mpv.desktop +audio/mp4=mpv.desktop +application/x-mpegurl=mpv.desktop +video/vnd.mpegurl=mpv.desktop +application/vnd.apple.mpegurl=mpv.desktop +audio/x-pn-au=mpv.desktop +video/3gp=mpv.desktop +video/3gpp=mpv.desktop +video/3gpp2=mpv.desktop +audio/3gpp=mpv.desktop +audio/3gpp2=mpv.desktop +video/dv=mpv.desktop +audio/dv=mpv.desktop +audio/opus=mpv.desktop +audio/vnd.dts=mpv.desktop +audio/vnd.dts.hd=mpv.desktop +audio/x-adpcm=mpv.desktop +application/x-cue=mpv.desktop +audio/m3u=mpv.desktop +text/english=nvim.desktop +text/plain=nvim.desktop +text/x-makefile=nvim.desktop +text/x-c++hdr=nvim.desktop +text/x-c++src=nvim.desktop +text/x-chdr=nvim.desktop +text/x-csrc=nvim.desktop +text/x-java=nvim.desktop +text/x-moc=nvim.desktop +text/x-pascal=nvim.desktop +text/x-tcl=nvim.desktop +text/x-tex=nvim.desktop +application/x-shellscript=nvim.desktop +text/x-c=nvim.desktop +text/x-c++=nvim.desktop +image/bmp=imv.desktop +image/gif=imv.desktop +image/jpeg=imv.desktop +image/jpg=imv.desktop +image/pjpeg=imv.desktop +image/png=imv.desktop +image/tiff=imv.desktop +image/x-bmp=imv.desktop +image/x-pcx=imv.desktop +image/x-png=imv.desktop +image/x-portable-anymap=imv.desktop +image/x-portable-bitmap=imv.desktop +image/x-portable-graymap=imv.desktop +image/x-portable-pixmap=imv.desktop +image/x-tga=imv.desktop +image/x-xbitmap=imv.desktop +image/heif=imv.desktop diff --git a/config/xdg/user-dirs.dirs b/config/xdg/user-dirs.dirs deleted file mode 100644 index d5389fd..0000000 --- a/config/xdg/user-dirs.dirs +++ /dev/null @@ -1,8 +0,0 @@ -XDG_DOCUMENTS_DIR="$HOME/docs" -XDG_DOWNLOAD_DIR="$HOME/dl" -XDG_MUSIC_DIR="$HOME/music" -XDG_PICTURES_DIR="$HOME/pics" -XDG_PUBLICSHARE_DIR="$HOME/" -XDG_VIDEOS_DIR="$HOME/vids" -XDG_DESKTOP_DIR="$HOME/" -XDG_TEMPLATES_DIR="$HOME/" @@ -1,6 +1,7 @@ #!/bin/sh -trap "echo -e '\nbye'; exit 1" EXIT +trap "exit 1" EXIT INT +test "$(id -u)" != 0 && sudo=sudo die () { echo "$@" 1>&2 @@ -9,20 +10,20 @@ die () { if ! stow --version > /dev/null 2>&1 then die "stow not installed or not found." - die "install stow?" + die "install stow? (arch)" die -n ">" test "y" = "$(head -n 1)" && - doas pacman -Sy stow || + $sudo pacman -Sy stow || exit 1 fi if [ -n "${MACH:=$1}" ] then die "I: stowing for $MACH" else - die "E: MACH not set" >&2 + die "E: MACH not set" die "Enter valid value for 'MACH'" die "d(esktop) | s(erver) | l(aptop)" - echo -n ">" >&2 + die -n ">" read MACH fi @@ -33,7 +34,7 @@ cd "$(dirname "$(realpath "$0")")" || exit 1 case "$MACH" in "desktop" | "d" | "laptop" | "l") stow -d bin/ -t "$HOME/bin" -R common guiscripts menuscripts extra - stow -d config/ -t "$HOME/.config" -R essentials common extra X theme xdg hyprland + stow -d config/ -t "$HOME/.config" -R essentials common extra X theme hyprland stow -d config/ -t "$HOME/" -R home ;; "server" | "s") |