From 2b3599857f549019ce24b40a1644a690b084af49 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 19:38:36 +0200 Subject: use $HOME and added waybar edit aliases --- config/essentials/zsh/aliases.sh | 64 +++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 7926c17..5b1ae3f 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -172,9 +172,9 @@ alias kll='killall' alias pi='ping archlinux.org -c4' alias sba='source env/bin/activate || source bin/activate' alias smc='systemctl' -alias ssc='doas systemctl' +alias dsmc='doas systemctl' alias smcu='smc --user' -alias zsr='source ${ZDOTDIR:-$HOME}/.zshrc && rehash' +alias zsr='source ${ZDOTDIR:-~}/.zshrc && rehash' alias rh='rehash' alias wf='doas wipefs -a' alias dmci="doas make clean install" @@ -189,7 +189,7 @@ alias vblsr='vbm list runningvms' alias vb='vbm startvm' # quick config -alias ez='$EDITOR ${ZDOTDIR:-$HOME}/.zshrc' +alias ez='$EDITOR ${ZDOTDIR:-~}/.zshrc' alias eza='$EDITOR ${ZDOTDIR}/aliases.sh' alias ezf='$EDITOR ${ZDOTDIR}/functions.zsh' alias eto='$EDITOR ~/sync/TODO' @@ -201,34 +201,36 @@ 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 ewbj='$EDITOR ~/src/dotfiles/config/hyprland/waybar/config.jsonc' +alias ewbs='$EDITOR ~/src/dotfiles/config/hyprland/waybar/style.css' alias cfd='$EDITOR config.def.h' # /# 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 cdsb='cd $HOME/src/build' -alias cdsc='cd $HOME/src/comfyui/' -alias cdo='cd $HOME/src/dotfiles' -alias cdi='cd $HOME/src/installdrier' -alias cdia='cd $HOME/src/installdrier/arch' -alias cdib='cd $HOME/src/installdrier/deb' -alias czo='cd $HOME/zot/' -alias cdpw='cd ${PASSWORD_STORE_DIR:-$HOME/.password-store}' +alias cdl='cd ~/dl' +alias cdoc='cd ~/docs' +alias cda='cd ~/docs/android/projects' +alias cdm='cd ~/music' +alias cdp='cd ~/pics' +alias cdpa='cd ~/pics/ai-outputs/' +alias cdpp='cd ~/proj/personal/' +alias chom='cd ~/proj/personal/homepage' +alias lov='cd ~/proj/personal/lola' +alias cdsw='cd ~/proj/personal/WheelAdvisor' +alias cddm='cd ~/proj/suckless/dmenu' +alias cdw='cd ~/proj/suckless/dwm' +alias cdslo='cd ~/proj/suckless/slock' +alias cdsl='cd ~/proj/suckless/slstatus' +alias cdst='cd ~/proj/suckless/st' +alias cdsta='cd ~/proj/suckless/stable-diffusion-webui' +alias cdsu='cd ~/proj/suckless/surf' +alias cds='cd ~/src/' +alias cdsb='cd ~/src/build' +alias cdsc='cd ~/src/comfyui/' +alias cdo='cd ~/src/dotfiles' +alias cdi='cd ~/src/installdrier' +alias cdia='cd ~/src/installdrier/arch' +alias cdib='cd ~/src/installdrier/deb' +alias czo='cd ~/zot/' +alias cdpw='cd ${PASSWORD_STORE_DIR:-~/.password-store}' alias cdng='cd /etc/nginx' alias cdrs='cd /srv/' @@ -237,7 +239,7 @@ alias fzps='ps aux | tail +2 | fzf | tee /dev/stderr | awk '\''{print $2}'\'' | 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 pff='find ${PASSWORD_STORE_DIR:=~/src/password-store/} -name "*.gpg" | sed -e "s@$PASSWORD_STORE_DIR/@@" -e '\''s/\.gpg$//'\'' | fzf | xargs pass show -c' alias fzps='fzf --print0 | xargs -0I{}' alias dcb='docker build' @@ -253,7 +255,7 @@ alias dbinf='ssh db dlinfo' alias sshdb='ssh -t db tmux a' alias dbsmu='rsync -aPz db:/media/basilisk/music/ /media/kilimanjaro/music' -alias cfg='git --git-dir=$HOME/src/dotfiles/.git --work-tree=$HOME/src/dotfiles' +alias cfg='git --git-dir=~/src/dotfiles/.git --work-tree=~/src/dotfiles' # oh-my-zsh git aliases alias g='git' alias ga='git add' -- cgit v1.2.3 From c38509e3458df535231378ad6be6e5e356b35ae4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 22:34:35 +0200 Subject: redirect google to qwant --- config/extra/tridactyl/tridactylrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/extra/tridactyl/tridactylrc b/config/extra/tridactyl/tridactylrc index c48ffe1..2de07b4 100644 --- a/config/extra/tridactyl/tridactylrc +++ b/config/extra/tridactyl/tridactylrc @@ -8,7 +8,8 @@ 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.g https://www.qwant.com/?q=%s +set searchurls.google https://www.qwant.com/?q=%s set searchurls.gm https://www.google.com/maps?q=%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 -- cgit v1.2.3 From 4c7c339845481b7c2e9b630525fd83da988adbb0 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 22:35:01 +0200 Subject: use hyprland/workspaces --- config/hyprland/waybar/config.jsonc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index aadc6d3..d2bad38 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -1,10 +1,21 @@ { "layer": "top", - "modules-left": ["battery", "clock", "wlr/workspaces", "mpd"], + "modules-left": ["battery", "clock", "hyprland/workspaces", "mpd"], "modules-center": ["hyprland/window"], "modules-right": ["custom/wireguard", "network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], - "wlr/workspaces": { - "on-click": "activate", + "hyprland/workspaces": { + "format": "{icon}", + "format-icons": { + "1": "I", + "2": "II", + "3": "III", + "4": "IV", + "5": "V", + "6": "VI", + "7": "VII", + "8": "VIII", + "9": "IX", + }, }, "mpd": { "tooltip": false, -- cgit v1.2.3 From 5990d6ceb18e6afdfd8b6f13ab8dce5d94302d97 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 22:35:17 +0200 Subject: change text-shadow --- config/hyprland/waybar/schemes/base16.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index 19bb703..589cc12 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -75,7 +75,7 @@ window#waybar.PCSX2 #window { } #workspaces button.active { - text-shadow: 1px 0px 1px @background; + text-shadow: 0px 1px 0px @color1; } #workspaces button:hover { -- cgit v1.2.3 From bdeda6f2ab14c58ffa83711415bc93474b2f77cb Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 22:35:28 +0200 Subject: [nvim] added + keybind --- config/essentials/nvim/lua/user/remap.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/essentials/nvim/lua/user/remap.lua b/config/essentials/nvim/lua/user/remap.lua index 0fe4164..7c6d87f 100644 --- a/config/essentials/nvim/lua/user/remap.lua +++ b/config/essentials/nvim/lua/user/remap.lua @@ -34,6 +34,8 @@ vim.keymap.set("c", "", "", { noremap = true }) vim.keymap.set("v", "J", "m '>+1gv=gv", { noremap = true }) vim.keymap.set("v", "K", "m '<-2gv=gv", { noremap = true }) +vim.keymap.set("n", "+", "tabe .", { noremap = true }) + -- clipboard vim.keymap.set("n", "y", "\"+y", { noremap = true }) -- cgit v1.2.3 From e850f3a1702b4d8b9d0cfec5c07d710b5201ed29 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 22:36:30 +0200 Subject: edited toush to fit needs --- bin/common/toush | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/common/toush b/bin/common/toush index dd675b9..eb2d7cf 100755 --- a/bin/common/toush +++ b/bin/common/toush @@ -1,14 +1,10 @@ #!/bin/sh -# fork of -# https://codeberg.org/futxlii/bin/toush :) +# idea from https://codeberg.org/futxlii/bin/toush :) shebang='#!/bin/sh' -usage() { >&2 printf 'Usage: %s' "${0##*/}"; exit 1 ;} +[ -f "$1" ] && exit 1 -[ "$1" ] || usage -while [ "$1" ]; do - [ -f "$1" ] && usage - printf '%s\n\n' "$shebang" > "$1" && chmod +x "$1" - shift -done +printf '%s\n\n' "$shebang" > "$1" && + chmod +x "$1" && $EDITOR "$1" +grep -qv "$shebang\|^$" "$1" || rm "$1" -- cgit v1.2.3 From 49bbf6906089b5d957e2a781002d32b811ae630d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 4 Aug 2023 22:45:28 +0200 Subject: [aliases] added ufwd --- config/essentials/zsh/aliases.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 07a17e2..cf2a397 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -40,6 +40,7 @@ fi if grep -qi "debian\|ubuntu" /etc/os-release 2> /dev/null then alias aptup='apt update && apt upgrade -y' + alias ufwd='echo y | ufw delete "$(ufw status numbered | tail -n +5 | fzf | cut -f2 -d'\''['\'' | cut -f1 -d'\'']'\'')"' fi # Programs -- cgit v1.2.3 From bb16f75dc386c117f2bf5ecefeae7b175659e1ed Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:56:46 +0200 Subject: removed window module --- config/hyprland/waybar/config.jsonc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index d2bad38..86938db 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -1,7 +1,7 @@ { "layer": "top", - "modules-left": ["battery", "clock", "hyprland/workspaces", "mpd"], - "modules-center": ["hyprland/window"], + "modules-left": ["battery", "hyprland/workspaces", "mpd"], + "modules-center": ["clock"], "modules-right": ["custom/wireguard", "network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], "hyprland/workspaces": { "format": "{icon}", @@ -78,8 +78,8 @@ "restart-interval": 3, }, "clock": { - "format": "{:%H:%M}", - "format-alt": "{:(%R) %A %d %B}", + "format": "{:%R}", + "format-alt": "{:(%T) %A %d %B}", "interval": 1, }, "tray": { -- cgit v1.2.3 From e9f233edd96fe850037244c0d80bec67a8b2077f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:57:01 +0200 Subject: removed 1xsearch --- bin/extra/1xsearch | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100755 bin/extra/1xsearch diff --git a/bin/extra/1xsearch b/bin/extra/1xsearch deleted file mode 100755 index a248d38..0000000 --- a/bin/extra/1xsearch +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# dependencies -which pup > /dev/null || - exit 1 - -test -z "${query:=$1}" && - query="$(cat /dev/stdin)" - -url="https://1337x.to" -query="$(echo "$query" | tr ' ' '+' )" -result="$(curl -s "$url/search/$query/1/" | - pup -p 'a attr{href}' | - grep "^/torrent" | - head -n 1)" -# result contains / as first char -curl -s "$url$result" | - pup -p 'a attr{href}' | - grep "^magnet:" | - head -n 1 -- cgit v1.2.3 From d22b27180eb394f9443860ccdf2656d2fdef56ed Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:57:14 +0200 Subject: updated notify-send command --- bin/guiscripts/keyadd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 96d6d03..1df8896 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -43,16 +43,16 @@ die "HOST: $HOST" if [ "$1" = "-d" ] then ssh-add -d - < "$SSHFOLDER"/$key.pub && - notify-send "$0" "deleted $key" || - notify-send "$0" "could not delete." + notify-send "keyadd" "deleted $key" || + notify-send "keyadd" "could not delete." elif ! ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/$key)" then die "adding: $key" export PASSWORD="keys/$HOST/ssh/$key" export SSH_ASKPASS="$0" ssh-add - < "$SSHFOLDER"/$key && - notify-send "$0" "added $key" + notify-send "keyadd" "added $key" else die "key already added." - notify-send "$0" "key already added." + notify-send "keyadd" "key already added." fi -- cgit v1.2.3 From 171c1f519b902e1654e17bd33cb129569478f7f7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:57:37 +0200 Subject: don't create temp file --- bin/menuscripts/mhelp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index e03222b..5963a88 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,5 +1,4 @@ #!/usr/bin/env sh -OPTIONS="/tmp/dmh_options.txt" if [ "$MENUCMD" = "tofi" ] then @@ -16,18 +15,15 @@ fi test -z "$program" && exit 1 -if $program --help > "$OPTIONS" -then - option="$(grep "^ *-[-a-zA-Z0-9]* " "$OPTIONS" | - tr -s ' ' | - sort | - uniq | - column -l 2 -t | - $menucmd | - awk '{print $1}')" -fi +option="$($program --help | + # Parse options + grep "^ *-[-a-zA-Z0-9]* " | + tr -s ' ' | + sort | uniq | + column -l 2 -t | + $menucmd | + awk '{print $1}')" test -z "$option" && exit 1 -rm -f "$OPTIONS" setsid $program $option -- cgit v1.2.3 From 545067daecbe08061d6e02760dc1d6889cfb5900 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:57:57 +0200 Subject: [dunstrc] changed style --- config/X/dunst/dunstrc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index 71998b9..3ab0f3d 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -158,7 +158,7 @@ # %n progress value if set without any extra characters # %% Literal % # Markup is allowed - format = "%b" + format = "[%s]\n%b" # Alignment of message text. # Possible values are "left", "center" and "right". @@ -310,13 +310,13 @@ # Otherwise the "#" and following would be interpreted as a comment. # Icon for notifications with low urgency, uncomment to enable #default_icon = /path/to/icon - background = "#d08770" - foreground = "#2E3541" + background = "#b48ead" + foreground = "#2e3440" frame_color = "#81a1c1" timeout = 6 [urgency_normal] - background = "#b48ead" + background = "#81a1c1" foreground = "#2e3440" frame_color = "#2e3440" timeout = 5 @@ -324,9 +324,10 @@ #default_icon = /path/to/icon [urgency_critical] - background = "#b48ead" - foreground = "#d8dee9" + background = "#d08770" + foreground = "#2e3440" frame_color = "#81a1c1" + format = "[%s]\n%b" timeout = 0 # Icon for notifications with critical urgency, uncomment to enable #default_icon = /path/to/icon -- cgit v1.2.3 From 61b2b53547359ae6e3f2f8934456ec6eb62139a8 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:58:14 +0200 Subject: [zshenv] added paths for xdg base dir --- config/home/.zshenv | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/home/.zshenv b/config/home/.zshenv index d1cd73a..9a8206c 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -19,11 +19,16 @@ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc-2.0 export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc -export NVM_DIR="$XDG_DATA_HOME/nvm" +export NVM_DIR="$XDG_DATA_HOME"/nvm export W3M_DIR="$XDG_STATE_HOME"/w3m export GOPATH="$XDG_DATA_HOME"/go export GOMODCACHE="$XDG_CACHE_HOME"/go/mod export TNS_ADMIN=/opt/oracle/instantclient_21_9/network/admin +export WGETRC="$XDG_CONFIG_HOME"/wgetrc +export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages +export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel +export MYSQL_HISTFILE="$XDG_DATA_HOME"/mysql_history +export RANDFILE="$XDG_CACHE_HOME"/rnd export XINITRC="$XDG_CONFIG_HOME/x11"/xinitrc export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority -- cgit v1.2.3 From 320ed288a5d68c22e0d3d399df77f31f123ea88c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:58:30 +0200 Subject: [nvim] added one buffer keymap --- config/essentials/nvim/lua/user/remap.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/essentials/nvim/lua/user/remap.lua b/config/essentials/nvim/lua/user/remap.lua index 7c6d87f..e59b81a 100644 --- a/config/essentials/nvim/lua/user/remap.lua +++ b/config/essentials/nvim/lua/user/remap.lua @@ -15,6 +15,8 @@ vim.keymap.set("i", "\\\\", "\\", { noremap = true }) vim.keymap.set("n", "gb", "buffers:buffer", { noremap = true }) vim.keymap.set("n", "q", "q!", { noremap = true }) vim.keymap.set("n", "Q", "qa!", { noremap = true }) +-- close all except focused buffer +vim.keymap.set("n", "1", "%bd|e#", { noremap = true }) -- Windows vim.keymap.set("n", "", "h", { noremap = true }) -- cgit v1.2.3 From 5fa4e064dc48450f371a8f4ef42f58e5a437c60f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Aug 2023 14:58:44 +0200 Subject: [ytclipo] changed resolution and template --- bin/common/ytclipo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 263f1b3..7e7b9cc 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -19,8 +19,8 @@ notify-send "ytclipo" "downloading $inp" yt-dlp "$inp" \ --restrict-filenames \ -f "b" \ - -S "res:720" \ + -S "res:1080" \ -P "$HOME/vids/youtube/" \ - -o "%(title)s.%(ext)s" + -o "%(channel)s - %(title)s.%(ext)s" notify-send "ytclipo" "ytclipo
finished downloading." echo "$inp" >> /tmp/ytclipo_history -- cgit v1.2.3 From cb110575144beb4125fd1d8204c8204e6bca280f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 7 Aug 2023 18:59:08 +0200 Subject: [goo] added option to give search query as second paramater I noticed by mistake sometimes I would type the query already. --- bin/common/goo | 9 +++++++-- config/essentials/zsh/functions.zsh | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/common/goo b/bin/common/goo index cfd03ec..2a5faad 100755 --- a/bin/common/goo +++ b/bin/common/goo @@ -15,9 +15,14 @@ VisualParadigm intellij arduino15" +if [ -n "$2" ] +then + [ -d "$2" ] && dest="$2" || opt="-q $2" +fi + for dir in $exclude; do dirs="$dirs -name \"$dir\" -o " done -cmd="find ${2:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" +cmd="find ${dest:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" -eval "$cmd" 2>/dev/null +eval "$cmd" 2>/dev/null | fzf $opt diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 671e6fb..053ce8e 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -39,9 +39,9 @@ nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit } ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } # googoo aliases -ff () { goo f "$1" | fzf } -fd () { goo d "$1" | fzf } -fdf () { goo f "$1" | fzf | xargs -I {} dirname "{}" } +ff () { goo f "$1" } +fd () { goo d "$1" } +fdf () { goo f "$1" | xargs -I {} dirname "{}" } o () { f="$(ff $1)" -- cgit v1.2.3 From 557b4e5d5bb85919c6dc0f87d27d7df07616f7fd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 7 Aug 2023 19:00:29 +0200 Subject: [aliases] updated the gdate alias --- config/essentials/zsh/aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 3df6234..b1d4a50 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -181,7 +181,7 @@ alias wf='doas wipefs -a' 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 gdate='date +%y_%m_%d-%T' alias tpid='tail -f /dev/null --pid' alias vbm='vboxmanage' -- cgit v1.2.3 From ffb6d1aaedaa3882e356d7d58a5734b6f6a653e7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 11 Aug 2023 18:21:47 +0200 Subject: [mpass] added notification --- bin/menuscripts/mpass | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index a50f0fb..8153dc6 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -20,6 +20,8 @@ done test -z "$file" && exit 1 pass show -c "$file" && if [ -n "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null -then - cliphist list | head -n 1 | cliphist delete -fi + then + cliphist list | head -n 1 | cliphist delete + fi || + exit 1 +notify-send "mpass" "copied $choice" -- cgit v1.2.3 From cdf1c6fba147580ce7226a4547d00a7a2142d232 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 11 Aug 2023 18:22:11 +0200 Subject: [dunstrc] set frame width to 0 --- config/X/dunst/dunstrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index 3ab0f3d..28fa68e 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -87,7 +87,7 @@ # Defines width in pixels of frame around the notification window. # Set to 0 to disable. - frame_width = 1 + frame_width = 0 # Defines color of the frame around the notification window. frame_color = "#969B95" -- cgit v1.2.3 From 124910d7e8c08f358b00d7ef7ff7fd83fc77d349 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 11 Aug 2023 18:22:38 +0200 Subject: [mpv] set screenshots directory --- config/common/mpv/mpv.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/common/mpv/mpv.conf b/config/common/mpv/mpv.conf index 4f5e251..7d9d1fe 100755 --- a/config/common/mpv/mpv.conf +++ b/config/common/mpv/mpv.conf @@ -26,3 +26,5 @@ force-seekable=yes slang=eng, en, english alang=jpn + +screenshot-directory=~/pics/screenshots -- cgit v1.2.3 From 2e0971fa8ab391849287bf9b8e76676115886539 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 11 Aug 2023 18:22:52 +0200 Subject: [ncmpcpp] changed bindings for home and end --- config/common/ncmpcpp/bindings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/common/ncmpcpp/bindings b/config/common/ncmpcpp/bindings index d2a5eb6..b7921e7 100644 --- a/config/common/ncmpcpp/bindings +++ b/config/common/ncmpcpp/bindings @@ -194,9 +194,9 @@ def_key "p" def_key "P" play -def_key "H" +def_key "g" move_home -def_key "L" +def_key "G" move_end def_key "ctrl-u" -- cgit v1.2.3 From 229b7702133999850aa37803a26a2f14282094db Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 11 Aug 2023 18:23:12 +0200 Subject: [tridactylrc] added modeindactor settings --- config/extra/tridactyl/tridactylrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/extra/tridactyl/tridactylrc b/config/extra/tridactyl/tridactylrc index 2de07b4..f7e1935 100644 --- a/config/extra/tridactyl/tridactylrc +++ b/config/extra/tridactyl/tridactylrc @@ -60,3 +60,11 @@ bind gpdy tabopen http://debuc.com:9010 " For syntax highlighting see https://github.com/tridactyl/vim-tridactyl " vim: set filetype=tridactyl + +modeindicatormodes.normal true +set modeindicatormodes.insert true +set modeindicatormodes.input true +set modeindicatormodes.ignore false +set modeindicatormodes.ex true +set modeindicatormodes.hint true +set modeindicatormodes.visual true -- cgit v1.2.3 From 8a2272e0f5f4b43f7ba3fa11f5887880299573b3 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 01:53:23 +0200 Subject: [mpass] added notify function --- bin/guiscripts/keyadd | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 1df8896..4613b8f 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -22,6 +22,13 @@ die () echo "$1" >&2 } +notify () +{ + notify-send -t 1000 "keyadd" "$1" + die "$1" +} + + SSHFOLDER="$HOME/.ssh" if test -z "${key:=$1}" @@ -42,17 +49,19 @@ die "HOST: $HOST" if [ "$1" = "-d" ] then - ssh-add -d - < "$SSHFOLDER"/$key.pub && - notify-send "keyadd" "deleted $key" || - notify-send "keyadd" "could not delete." -elif ! ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/$key)" + if ssh-add -d - < "$SSHFOLDER"/"$key".pub + then + notify "deleted $key" + else + notify "could not delete." + fi +# check if key is already added +elif ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/"$key")" then - die "adding: $key" + notify "key already added." +else export PASSWORD="keys/$HOST/ssh/$key" export SSH_ASKPASS="$0" - ssh-add - < "$SSHFOLDER"/$key && - notify-send "keyadd" "added $key" -else - die "key already added." - notify-send "keyadd" "key already added." + ssh-add - < "$SSHFOLDER"/"$key" && + notify "added $key" fi -- cgit v1.2.3 From 396e509716ae5b334f4d588a9b425476770577ea Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 01:57:30 +0200 Subject: [mpass] added test for connecting to agent --- bin/guiscripts/keyadd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index 4613b8f..e0a1661 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -31,7 +31,15 @@ notify () SSHFOLDER="$HOME/.ssh" -if test -z "${key:=$1}" +# Test if can connect to ssh-agent +ssh-add -l > /dev/null 2>&1 +if [ $? -gt 1 ] # ignore if there are no identities +then + notify "could not connect to agent." + exit 1 +fi + +if [ -z "${key:=$1}" ] then key="$(find "$SSHFOLDER" -iname "*.pub" | sed "s,$SSHFOLDER/,," | # Clean -- cgit v1.2.3 From 6738d30a91961fa37f99ab16df4c1f58937748c5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 02:01:02 +0200 Subject: [mpass] cleanup of messages and commands --- bin/guiscripts/keyadd | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index e0a1661..cb81efe 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -35,7 +35,7 @@ SSHFOLDER="$HOME/.ssh" ssh-add -l > /dev/null 2>&1 if [ $? -gt 1 ] # ignore if there are no identities then - notify "could not connect to agent." + notify "Could not connect to agent." exit 1 fi @@ -50,26 +50,26 @@ else fi die "key: $key" -test ! -f "$SSHFOLDER/$key" && exit 1 +[ ! -f "$SSHFOLDER/$key" ] && exit 1 -HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') -die "HOST: $HOST" +HOST=$(hostnamectl hostname) +die "host: $HOST" if [ "$1" = "-d" ] then - if ssh-add -d - < "$SSHFOLDER"/"$key".pub + if ssh-add -q -d - < "$SSHFOLDER"/"$key".pub 2> /dev/null then - notify "deleted $key" + notify "Deleted $key" else - notify "could not delete." + notify "Could not delete." fi # check if key is already added elif ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/"$key")" then - notify "key already added." + notify "Key already added." else export PASSWORD="keys/$HOST/ssh/$key" export SSH_ASKPASS="$0" - ssh-add - < "$SSHFOLDER"/"$key" && - notify "added $key" + ssh-add -q - < "$SSHFOLDER"/"$key" && + notify "Added $key." fi -- cgit v1.2.3 From f7e3dc17c1692c8099ca4b80814db49d9da2c74c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 02:01:02 +0200 Subject: [mpass] cleanup of messages and commands --- bin/guiscripts/keyadd | 20 ++++++++++---------- bin/menuscripts/mpass | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bin/guiscripts/keyadd b/bin/guiscripts/keyadd index e0a1661..cb81efe 100755 --- a/bin/guiscripts/keyadd +++ b/bin/guiscripts/keyadd @@ -35,7 +35,7 @@ SSHFOLDER="$HOME/.ssh" ssh-add -l > /dev/null 2>&1 if [ $? -gt 1 ] # ignore if there are no identities then - notify "could not connect to agent." + notify "Could not connect to agent." exit 1 fi @@ -50,26 +50,26 @@ else fi die "key: $key" -test ! -f "$SSHFOLDER/$key" && exit 1 +[ ! -f "$SSHFOLDER/$key" ] && exit 1 -HOST=$(hostnamectl hostname | sed 's/forlure/fl/;s/montecristo/mc/') -die "HOST: $HOST" +HOST=$(hostnamectl hostname) +die "host: $HOST" if [ "$1" = "-d" ] then - if ssh-add -d - < "$SSHFOLDER"/"$key".pub + if ssh-add -q -d - < "$SSHFOLDER"/"$key".pub 2> /dev/null then - notify "deleted $key" + notify "Deleted $key" else - notify "could not delete." + notify "Could not delete." fi # check if key is already added elif ssh-add -l | grep -q "$(ssh-keygen -lf "$SSHFOLDER"/"$key")" then - notify "key already added." + notify "Key already added." else export PASSWORD="keys/$HOST/ssh/$key" export SSH_ASKPASS="$0" - ssh-add - < "$SSHFOLDER"/"$key" && - notify "added $key" + ssh-add -q - < "$SSHFOLDER"/"$key" && + notify "Added $key." fi diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 8153dc6..0117b97 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -16,12 +16,12 @@ do [ "$choice" ] || break file="$file/$choice" done - test -z "$file" && exit 1 -pass show -c "$file" && - if [ -n "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null - then - cliphist list | head -n 1 | cliphist delete - fi || - exit 1 -notify-send "mpass" "copied $choice" + +pass show -c "$file" +test $? -gt 0 && exit 1 + +[ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running + cliphist list | head -n 1 | cliphist delete + +notify-send -t 1000 "mpass" "copied $choice" -- cgit v1.2.3 From 1453494eac13636b5524c9b21843c9b21a761e35 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 02:04:37 +0200 Subject: [dunstrc] align right and set misc options added offset to the right as well, decreased the line height, increased the gap size and increased the font size. Set the indicator option to true because this is more clear. Also set the stack duplicates to true. --- config/X/dunst/dunstrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index 28fa68e..6127474 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -30,10 +30,10 @@ height = 80 # Position the notification in the top right corner - origin = top-center + origin = right # Offset from the origin - offset = 0x10 + offset = 10x10 # Scale factor. It is auto-detected if value is 0. scale = 0 @@ -96,7 +96,7 @@ # If value is greater than 0, separator_height will be ignored and a border # of size frame_width will be drawn around each notification instead. # Click events on gaps do not currently propagate to applications below. - gap_size = 2 + gap_size = 4 # Define a color for the separator. # possible values are: @@ -118,11 +118,11 @@ ### Text ### - font = mononoki nerd font mono 10 + font = mononoki nerd font mono 11 # The spacing between lines. If the height is smaller than the # font height, it will get raised to the font height. - line_height = 11 + line_height = 7 # Possible values are: # full: Allow a small subset of html markup in notifications: @@ -181,13 +181,13 @@ ignore_newline = no # Stack together notifications with the same content - stack_duplicates = false + stack_duplicates = true # Hide the count of stacked notifications with the same content hide_duplicate_count = false # Display indicators for URLs (U) and actions (A). - show_indicators = no + show_indicators = yes ### Icons ### -- cgit v1.2.3 From 5eed72797eaf9ec0d0e43b24add8b266b1999b08 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 02:07:26 +0200 Subject: [waybar] removed custom workspaces format --- config/hyprland/waybar/config.jsonc | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index 86938db..2ab4837 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -3,20 +3,6 @@ "modules-left": ["battery", "hyprland/workspaces", "mpd"], "modules-center": ["clock"], "modules-right": ["custom/wireguard", "network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], - "hyprland/workspaces": { - "format": "{icon}", - "format-icons": { - "1": "I", - "2": "II", - "3": "III", - "4": "IV", - "5": "V", - "6": "VI", - "7": "VII", - "8": "VIII", - "9": "IX", - }, - }, "mpd": { "tooltip": false, "format": "{artist} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})", -- cgit v1.2.3 From 818dabae65e67cb52f11623ab1e76ad4c85c19e1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 02:08:33 +0200 Subject: added confirm, trl and wipe scripts! --- bin/extra/confirm | 12 ++++++ bin/extra/trl | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/extra/wipe | 13 ++++++ 3 files changed, 140 insertions(+) create mode 100755 bin/extra/confirm create mode 100755 bin/extra/trl create mode 100755 bin/extra/wipe diff --git a/bin/extra/confirm b/bin/extra/confirm new file mode 100755 index 0000000..116b468 --- /dev/null +++ b/bin/extra/confirm @@ -0,0 +1,12 @@ +#!/bin/sh + +read_char () +{ + old_stty_cfg=$(stty -g 2> /dev/null) + stty raw -echo 2> /dev/null + dd ibs=1 count=1 2> /dev/null + stty $old_stty_cfg 2> /dev/null +} + +>&2 printf "$1 " +read_char | grep -q "[yY]" diff --git a/bin/extra/trl b/bin/extra/trl new file mode 100755 index 0000000..ee42040 --- /dev/null +++ b/bin/extra/trl @@ -0,0 +1,115 @@ +#!/bin/sh + +# prints on stderr +log () { >&2 echo "$@"; } + +help () +{ + >&2 cat <<-EOF + h help + l clear output + q quit + + i invert languages + p select primary + s select secondary + EOF +} +# returns available languages +languages () { + cat <<-EOF + arabic + dutch + french + german + polish + english + portuguese + spanish + romanian + hebrew + swedish + italian + turkish + japanese + ukrainian + korean + chinese + czech + hungarian + danish + persian + greek + slovak + hindi + thai + EOF +} + +# translates a word +# $1: primary language +# $2: secondary language +# $3: word to translate +translate () +{ + curl -s "https://context.reverso.net/translation/$1-$2/$3" \ + --compressed \ + -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0' \ + -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \ + -H 'Accept-Language: en-US,en;q=0.5' \ + -H 'Accept-Encoding: gzip, deflate, br' | + pup 'a.link_highlighted em text{}' | + sed 's/.*/\L&/' | + sort | uniq | sed 's/.*/ &/' +} + +# prints the current language +current_language () +{ + log " current: $primary-$secondary" +} + +select_language () +{ + tmp="$(languages | fzf)" + [ "$tmp" ] && [ "$tmp" != "$primary" ] && [ "$tmp" != "$secondary" ] && + eval "$1=\"$tmp\"" + current_language +} + +# set default languages +primary=french +secondary=dutch + + +main () +{ + current_language + while true + do + log -n '>' + read -r prompt + test $? -eq 1 && exit 0 # quit on ctrl-d + case "$prompt" in + q) break ;; + l) clear ;; + i) tmp="$secondary"; secondary="$primary"; primary="$tmp" + current_language ;; + h) help ;; # TODO + p) select_language primary ;; + s) select_language secondary ;; + '') ;; + *) translate "$primary" "$secondary" "$prompt" ;; + esac + done +} + + +if [ "$1" = "--help" ] || [ "$1" = "-h" ] +then + log "usage: trl" + help + exit +fi + +main diff --git a/bin/extra/wipe b/bin/extra/wipe new file mode 100755 index 0000000..ec2abe9 --- /dev/null +++ b/bin/extra/wipe @@ -0,0 +1,13 @@ +#!/bin/sh +[ 0 -eq "$#" ] && >&2 echo 'usage: wipe ' && exit 1 +[ ! -f "$1" ] && [ ! -d "$1" ] && >&2 echo "'$1' not found." && exit 1 + +confirm "sure?" || exit 1 +>&2 printf "\n" + +find "$1" -type f -print0 | + xargs -0I{} shred -uz "{}" && + [ -d "$1" ] && # remove leftovver empty directories + find "$1" | tac | tr '\n' '\0' | + xargs -0I{} rm -d "{}" && + >&2 echo "wiped." -- cgit v1.2.3 From b3f42fec8739d1d23ec6d64ff35c9db022c5adca Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:15:52 +0200 Subject: [googoo] removed functions and updated behaviour removed functions that where unneed as they were only called once, changed behaviour to not implement fzf in goo but in the functions itself, this makes goo easier to implement in other commands. Also ported over the funcitonality of setting the query with the first argument --- bin/common/goo | 7 +------ config/essentials/zsh/functions.zsh | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/bin/common/goo b/bin/common/goo index 2a5faad..a56cbaf 100755 --- a/bin/common/goo +++ b/bin/common/goo @@ -15,14 +15,9 @@ VisualParadigm intellij arduino15" -if [ -n "$2" ] -then - [ -d "$2" ] && dest="$2" || opt="-q $2" -fi - for dir in $exclude; do dirs="$dirs -name \"$dir\" -o " done cmd="find ${dest:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" -eval "$cmd" 2>/dev/null | fzf $opt +eval "$cmd" 2>/dev/null diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 053ce8e..c4999db 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -39,23 +39,30 @@ nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit } ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } # googoo aliases -ff () { goo f "$1" } -fd () { goo d "$1" } -fdf () { goo f "$1" | xargs -I {} dirname "{}" } +_googoo_fzf_opt () +{ + if [ "$1" ] + then + [ -d "$1" ] && dest="$1" || opt="-q $1" + fi +} o () { - f="$(ff $1)" + _googoo_fzf_opt "$1" + f="$(goo f "dest" | fzf $opt)" test "$1" && shift - test -n "$f" && $EDITOR $@ "$f" + test -f "$f" && $EDITOR $@ "$f" } go () { - d="$(fd $1)" + _googoo_fzf_opt "$1" + d="$(goo d "$dest" | fzf $opt)" test -d "$d" && cd "$d" } ogo () { - d="$(fdf $1)" + _googoo_fzf_opt "$1" + d="$(dirname "$(goo f "$dest")" | fzf $opt)" test -d "$d" && cd "$d" } -- cgit v1.2.3 From 93d3613febfb869d5f30d74c25b2fbc0b20170ca Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:17:48 +0200 Subject: [aliases] added diff alias --- config/essentials/zsh/aliases.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index b1d4a50..9849b93 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -128,6 +128,7 @@ alias xrandr-default='xrandr --auto --output VGA-1 --mode 1920x1080 --left-of HD alias d='du -d 0 -h' alias dud='du .* * -d 0 -h 2>/dev/null | sort -h' alias df='df -h' +alias diff='diff -u --color' alias shred='shred -uz' alias lsblk='lsblk -o name,type,fsused,fsavail,size,fstype,label,mountpoint' alias floc='doas find / -type "f" 2> /dev/null | grep' -- cgit v1.2.3 From 02a5c5ddf55986666335e2d5a16c4635f0b6ca80 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:17:59 +0200 Subject: [functions] use grouping in calc, added psgrep --- config/essentials/zsh/functions.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index c4999db..3c5f11f 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -76,7 +76,13 @@ ipc () fi } -calc () { echo "$@" | bc -l } +calc () { echo "$@" | bc -l | numfmt --grouping; } + +psgrep () +{ + [ $# -eq 0 ] && return 1 + pgrep "$@" | xargs ps +} unique () { local f -- cgit v1.2.3 From d3311ada0ee90b20c6f4cf7d7ef2888c27dc3b87 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:18:22 +0200 Subject: [startw] start a terminal on startup --- config/hyprland/hypr/startup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/config/hyprland/hypr/startup.sh b/config/hyprland/hypr/startup.sh index 83fefe4..6d5957f 100755 --- a/config/hyprland/hypr/startup.sh +++ b/config/hyprland/hypr/startup.sh @@ -5,3 +5,4 @@ gammastep & wl-paste --watch cliphist store & keyadd id_rsa & swayidle 300 locker & +$TERMINAL & -- cgit v1.2.3 From 949d2f7025cbfe4db316a3fc13199ac5c82d4b5b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:18:46 +0200 Subject: [zshrc] use exec and keychain identity Add keychain identity on startup, this is more useful because with suspend I will only type the password once per day. Also it makes adding with keyadd faster. Also use exec to have less processes, don't know if it works though... --- bin/guiscripts/startw | 1 + config/essentials/zsh/.zshrc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/guiscripts/startw b/bin/guiscripts/startw index 768f401..9b35556 100755 --- a/bin/guiscripts/startw +++ b/bin/guiscripts/startw @@ -1,5 +1,6 @@ #!/bin/sh eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D 2> /dev/null)" Hyprland diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index d8675d4..0665533 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -5,9 +5,9 @@ then clear if [ "/dev/tty1" = "$TTY" ] then - startw > /dev/null 2>&1 + exec startw > /dev/null 2>&1 else - startx > /dev/null 2>&1 + exec startx > /dev/null 2>&1 fi exit fi -- cgit v1.2.3 From ab67292b4ce728aea904799197e761002832f8c5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 20:37:39 +0200 Subject: [mpass] cleanup of error handling use || instead of test $? -gt 0, because they do the same thing. --- bin/menuscripts/mpass | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 0117b97..4ecd4bc 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -18,10 +18,8 @@ do done test -z "$file" && exit 1 -pass show -c "$file" -test $? -gt 0 && exit 1 +pass show -c "$file" || exit 1 +notify-send -t 1000 "mpass" "copied $choice" [ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running cliphist list | head -n 1 | cliphist delete - -notify-send -t 1000 "mpass" "copied $choice" -- cgit v1.2.3 From d86de5019e1ab222118ac85201141f1b7b5bc0b0 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 23:21:02 +0200 Subject: [waybar] added back window title --- config/hyprland/waybar/config.jsonc | 2 +- config/hyprland/waybar/schemes/base16.css | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index 2ab4837..e1c79b6 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -1,6 +1,6 @@ { "layer": "top", - "modules-left": ["battery", "hyprland/workspaces", "mpd"], + "modules-left": ["battery", "hyprland/workspaces", "mpd", "hyprland/window"], "modules-center": ["clock"], "modules-right": ["custom/wireguard", "network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], "mpd": { diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index 589cc12..61378fd 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -38,7 +38,6 @@ window#waybar.PCSX2 #window { } #mpd, #battery, -#window, #custom-wireguard, #network, #pulseaudio, #temperature, #cpu, #custom-memory { margin-left: 8px; padding-left: 16px; @@ -47,7 +46,6 @@ window#waybar.PCSX2 #window { } #workspaces, #mpd, #battery, #clock, -#window, #custom-wireguard, #network, #pulseaudio, #temperature, #cpu, #custom-memory, #tray { border: solid @background 2px; margin-top: 4px; @@ -108,8 +106,8 @@ window#waybar.PCSX2 #window { } #window { - color: @background; - background: @color4; + padding-left: 16px; + color: @color4; } #custom-wireguard { -- cgit v1.2.3 From 35ceb3624eff6cb65905dd9589575a606ef2d254 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 23:21:28 +0200 Subject: [waybar] added format for mpd --- config/hyprland/waybar/config.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index 2ab4837..3a38ca4 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -7,8 +7,8 @@ "tooltip": false, "format": "{artist} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})", "artist-len": 24, - "format-disconnected": "", - "format-stopped": "", + "format-disconnected": "s", + "format-stopped": "s", "state-icons": { "playing": "", "paused": "", -- cgit v1.2.3 From 4fbb921cd8a9da0135e0ddf54da898e080cc8c7e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 14 Aug 2023 11:50:34 +0200 Subject: [aliases] added ufwd --- config/essentials/zsh/aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 3df6234..3884582 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -40,7 +40,7 @@ fi if grep -qi "debian\|ubuntu" /etc/os-release 2> /dev/null then alias aptup='apt update && apt upgrade -y' - alias ufwd='echo y | ufw delete "$(ufw status numbered | tail -n +5 | fzf | cut -f2 -d'\''['\'' | cut -f1 -d'\'']'\'')"' + alias ufwd='echo y | ufw delete "$(ufw status numbered | tail -n +5 | fzf | cut -f2 -d'\''['\'' | cut -f1 -d'\'']'\'')" > /dev/null 2>&1 && >&2 echo "deleted."' fi # Programs -- cgit v1.2.3 From 22d2c57240e65df482e30fbe684844c6b173aca2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 14 Aug 2023 12:37:09 +0200 Subject: [saf] added load function --- bin/common/saf | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/common/saf b/bin/common/saf index 0c6fbc4..dcc43d5 100755 --- a/bin/common/saf +++ b/bin/common/saf @@ -7,6 +7,15 @@ green="$(printf '\033[32m')" blue="$(printf '\033[34m')" reset="$(printf '\033[0m')" +load () +{ + for time in $(uptime | cut -f3- -d',' | cut -f2 -d':' | tr ',' ' ') + do + percent="$(echo "$time*100/$(nproc)" | bc)" + echo "${percent:-0}%" + done | xargs +} + for file in /etc/os-release /usr/lib/os-release do [ -f "$file" ] && . "$file" && break @@ -19,6 +28,6 @@ SHELL="$(basename "$SHELL")" cat < Date: Mon, 14 Aug 2023 12:37:22 +0200 Subject: [saf] removed unused green color --- bin/common/saf | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/common/saf b/bin/common/saf index dcc43d5..9e31c68 100755 --- a/bin/common/saf +++ b/bin/common/saf @@ -3,7 +3,6 @@ # Simple Ass Fetch by futxlii red="$(printf '\033[31m')" -green="$(printf '\033[32m')" blue="$(printf '\033[34m')" reset="$(printf '\033[0m')" -- cgit v1.2.3 From 0b8685b836fb3cc034857438bf87076fa39af1a1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 14 Aug 2023 12:50:14 +0200 Subject: [saf] remove bc dependency --- bin/common/saf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/common/saf b/bin/common/saf index 9e31c68..2936346 100755 --- a/bin/common/saf +++ b/bin/common/saf @@ -8,10 +8,11 @@ reset="$(printf '\033[0m')" load () { - for time in $(uptime | cut -f3- -d',' | cut -f2 -d':' | tr ',' ' ') - do - percent="$(echo "$time*100/$(nproc)" | bc)" - echo "${percent:-0}%" + # take everything after 'load average: ' then remove '0.' or '.' or ',' + # from output, this multiplies by hundred, so we can divide an integer + # instead of a fraction (which dash can't do) + for time in $(uptime | sed -e 's/^.*load average://' -e 's/0\?\.\|,//g') + do printf "%s%%\n" "$((time/$(nproc)))" done | xargs } -- cgit v1.2.3 From e1893b1b31503adaa2c2484b57a5d7a4a5d0516c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 14 Aug 2023 21:37:08 +0200 Subject: [googoo] fixed destination argument not working --- bin/common/goo | 2 +- config/essentials/zsh/functions.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/common/goo b/bin/common/goo index a56cbaf..cfd03ec 100755 --- a/bin/common/goo +++ b/bin/common/goo @@ -18,6 +18,6 @@ arduino15" for dir in $exclude; do dirs="$dirs -name \"$dir\" -o " done -cmd="find ${dest:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" +cmd="find ${2:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" eval "$cmd" 2>/dev/null diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 3c5f11f..e0eeb45 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -49,7 +49,7 @@ _googoo_fzf_opt () o () { _googoo_fzf_opt "$1" - f="$(goo f "dest" | fzf $opt)" + f="$(goo f "$dest" | fzf $opt)" test "$1" && shift test -f "$f" && $EDITOR $@ "$f" } -- cgit v1.2.3 From 85dbd4176e214696b0ed0892f7fe6c0bce2bc828 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 12:04:14 +0200 Subject: [luasnip.lua] renamed die to log and logn log and logn seem like better names, also because now we use printf we make an apart logn function that adds a newline on the end. --- config/essentials/nvim/after/plugin/luasnip.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index 7ee274f..5b45d11 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -155,18 +155,20 @@ ls.add_snippets("sh", { stty \$old_stty_cfg } ]], {}), - parse("fdie", + parse("flogn", [[ - die () + logn () { - echo "\$@" >&2 + >&2 printf '%s\n' "\$@" } ]], {}), - s("die", fmt( + parse("flog", [[ - die "{}: {}"{} - ]], - { c(1, {t "I", t "E", t "W"}), i(2), i(0) })), + log () + { + >&2 printf '%s' "\$@" + } + ]], {}), s("inp", fmt( [[ test -z "${{{}:=$1}}" && -- cgit v1.2.3 From edf8bc8432bb17854b5ef5667864ed58550956d1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 12:06:44 +0200 Subject: [functions.zsh] changed function name format --- config/essentials/zsh/functions.zsh | 60 ++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index e0eeb45..dee883f 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -1,6 +1,6 @@ #!/bin/zsh -die () +die() { echo "$@" >&2 } @@ -39,34 +39,34 @@ nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit } ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } # googoo aliases -_googoo_fzf_opt () +_googoo_fzf_opt() { if [ "$1" ] then [ -d "$1" ] && dest="$1" || opt="-q $1" fi } -o () +o() { _googoo_fzf_opt "$1" f="$(goo f "$dest" | fzf $opt)" test "$1" && shift test -f "$f" && $EDITOR $@ "$f" } -go () +go() { _googoo_fzf_opt "$1" d="$(goo d "$dest" | fzf $opt)" test -d "$d" && cd "$d" } -ogo () +ogo() { _googoo_fzf_opt "$1" d="$(dirname "$(goo f "$dest")" | fzf $opt)" test -d "$d" && cd "$d" } -ipc () +ipc() { if [[ "$(ip link show eno1 | awk -F, 'NR=1 {print $3}')" == "UP" ]] then @@ -76,22 +76,20 @@ ipc () fi } -calc () { echo "$@" | bc -l | numfmt --grouping; } - -psgrep () +psgrep() { [ $# -eq 0 ] && return 1 pgrep "$@" | xargs ps } -unique () { +unique() { local f f="$(mktemp)" awk '!x[$0]++' "$1" > "$f" mv "$f" "$1" } -clip () { +clip() { if [ "$WAYLAND_DISPLAY" ] then echo -n "$@" | wl-copy @@ -100,7 +98,7 @@ clip () { fi } -unzipp () { +unzipp() { file=$1 shift unzip $file $@ || exit 1 @@ -108,18 +106,18 @@ unzipp () { } # fix long waiting time -__git_files () { +__git_files() { _wanted files expl 'local files' _files } -esc () { +esc() { $EDITOR "$(which $1)" } -delfile () { +delfile() { curl "${2:-https://upfast.cronyakatsuki.xyz/delete/$1}" } -upfile () { +upfile() { curl -F "file=@\"$1\"" ${2:-https://upfast.cronyakatsuki.xyz} } @@ -177,7 +175,7 @@ function git_develop_branch() { } # gpg backup -gpg_backup () +gpg_backup() { gpg --export-secret-keys --armor > private.asc gpg --export --armor > public.asc @@ -186,7 +184,7 @@ gpg_backup () shred -uz {public,private,trust}.asc } -gpg_import () +gpg_import() { tar xf $1 shred -uz $1 @@ -196,29 +194,29 @@ gpg_import () shred -uz {public,private,trust}.asc } -ngenable () +ngenable() { ln -sf /etc/nginx/sites-available/$1 /etc/nginx/sites-enabled/ } -vbsr () +vbsr() { vboxmanage snapshot "$1" restore "$2" && vboxmanage startvm "$1" || vboxmanage controlvm "$1" poweroff } -vbsrr () +vbsrr() { vbsr "$1" "$2" sleep 3 vbsr "$1" "$2" } -vbst () +vbst() { vboxmanage snapshot "$1" take "$2" } -pacsize () +pacsize() { if test -n "$1"; then packages="$@" @@ -232,7 +230,7 @@ pacsize () expac '%m %n' - | numfmt --to=iec-i --suffix=B --format="%.2f" } -pkbs () +pkbs() { pkgfile -b "$1" | tee /dev/stderr | doas pacman -S - } @@ -247,7 +245,7 @@ mime-default () die "Done." } -addedkeys () { +addedkeys() { find ~/.ssh -iname "*.pub" | while read key do local fingerprint="$(ssh-keygen -lf "$key" 2>/dev/null)" @@ -258,7 +256,7 @@ addedkeys () { done | sed "s,$HOME/.ssh/,," } -fpass () { +fpass() { find $HOME/.password-store -type f -not -path ".git" | grep "\.gpg$" | sed "s,$HOME/.password-store/,,;s,\.gpg$,," | @@ -266,22 +264,22 @@ fpass () { xargs pass show -c } -oclip () +oclip() { printf "\033]52;c;$(echo -n "$@" | base64)\a" } -sms () +sms() { ssh phone sendmsg "$1" "'$2'" } -trcp () +trcp() { scp "$1" db:/media/basilisk/downloads/transmission/torrents/ } -muttmail () +muttmail() { die -n "email set: " ls $HOME/.config/mutt/configs | @@ -292,7 +290,7 @@ muttmail () read && mutt } -resize () +resize() { test $# -lt 2 && printf "usage: %s [out]\n" "$0" >&2 && -- cgit v1.2.3 From dd75534e1878d7934d0a402a70e20d24226fcd8e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 12:07:02 +0200 Subject: [functions.zsh] renamed die to log --- config/essentials/zsh/functions.zsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index dee883f..0d4b8a5 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -1,9 +1,7 @@ #!/bin/zsh -die() -{ - echo "$@" >&2 -} +log() { >&2 printf '%s' "$@"; } +logn() { >&2 printf '%s\n' "$@"; } awnk() { awk "{print \$$1}" -- cgit v1.2.3 From 2321b913f89f2bc678c8931db05e0eb5898d7191 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 12:09:07 +0200 Subject: [functions.zsh] added ginit function to init a dir on db remote --- config/essentials/zsh/functions.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 0d4b8a5..6c2437f 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -138,16 +138,24 @@ sgd () { unset d } -# Git functions +ginit() +{ + [ "$1" ] || return 1 + ssh db /var/git/initdir.sh "$1" + git remote add origin git@db:"$1.git" + git push --set-upstream origin $(git_current_branch) +} + # Returns current branch -function git_current_branch() +git_current_branch() { command git rev-parse --git-dir &>/dev/null || return git branch --show-current } # Check if main exists and use instead of master -function git_main_branch() { +git_main_branch() +{ command git rev-parse --git-dir &>/dev/null || return local ref for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default}; do -- cgit v1.2.3 From 0d01d76680e90a8b87e98426800147639dd2fc75 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 15:07:37 +0200 Subject: [dunstrc] hide indicators --- config/X/dunst/dunstrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index 6127474..0c4eebc 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -187,7 +187,7 @@ hide_duplicate_count = false # Display indicators for URLs (U) and actions (A). - show_indicators = yes + show_indicators = no ### Icons ### -- cgit v1.2.3 From 15d604ed1c9e0b74663ab4271a9ce17ded2889e2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 15:07:48 +0200 Subject: [aliases.zsh] added calc alias --- config/essentials/zsh/aliases.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 9849b93..4185999 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -15,6 +15,8 @@ then alias ogo/='ogo /' alias ogo/s='ogo /srv' + alias calc='bc <<<' + if [ "$WAYLAND_DISPLAY" ] then alias -g clipp='wl-copy -n' @@ -145,7 +147,6 @@ alias mdbwa='mariadb -h 10.3.50.5 -u padmin -pbulbizarre padmindb' # ssh alias sha='ssh-add' alias sshs='eval "$(ssh-agent)" && ssh-add' - alias vidlen='ffprobe -show_entries format=duration -v quiet -of csv="p=0" -i' alias whatsmyip='curl -s "ifconfig.co"' alias icognito='unset HISTFILE' -- cgit v1.2.3 From 0ea5e7a97b7ccba919d5c495e3e328b30cec9e03 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 15:08:46 +0200 Subject: [functions.zsh] removed unecessary tests --- config/essentials/zsh/functions.zsh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 6c2437f..eb776f0 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -54,14 +54,20 @@ o() go() { _googoo_fzf_opt "$1" - d="$(goo d "$dest" | fzf $opt)" - test -d "$d" && cd "$d" + cd "$(goo d "$dest" | fzf $opt)" } ogo() { _googoo_fzf_opt "$1" - d="$(dirname "$(goo f "$dest")" | fzf $opt)" - test -d "$d" && cd "$d" + cd "$(dirname "$(goo f "$dest")" | fzf $opt)" +} +dgo() +{ + cd "$(goo d | fzf --filter "$@" | head -n 1)" +} +open() +{ + $EDITOR "$(goo f | fzf --filter "$@" | head -n 1)" } ipc() -- cgit v1.2.3 From 63c16da0da3e9b0cdc3fb6f9cd3031dc2297a09c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 15:26:23 +0200 Subject: [.zshrc] refactored git_parse_remote use cut instead of sed to get the state of the remote, now you could use this command: git branch -v 2> /dev/null | sed '/^*/!d;s/^[^[]*\[\([^ ]*\).*$/\1/' but at this point, it feels more like intellectual masturbation. --- config/essentials/zsh/.zshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 0665533..769c805 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -121,13 +121,13 @@ RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(par setopt prompt_subst parse_git_remote() { - b="$(git branch -v 2> /dev/null | grep "^*" | sed 's/.\+\[\([^ ]\+\).*$/\1/')" + b="$(git branch -v 2>/dev/null | grep "^*" | cut -f2 -d'[' | cut -f1 -d' ')" if [ "$b" = "behind" ] then - echo -n "↓ " + printf "↓ " elif [ "$b" = "ahead" ] then - echo -n "↑ " + printf "↑ " fi } parse_git_branch() { -- cgit v1.2.3 From ece73a892806912ed45f875149065085690d64d4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 15 Aug 2023 16:40:43 +0200 Subject: [y2feed] added support for different links You can now supply a channel id, a link to a channel or a tag, this should work with yt-local and piped as well. --- bin/common/y2feed | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/common/y2feed b/bin/common/y2feed index e30bccf..b55d66b 100755 --- a/bin/common/y2feed +++ b/bin/common/y2feed @@ -1,5 +1,18 @@ #!/bin/sh -echo "url: $1" >&2 -curl -L -s "$1" | - pup 'link[title=RSS] attr{href}' | - tee /dev/stderr + +get_feed() +{ + link="$(curl -L -s "$1" | pup 'link[title=RSS] attr{href}' 2>/dev/null)" + [ "$link" ] && printf "%s\n" "$link" | tee /dev/stderr && exit +} + +[ "$1" ] || exit 1 + +# url is channel +get_feed "$1" + +part="$(echo "$1" | awk -F '/' '{print $NF}')" +# last part is channel id +get_feed "https://www.youtube.com/channel/$part" +# last part is channel tag +get_feed "https://www.youtube.com/$part" -- cgit v1.2.3 From 859053ceb17299311aa1f33ccdefd58a5302e4b7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 18 Aug 2023 16:08:01 +0200 Subject: [waybar] refactored --- config/hyprland/waybar/schemes/base16.css | 55 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index 61378fd..d0600b8 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -29,6 +29,12 @@ window#waybar.hidden { opacity: 0.2; } +tooltip { + background: @background; + color: @foreground; + border: 2px solid @color0; +} + window#waybar.termite #window, window#waybar.Firefox #window, window#waybar.Navigator #window, @@ -37,17 +43,21 @@ window#waybar.PCSX2 #window { background: @color7; } -#mpd, #battery, -#custom-wireguard, #network, #pulseaudio, #temperature, #cpu, #custom-memory { - margin-left: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 26px; +.modules-right * { + padding: 0 16px; +} + +.modules-right { + margin-right: 2px; +} +.modules-left { + margin-left: 2px; } #workspaces, #mpd, #battery, #clock, #custom-wireguard, #network, #pulseaudio, #temperature, #cpu, #custom-memory, #tray { - border: solid @background 2px; + border: solid @background; + border-width: 2px 2px 2px 0; margin-top: 4px; margin-bottom: 2px; transition: none; @@ -60,8 +70,7 @@ window#waybar.PCSX2 #window { } #workspaces { - margin-left: 12px; - border-radius: 26px; + border: solid @background 2px; background: @color3; } @@ -94,30 +103,27 @@ window#waybar.PCSX2 #window { } #clock { - margin-top: 4px; - margin-bottom: 2px; - margin-left: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 26px; + border: solid @color4 2px; + padding: 0 16px; color: @color3; background: @background; - border-color: @color4; } #window { - padding-left: 16px; - color: @color4; + margin-left: 16px; + padding: 0; + color: @color5; } #custom-wireguard { color: @color5; - border-color: @color8; + border: 2px solid @color8; background: @background; } #network { color: @background; + border-left: 2px solid @background; background: @color5; } @@ -137,20 +143,13 @@ window#waybar.PCSX2 #window { } #custom-memory { - margin-left: 8px; - margin-right: 12px; - padding-left: 16px; - padding-right: 16px; - border-radius: 26px; + padding: 0 16px; color: @background; background: @color5; } #tray { - border: none; - margin-right: 12px; - color: @foreground; - background: transparent; + all: initial; } #tray > .needs-attention { -- cgit v1.2.3 From dca089967d2d4d1300445abecb84123aa7bbe196 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 11:52:24 +0200 Subject: [tmux] added nord theme --- config/common/tmux/tmux.conf | 56 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index 409ad66..fd5777e 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -3,6 +3,7 @@ # Some tweaks to the status line set -g status-right "%H:%M" +set -g status-position top set -g window-status-current-style "underscore" # Enable RGB color if running in xterm set-option -sa terminal-overrides ",xterm*:Tc" @@ -26,7 +27,7 @@ set -g focus-events on # KEYBINDINGS # Reload config file -bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf" +bind r source-file ~/.config/tmux.conf \; display "Reloaded ~/.tmux.conf" # 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" @@ -88,3 +89,56 @@ bind W new-session -c "$HOME" bind S choose-tree -Z # Menu for mounting and ejecting devices. bind E display-menu -T "#[align=centre]#I:#W" -x W -y W '' Mount 0 "display-popup -E 'amount'" + +# Theme + +#+----------------+ +#+ Plugin Support + +#+----------------+ +#+--- tmux-prefix-highlight ---+ +set -g @prefix_highlight_fg black +set -g @prefix_highlight_bg brightcyan +set -g @prefix_highlight_output_prefix "#[fg=brightcyan]#[bg=black]#[nobold]#[noitalics]#[nounderscore]#[bg=brightcyan]#[fg=black]" +set -g @prefix_highlight_output_suffix "" +set -g @prefix_highlight_copy_mode_attr "fg=brightcyan,bg=black,bold" + + +#+---------+ +#+ Options + +#+---------+ +set -g status-interval 1 +set -g status on + +#+--------+ +#+ Status + +#+--------+ +#+--- Layout ---+ +set -g status-justify left +set -g status-left "#[fg=black,bg=blue,bold] #S #[fg=blue,bg=black,nobold,noitalics,nounderscore]" +set -g status-right "#{prefix_highlight}#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] ${NORD_TMUX_STATUS_DATE_FORMAT} #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] ${NORD_TMUX_STATUS_TIME_FORMAT} #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H " +#+--- Colors ---+ +set -g status-style bg=black,fg=white + +#+-------+ +#+ Panes + +#+-------+ +set -g pane-border-style bg=default,fg=brightblack +set -g pane-active-border-style bg=default,fg=blue +set -g display-panes-colour black +set -g display-panes-active-colour brightblack + +#+------------+ +#+ Clock Mode + +#+------------+ +setw -g clock-mode-colour cyan + +#+----------+ +#+ Messages + +#+---------+ +set -g message-style bg=brightblack,fg=cyan +set -g message-command-style bg=brightblack,fg=cyan + +#+--- Windows ---+ +set -g window-status-format "#[fg=black,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#I #[fg=white,bg=brightblack,nobold,noitalics,nounderscore] #[fg=white,bg=brightblack]#W #F #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]" +set -g window-status-current-format "#[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#I #[fg=black,bg=cyan,nobold,noitalics,nounderscore] #[fg=black,bg=cyan]#W #F #[fg=cyan,bg=black,nobold,noitalics,nounderscore]" +set -g window-status-separator "" -- cgit v1.2.3 From 95926dbc3923e2f4f1a582713c7e6b0fb3fb9e6e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 11:52:56 +0200 Subject: [mpdf] refactor and use of commander introduce the use of commander to get rid of if else, also use tee to write to temporary file --- bin/menuscripts/mpdf | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/bin/menuscripts/mpdf b/bin/menuscripts/mpdf index d67fdae..85debfb 100755 --- a/bin/menuscripts/mpdf +++ b/bin/menuscripts/mpdf @@ -1,22 +1,10 @@ #!/bin/sh -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 30% --height 30% --matching-algorithm normal --prompt-text pdf:" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 10 -g 1 -x -i -p pdf:" -else - menucmd="fzf" -fi - -tmp="/tmp/dmpdf" -find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > "$tmp" -choice="$(sed "s|^$HOME|\~| ; s|\([^/]\)[^/]*/|\1/|g" "$tmp" | - awk '{printf "%s %s\n", NR ":", $0}' | - $menucmd | - grep -o "^[0-9]\+:" | - cut -f 1 -d :)" -test -z "$choice" && exit 1 +tmp="/tmp/mpdf" +choice="$(find ${1:-$HOME/docs $HOME/dl} -iname "*.pdf" 2> /dev/null | sort | + tee "$tmp" | + sed "s|^$HOME|\~| ; s|\([^/]\)[^/]*/|\1/|g" | + commander -x -n)" file="$(sed -n "${choice}p" "$tmp")" +[ -r "$file" ] || exit 1 zathura "$file" & -- cgit v1.2.3 From 4927824a901541ce31ad96b25825f6854c0ddb99 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 11:59:58 +0200 Subject: [waybar] added padding to mpd module --- config/hyprland/waybar/schemes/base16.css | 1 + 1 file changed, 1 insertion(+) diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index d0600b8..e351f69 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -92,6 +92,7 @@ window#waybar.PCSX2 #window { #mpd { color: @background; + padding: 0 16px; background: @color6; } -- cgit v1.2.3 From e68f87e355dab3094bf5195cb51fc79ce6f8569d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:02:48 +0200 Subject: [mvid] refactor and use commander use tee to write to temp file, use commander instead of if else statement --- bin/menuscripts/mvid | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/bin/menuscripts/mvid b/bin/menuscripts/mvid index ca309fb..09ebab8 100755 --- a/bin/menuscripts/mvid +++ b/bin/menuscripts/mvid @@ -1,27 +1,16 @@ #!/usr/bin/env sh -tmpfile="/tmp/dmvids" +tmp="/tmp/dmvids" dirs="${1:-$HOME/vids $HOME/dl}" -find -L $dirs 2> /dev/null | - grep ".\+\.\(webm\|mp4\|mpeg\|mkv\)$" | - sort > "$tmpfile" -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 30% --height 30% --matching-algorithm normal" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 10 -g 1 -x -i" -else - menucmd="fzf" -fi +choice="$(find -L $dirs 2> /dev/null | + grep '^.\+\.\(webm\|mp4\|mpeg\|mkv\)$' | + sort | tee "$tmp" | + sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g" | + commander -n -x)" -choice="$(sed "s|^$HOME|\~| ; s|\([^/]\)[^/]*/|\1/|g" "$tmpfile" | - awk '{printf "%s %s\n", NR ":", $0}' | - $menucmd | - cut -f 1 -d ':')" -test -z "$choice" && - exit 1 +file="$(sed -n "${choice}p" "$tmp")" +[ -r "$file" ] || exit 1 -mpv "$(sed -n "${choice}p" "$tmpfile")" +mpv "$file" -- cgit v1.2.3 From c4e4a6c46828a188b782fd60a68bb061c934047e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:03:53 +0200 Subject: [alacritty] added fullscreen keybinding --- config/common/alacritty/alacritty.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/common/alacritty/alacritty.yml b/config/common/alacritty/alacritty.yml index e5664f1..32fc95b 100644 --- a/config/common/alacritty/alacritty.yml +++ b/config/common/alacritty/alacritty.yml @@ -761,7 +761,7 @@ hints: # # If the same trigger is assigned to multiple actions, all of them are executed # in the order they were defined in. -# key_bindings: +key_bindings: #- { key: Paste, action: Paste } #- { key: Copy, action: Copy } #- { key: L, mods: Control, action: ClearLogNotice } @@ -871,6 +871,7 @@ hints: #- { key: F, mods: Command|Control, action: ToggleFullscreen } #- { key: F, mods: Command, mode: ~Search, action: SearchForward } #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + - {key: F11, action: ToggleFullscreen} #debug: # Display the time it takes to redraw each frame. -- cgit v1.2.3 From c2b8ef4441a00d2cead2b529487718caa5bd8a8c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:04:15 +0200 Subject: [nvim] changed die to log and logn snippets --- config/essentials/nvim/after/plugin/luasnip.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/config/essentials/nvim/after/plugin/luasnip.lua b/config/essentials/nvim/after/plugin/luasnip.lua index 5b45d11..5657560 100644 --- a/config/essentials/nvim/after/plugin/luasnip.lua +++ b/config/essentials/nvim/after/plugin/luasnip.lua @@ -157,17 +157,11 @@ ls.add_snippets("sh", { ]], {}), parse("flogn", [[ - logn () - { - >&2 printf '%s\n' "\$@" - } + logn () { >&2 printf '%s\n' "\$@"; } ]], {}), parse("flog", [[ - log () - { - >&2 printf '%s' "\$@" - } + log () { >&2 printf '%s' "\$@"; } ]], {}), s("inp", fmt( [[ -- cgit v1.2.3 From fce05e8d2257fc7a562afc1089c6290902aa4aa9 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:04:51 +0200 Subject: [nvim] use printf instead of echo for sh remaps --- config/essentials/nvim/ftplugin/sh.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/essentials/nvim/ftplugin/sh.lua b/config/essentials/nvim/ftplugin/sh.lua index 01b20d6..169059c 100644 --- a/config/essentials/nvim/ftplugin/sh.lua +++ b/config/essentials/nvim/ftplugin/sh.lua @@ -1,6 +1,6 @@ -vim.keymap.set("n", "t", "s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2\"") -vim.keymap.set("n", "i", "s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2: $\\2\"") -vim.keymap.set("i", "t", "s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2\"A") -vim.keymap.set("i", "i", "s/\\(\\s*\\)\\(.*\\)/\\1echo \"\\2: $\\2\"A") +vim.keymap.set("n", "t", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2\"") +vim.keymap.set("n", "i", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2: %s\\\\n\" \"$\\2\"") +vim.keymap.set("i", "t", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2\"A") +vim.keymap.set("i", "i", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2: %s\\\\n\" \"$\\2\"A") vim.keymap.set({"i", "n"}, "v", "A)\"I\"$(I") vim.opt.formatoptions = "cqrnj" -- cgit v1.2.3 From 696accd7fca3788193d8871bc3759074ef98e524 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:05:16 +0200 Subject: [nvim] added NetworkEssentials vault --- config/essentials/nvim/lua/user/zk.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/essentials/nvim/lua/user/zk.lua b/config/essentials/nvim/lua/user/zk.lua index 613c8e5..8004238 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", }, + NetworkEssentials = { + home = home .. "/" .. "NetworkEssentials", + template_new_note = home .. "/" .. "templates/new_note.md", + new_note_filename = "title", + }, C = { home = home .. "/" .. "C", template_new_note = home .. "/" .. "templates/new_note.md", -- cgit v1.2.3 From af30025b0ddd2c6ba54d77b4eccefc04b5ad5ff6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:16:29 +0200 Subject: [waybar] changed mpd format --- config/hyprland/waybar/config.jsonc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index 0fc585f..ad4dc02 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -4,15 +4,15 @@ "modules-center": ["clock"], "modules-right": ["custom/wireguard", "network", "pulseaudio", "temperature", "cpu", "custom/memory", "tray"], "mpd": { - "tooltip": false, "format": "{artist} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})", "artist-len": 24, "format-disconnected": "s", - "format-stopped": "s", + "format-stopped": "", "state-icons": { "playing": "", "paused": "", }, + "tooltip-format": "{songPosition}/{queueLength} ({volume}%)", "on-click": "mpc toggle", "on-scroll-up": "mpc volume +5", "on-scroll-down": "mpc volume -5", -- cgit v1.2.3 From 62b93ec2d8ca2aa0cdfb0192ca885a72848edcd0 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:16:48 +0200 Subject: [waybar] added tooltips --- config/hyprland/waybar/config.jsonc | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/hyprland/waybar/config.jsonc b/config/hyprland/waybar/config.jsonc index ad4dc02..6866f62 100644 --- a/config/hyprland/waybar/config.jsonc +++ b/config/hyprland/waybar/config.jsonc @@ -26,7 +26,6 @@ "separate-outputs": true, }, "pulseaudio": { - "tooltip": false, "scroll-step": 5, "format": "{icon} {volume:3}%", "format-icons": { @@ -54,7 +53,6 @@ "format-disconnected": "", }, "cpu": { - "tooltip": false, "format": " {usage:2}%", "interval": 3, }, -- cgit v1.2.3 From ef702ec038ffd2202355eea937ee7374438a6cf5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 12:17:17 +0200 Subject: [tofi] changed nord theme to be on top with 100% width --- config/hyprland/tofi/themes/nord | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/hyprland/tofi/themes/nord b/config/hyprland/tofi/themes/nord index cf78b5c..5d8161f 100644 --- a/config/hyprland/tofi/themes/nord +++ b/config/hyprland/tofi/themes/nord @@ -13,21 +13,21 @@ selection-match-color = #ffffff prompt-text = "" prompt-padding = 0 placeholder-text = "..." +anchor=top-left -width = 20% +width = 100% height = 20% -background-color = #2e3440f0 +background-color = #3b4252f2 outline-width = 0 outline-color = #81a1c1 -border-width = 2 +border-width = 0 border-color = #88c0d0 -corner-radius = 26 +corner-radius = 0 -padding-top = 0 -padding-bottom = 0 -padding-left = 0 -# padding-left = 7% -padding-right = 0 +padding-top = 5 +padding-bottom = 5 +padding-left = 5 +padding-right = 5 matching-algorithm = prefix require-match = false -- cgit v1.2.3 From e09397267eac16e61fd9b4e406e9d4ab4f255f56 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 21:49:10 +0200 Subject: [tofi] created logic groups ordered the config, colors together, options affecting size together ensoforth... --- config/hyprland/tofi/themes/nord | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/config/hyprland/tofi/themes/nord b/config/hyprland/tofi/themes/nord index 5d8161f..c8a6192 100644 --- a/config/hyprland/tofi/themes/nord +++ b/config/hyprland/tofi/themes/nord @@ -1,7 +1,9 @@ ### Font font = monospace bold font-size = 12 +anchor=top +# colors text-color = #d8dee9 prompt-color = #81a1c1 placeholder-color = #4c566a @@ -9,26 +11,29 @@ input-color = #d8dee9 default-result-color = #88c0d0 selection-color = #5e81ac selection-match-color = #ffffff +background-color = #3b4252f2 +outline-color = #81a1c1 +border-color = #88c0d0 -prompt-text = "" -prompt-padding = 0 -placeholder-text = "..." -anchor=top-left - +# sizes width = 100% height = 20% -background-color = #3b4252f2 + +border-width = 2 outline-width = 0 -outline-color = #81a1c1 -border-width = 0 -border-color = #88c0d0 -corner-radius = 0 +prompt-padding = 0 padding-top = 5 padding-bottom = 5 padding-left = 5 padding-right = 5 +corner-radius = 0 + +# general +prompt-text = "" +placeholder-text = "..." + matching-algorithm = prefix require-match = false auto-accept-single = true -- cgit v1.2.3 From da4d5a30309bd40dcabd4fc1395bc44b2af06012 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 21:50:08 +0200 Subject: [tmux] updated config file location --- config/common/tmux/tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index fd5777e..875ab7f 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -27,7 +27,7 @@ set -g focus-events on # KEYBINDINGS # Reload config file -bind r source-file ~/.config/tmux.conf \; display "Reloaded ~/.tmux.conf" +bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded ~/.tmux.conf" # 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" -- cgit v1.2.3 From bb5cb48e44ba6d54eba398e8b6473ec945f47413 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 21:56:29 +0200 Subject: [tmux] removed plugin support and added hour to status --- config/common/tmux/tmux.conf | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index 875ab7f..a349025 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -1,10 +1,6 @@ # By Nicholas Marriott. Public domain. # but -now- me. -# Some tweaks to the status line -set -g status-right "%H:%M" -set -g status-position top -set -g window-status-current-style "underscore" # Enable RGB color if running in xterm set-option -sa terminal-overrides ",xterm*:Tc" # Change the default $TERM to xterm-256color @@ -92,17 +88,6 @@ bind E display-menu -T "#[align=centre]#I:#W" -x W -y W '' Mount 0 "display-popu # Theme -#+----------------+ -#+ Plugin Support + -#+----------------+ -#+--- tmux-prefix-highlight ---+ -set -g @prefix_highlight_fg black -set -g @prefix_highlight_bg brightcyan -set -g @prefix_highlight_output_prefix "#[fg=brightcyan]#[bg=black]#[nobold]#[noitalics]#[nounderscore]#[bg=brightcyan]#[fg=black]" -set -g @prefix_highlight_output_suffix "" -set -g @prefix_highlight_copy_mode_attr "fg=brightcyan,bg=black,bold" - - #+---------+ #+ Options + #+---------+ @@ -113,9 +98,12 @@ set -g status on #+ Status + #+--------+ #+--- Layout ---+ +set -g set-titles on +set -g status-position top +set -g window-status-current-style "underscore" set -g status-justify left set -g status-left "#[fg=black,bg=blue,bold] #S #[fg=blue,bg=black,nobold,noitalics,nounderscore]" -set -g status-right "#{prefix_highlight}#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] ${NORD_TMUX_STATUS_DATE_FORMAT} #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] ${NORD_TMUX_STATUS_TIME_FORMAT} #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H " +set -g status-right "#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %H:%M #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H " #+--- Colors ---+ set -g status-style bg=black,fg=white -- cgit v1.2.3 From 02d291772d52ba328a0d8f92bec757fae5417bcc Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 21:57:10 +0200 Subject: [hyprland] minor edits use a subgroup for blur tweaked the opacity to change on focus rectangle corners --- config/hyprland/hypr/hyprland.conf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/config/hyprland/hypr/hyprland.conf b/config/hyprland/hypr/hyprland.conf index a8a99c2..17f0235 100644 --- a/config/hyprland/hypr/hyprland.conf +++ b/config/hyprland/hypr/hyprland.conf @@ -41,14 +41,17 @@ misc { } decoration { - rounding = 2 - blur = no - blur_size = 3 - blur_passes = 1 - blur_new_optimizations = on + rounding = 0 + blur { + enabled = 1 + size = 6 + } dim_inactive = true dim_strength = 0.08 + active_opacity = 0.98 + inactive_opacity = 0.92 + drop_shadow = yes shadow_range = 4 shadow_render_power = 3 -- cgit v1.2.3 From edd077ea759c8bd7cc96782d5bfbd992a9d848a1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 21:58:27 +0200 Subject: [waybar] fixed tray icons menu too big --- config/hyprland/waybar/schemes/base16.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index e351f69..541ffb8 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -149,8 +149,8 @@ window#waybar.PCSX2 #window { background: @color5; } -#tray { - all: initial; +#tray * { + padding: unset; } #tray > .needs-attention { -- cgit v1.2.3 From f2bcbc845adcd02b1b12fa00f1b8c08782ff929c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 21:58:48 +0200 Subject: [waybar] removed duplicate property --- config/hyprland/waybar/schemes/base16.css | 1 - 1 file changed, 1 deletion(-) diff --git a/config/hyprland/waybar/schemes/base16.css b/config/hyprland/waybar/schemes/base16.css index 541ffb8..76efbb3 100644 --- a/config/hyprland/waybar/schemes/base16.css +++ b/config/hyprland/waybar/schemes/base16.css @@ -77,7 +77,6 @@ window#waybar.PCSX2 #window { #workspaces button { transition: none; background: transparent; - font-size: 16px; color: @background; } -- cgit v1.2.3 From 57650e96e2c3a24d2101b5497c255f21b52d2f92 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:03:13 +0200 Subject: [mpower] small refactor and added commander --- bin/menuscripts/mpower | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 443ed54..005c497 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,14 +1,7 @@ #!/bin/sh -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 10% --height 13% --padding-left 2%" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -g 2 -l 2" -else - menucmd="fzf" -fi +choice="$(printf 'poweroff +suspend +hibernate +reboot' | commander -c -d)" -choices="poweroff\nreboot\nhibernate\nsuspend" -choice="$(printf "$choices" | $menucmd)" -test -z "$choice" || systemctl "$choice" +[ "$choice" ] && systemctl "$choice" -- cgit v1.2.3 From 4f0064e39f9ece084d765f4e54a7e212e366a4e3 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:22:18 +0200 Subject: [zshenv] added fzf nord theme --- config/home/.zshenv | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/home/.zshenv b/config/home/.zshenv index 9a8206c..0c5057e 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -55,3 +55,11 @@ export PASSWORD_STORE_CLIP_TIME=5 # export VIMINIT="source ~/.config/vim/vimrc" # export fpath=($XDG_CONFIG_HOME/zsh/completion/ $fpath) # export CUDA_CACHE_PATH="$XDG_CONFIG_HOME"/nv + +export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' + --color=fg:#e5e9f0,hl:#88c0d0 + --color=pointer:blue + --color=gutter:#2e3440 + --color=fg+:#5e81ac,hl+:#d08770 + --color=info:#b48ead,prompt:#bf6069,pointer:#b48dac + --color=marker:#a3be8b,spinner:#ebcb8b,header:#a3be8b' -- cgit v1.2.3 From dccf53c0d83973623e0d4c3f2550471232cf22b4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:25:53 +0200 Subject: [goo] search in pwd by default --- bin/common/goo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/common/goo b/bin/common/goo index cfd03ec..cb7a8b6 100755 --- a/bin/common/goo +++ b/bin/common/goo @@ -18,6 +18,6 @@ arduino15" for dir in $exclude; do dirs="$dirs -name \"$dir\" -o " done -cmd="find ${2:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" +cmd="find ${2:-.} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print" eval "$cmd" 2>/dev/null -- cgit v1.2.3 From 7ab95433e2d80ba03db7667795e72d398b9d2a7b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:31:08 +0200 Subject: [mpower] added extra newline --- bin/menuscripts/mpower | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 005c497..3b66824 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -2,6 +2,7 @@ choice="$(printf 'poweroff suspend hibernate -reboot' | commander -c -d)" +reboot +' | commander -c -d)" [ "$choice" ] && systemctl "$choice" -- cgit v1.2.3 From 4f80f256aacd5096aa40159f36769135a8765a00 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:31:48 +0200 Subject: [tmux] minor edits --- config/common/tmux/tmux.conf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index a349025..e74713a 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -1,5 +1,4 @@ -# By Nicholas Marriott. Public domain. -# but -now- me. +# Special thanks to Nicholas Marriott. # Enable RGB color if running in xterm set-option -sa terminal-overrides ",xterm*:Tc" @@ -79,7 +78,7 @@ bind -n M-I switch-client -n bind n command-prompt "rename-window '%%'" bind N command-prompt "rename-session '%%'" # Starting new windows -bind w new-window -c "#{pane_current_path}" +bind w new-window -c "$HOME" bind W new-session -c "$HOME" # Show tree bind S choose-tree -Z -- cgit v1.2.3 From c6a1ae689420321c37d66055d8c09d0d2a3f784e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:32:48 +0200 Subject: [nvim] use stderr on printf --- config/essentials/nvim/ftplugin/sh.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/essentials/nvim/ftplugin/sh.lua b/config/essentials/nvim/ftplugin/sh.lua index 169059c..e18170a 100644 --- a/config/essentials/nvim/ftplugin/sh.lua +++ b/config/essentials/nvim/ftplugin/sh.lua @@ -1,6 +1,6 @@ -vim.keymap.set("n", "t", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2\"") -vim.keymap.set("n", "i", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2: %s\\\\n\" \"$\\2\"") -vim.keymap.set("i", "t", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2\"A") -vim.keymap.set("i", "i", "s/\\(\\s*\\)\\(.*\\)/\\1printf \"\\2: %s\\\\n\" \"$\\2\"A") +vim.keymap.set("n", "t", "s/\\(\\s*\\)\\(.*\\)/\\1>\\&2 printf \"\\2\"") +vim.keymap.set("n", "i", "s/\\(\\s*\\)\\(.*\\)/\\1>\\&2 printf \"\\2: %s\\\\n\" \"$\\2\"") +vim.keymap.set("i", "t", "s/\\(\\s*\\)\\(.*\\)/\\1>\\&2 printf \"\\2\"A") +vim.keymap.set("i", "i", "s/\\(\\s*\\)\\(.*\\)/\\1>\\&2 printf \"\\2: %s\\\\n\" \"$\\2\"A") vim.keymap.set({"i", "n"}, "v", "A)\"I\"$(I") vim.opt.formatoptions = "cqrnj" -- cgit v1.2.3 From 9172676556847ff625cbf4b4eff19f441e0b9386 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Aug 2023 22:33:19 +0200 Subject: [aliases] edited aliases removed aliases that have been replaced such as floc and dloc, and added more aliases --- config/essentials/zsh/aliases.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 4185999..a1bbf50 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -5,9 +5,6 @@ if [ $SHELL = "/bin/zsh" ] then # googoo aliases - alias o.='o .' - alias go.='go .' - alias ogo.='ogo .' alias o/='o /' alias o/s='o /srv' alias go/='go /' @@ -133,10 +130,6 @@ alias df='df -h' alias diff='diff -u --color' alias shred='shred -uz' alias lsblk='lsblk -o name,type,fsused,fsavail,size,fstype,label,mountpoint' -alias floc='doas find / -type "f" 2> /dev/null | grep' -alias dloc='doas find / -type "d" 2> /dev/null | grep' -alias fif='find . -type "f" | grep' -alias fid='find . -type "d" | grep' alias sxt='sxiv -t' alias wgsh='wget --quiet --show-progress' alias wgc='wgsh "$(clipo)"' @@ -185,6 +178,7 @@ alias rmd='rm -f *.{orig,rej}' alias cdzot='mkdir -p /tmp/zottesite && cd /tmp/zottesite' alias gdate='date +%y_%m_%d-%T' alias tpid='tail -f /dev/null --pid' +alias pwdcp='pwd | clipp' alias vbm='vboxmanage' alias vbls='vbm list vms' @@ -217,6 +211,7 @@ alias cdpa='cd ~/pics/ai-outputs/' alias cdpp='cd ~/proj/personal/' alias chom='cd ~/proj/personal/homepage' alias lov='cd ~/proj/personal/lola' +alias cdsh='~/proj/personal/scheduler' alias cdsw='cd ~/proj/personal/WheelAdvisor' alias cddm='cd ~/proj/suckless/dmenu' alias cdw='cd ~/proj/suckless/dwm' @@ -238,6 +233,8 @@ alias cdng='cd /etc/nginx' alias cdrs='cd /srv/' # fzf aliases +alias ppj='cd ~/proj/personal/"$(find ~/proj/personal -mindepth 1 -maxdepth 1 -type d -printf "%f\n"| fzf)"' +alias cfg='find -L ~/src/dotfiles -type f | fzf | xargs -r $EDITOR' 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" @@ -258,7 +255,6 @@ alias dbinf='ssh db dlinfo' alias sshdb='ssh -t db tmux a' alias dbsmu='rsync -aPz db:/media/basilisk/music/ /media/kilimanjaro/music' -alias cfg='git --git-dir=~/src/dotfiles/.git --work-tree=~/src/dotfiles' # oh-my-zsh git aliases alias g='git' alias ga='git add' -- cgit v1.2.3 From 8b9e93321bfd229b8a29fdd1fc60de670e16636d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 24 Aug 2023 21:11:27 +0200 Subject: [menuscripts] use 'commander' in menuscripts --- bin/menuscripts/mapimg | 13 ++----------- bin/menuscripts/mcurs | 25 +++++++------------------ bin/menuscripts/mdsktp | 21 ++++----------------- bin/menuscripts/memoji | 21 ++++++--------------- bin/menuscripts/mhelp | 23 ++++++----------------- bin/menuscripts/mmpcvol | 20 +++++--------------- bin/menuscripts/mpass | 32 +++++++++++++++++--------------- bin/menuscripts/mpassgen | 45 ++++++++++----------------------------------- bin/menuscripts/mplay | 20 +++++--------------- bin/menuscripts/mvid | 2 +- 10 files changed, 63 insertions(+), 159 deletions(-) diff --git a/bin/menuscripts/mapimg b/bin/menuscripts/mapimg index 151b8d0..a959d46 100755 --- a/bin/menuscripts/mapimg +++ b/bin/menuscripts/mapimg @@ -1,17 +1,8 @@ #!/bin/sh -if [ -z "$MENUCMD" ] -then - menucmd="fzf" -elif [ "$MENUCMD" = "tofi" ] -then - menucmd='tofi --width 700 --height 300 --prompt-text Appimage:' -else - menucmd="dmenu -x -l 10 -g 1 -p Appimage:" -fi - dest="$XDG_DATA_HOME"/appimages appimage="$(find "$dest" -type f -printf "%f\n" | sed 's/\.[Aa]pp[Ii]mage$//g' | - $menucmd)" + commander -x -l -p "Appimage:")" +[ "$appimage" ] || exit 1 setsid "$dest/${appimage:-NOSEL}"* diff --git a/bin/menuscripts/mcurs b/bin/menuscripts/mcurs index 32f5525..4349e0b 100755 --- a/bin/menuscripts/mcurs +++ b/bin/menuscripts/mcurs @@ -1,22 +1,11 @@ #!/bin/sh -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 30% --height 20% --padding-left 2% --matching-algorithm normal" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 10 -g 1 -x -i" -else - menucmd="fzf" -fi - # requirements -which $MENUCMD firefox > /dev/null || - exit 1 +which "$BROWSER" > /dev/null || exit 1 + +choice="$(find "${1:-$HOME/docs/school}" | + grep -i "cursus/index.html" 2> /dev/null | + sed "s;$HOME;~;" | commander -x -d -c)" +[ "$choice" ] && exit 1 -choice="$(find ${1:-$HOME/docs/school} | - grep "Cursus/index.html" 2> /dev/null | - sed "s;$HOME;~;" | - $menucmd)" -test -z "$choice" && exit 1 -firefox "$choice" +$BROWSER "$choice" diff --git a/bin/menuscripts/mdsktp b/bin/menuscripts/mdsktp index a48aca6..f07fb7b 100755 --- a/bin/menuscripts/mdsktp +++ b/bin/menuscripts/mdsktp @@ -1,21 +1,8 @@ #!/bin/sh # Searches through .desktop files and prompt to launch them via dmenu -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -g 1 -i" -else - menucmd="fzf" -fi -choice="$(find ~/.local/share/applications \ - -maxdepth 1 \ - -type f \ - -not -iname "wine-extension*" -a -iname "*.desktop" \ - -printf "%f\n" | - cut -d. -f1 | - $menucmd)" -test -z "$choice" && exit 1 +choice="$(find ~/.local/share/applications -maxdepth 1 -type f -not -iname "wine-extension*" | + awk '/\/[^.\/]+\.desktop/ {print $(NF-1)}' | + commander -s -d -x -c)" +[ "$choice" ] || exit 1 gtk-launch "$choice" diff --git a/bin/menuscripts/memoji b/bin/menuscripts/memoji index d051ad8..9c45950 100755 --- a/bin/menuscripts/memoji +++ b/bin/menuscripts/memoji @@ -7,36 +7,27 @@ if [ "$WAYLAND_DISPLAY" ] then - copycmd="wl-copy" + alias copycmd="wl-copy" else - copycmd="xclip -sel c" -fi -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 30% --height 30% --matching-algorithm normal --prompt-text Emoji:" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 20 -g 1 -x -i -p Emoji:" -else - menucmd="fzf --prompt Emoji:" + alias copycmd="xclip -sel c" fi set -e case "$1" in "list") data=$(sed '0,/^__DATA__$/d' "$0") - echo -n "$data" + printf "%s" "$data" ;; "copy") input=$(tee | cut -f 1 -d ' ') - if [ ! -z "$input" ] + if [ "$input" ] then notify-send "dmemoji" "$input copied!" - echo -n "$input" | $copycmd + printf "%s" "$input" | copycmd fi ;; "") - sh $0 list | $menucmd | sh $0 copy + sh "$0" list | commander -p "Emoji:" -l -x | sh "$0" copy ;; esac diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index 5963a88..339d6bf 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,29 +1,18 @@ #!/usr/bin/env sh -if [ "$MENUCMD" = "tofi" ] -then - program="$(tofi-run --prompt-text "program: ")" - menucmd="tofi --width 50% --height 30% --matching-algorithm normal --prompt-text $program:" -elif [ "$MENUCMD" = "dmenu" ] -then - program="$(dmenu_path | dmenu -l 4 -g 5 -p "program:")" - menucmd="dmenu -l 20 -g 1 -x -i -p $program:" -else - program="$(dmenu_path | fzf)" - menucmd="fzf" -fi +program="$(commander -r -c -d)" -test -z "$program" && exit 1 +[ "$program" ] || exit 1 -option="$($program --help | +option="$("$program" --help | # Parse options grep "^ *-[-a-zA-Z0-9]* " | tr -s ' ' | sort | uniq | column -l 2 -t | - $menucmd | + commander -l -x -c -d | awk '{print $1}')" -test -z "$option" && exit 1 +[ "$option" ] || exit 1 -setsid $program $option +setsid "$program" "$option" diff --git a/bin/menuscripts/mmpcvol b/bin/menuscripts/mmpcvol index 0f36e18..239dec3 100755 --- a/bin/menuscripts/mmpcvol +++ b/bin/menuscripts/mmpcvol @@ -1,23 +1,13 @@ #!/bin/sh -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 5% --height 10% --prompt-text" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -g 2 -l 1 -p" -else - menucmd="fzf --prompt" -fi - while true do volume="$(mpc volume | awk '{print $2}' | cut -f1 -d'%')" - choice="$(echo "plus\nmin" | - $menucmd "$volume" | + choice="$(printf "plus\nmin\n" | + commander -d -c -p "$volume" | sed 's/plus/+/;s/min/-/')" - test -z "$choice" && break - nb="$($menucmd "$volume$choice" < /dev/null)" - test -z "$nb" && break + [ "$choice" ] || break + nb="$(commander -c -p "$volume$choice" -i)" + [ "$nb" ] || break mpc volume "$choice$nb" done diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 4ecd4bc..8d5f4eb 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -1,25 +1,27 @@ #!/usr/bin/env sh store="${PASSWORD_STORE_DIR:-$HOME/.password-store}" -lscmd="ls --group-directories-first" -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --prompt pass:" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 4 -g 2 -i -p pass:" -else - menucmd="fzf --prompt pass:" -fi + +# list passwords, group directories first +list_pswds() +{ + find "$1" \ + -maxdepth 1 -mindepth 1 \ + -not -name '.*' -type d -printf "%y\t%f\n" -o \ + -not -name '.*' -not -type d -printf "%y\t%f\n" | + sort -k1 -k2 | + cut -f 2 | sed 's/\.gpg$//' +} + while [ -d "$store/$file" ] do - choice="$($lscmd "$store/$file" | sed 's/\.gpg$//'| $menucmd)" - [ "$choice" ] || break - file="$file/$choice" + choice="$(list_pswds "$store/$file" | commander -c -d)" + [ "$choice" ] || exit 1 + [ -z "$file" ] && file="$choice" || file="$file/$choice" done -test -z "$file" && exit 1 +[ "$file" ] || exit 1 pass show -c "$file" || exit 1 -notify-send -t 1000 "mpass" "copied $choice" +notify-send -t 1000 "mpass" "copied $file" [ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running cliphist list | head -n 1 | cliphist delete diff --git a/bin/menuscripts/mpassgen b/bin/menuscripts/mpassgen index 8384542..51b9bc4 100755 --- a/bin/menuscripts/mpassgen +++ b/bin/menuscripts/mpassgen @@ -1,46 +1,21 @@ #!/usr/bin/env sh -input () -{ - # menu prompt for output - if [ "$MENUCMD" = "tofi" ] - then - inp="$(tofi --prompt-text "$1 " &2 - read inp - fi - echo $inp -} -# menu select long -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --prompt login:" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 10 -g 1 -x -i -p login:" -else - menucmd="fzf" -fi +input () { commander -c -i -p "$1"; } -choice="$(echo "multiline\nsingle" | $MENUCMD)" -test -z "${choice}" && exit 1 +choice="$(printf "multiline\nsingle\n" | commander -c -d)" +[ "$choice" ] || exit 1 password="$(input "name:")" -test -z "${password}" && exit 1 +[ "$password" ] || exit 1 -if [ "${choice}" = "multiline" ] +if [ "$choice" = "multiline" ] then - login="$(ls -1 ${PASSWORD_STORE_DIR:=$HOME/.password-store}/e-mails | - sed 's/\.gpg$//' | - $menucmd)" - test -z "${login}" && exit 1 + login="$(find "${PASSWORD_STORE_DIR:=$HOME/.password-store}"/e-mails -type f -maxdepth 1 -iname "*.gpg" -printf "%f\n" | + sed 's/\.gpg$//' | commander -c -d -p 'login:')" + [ "$login" ] || exit 1 url="$(input "url:")" - test -z "${url}" && exit 1 - echo "${password}\nlogin: ${login}\nurl: ${url}" | + [ "$url" ] || exit 1 + printf "%s\nlogin: %s\nurl: %s\n" "${password}" "${login}" "${url}" | pass insert -mf "${password}" pass generate -ci "${password}" else diff --git a/bin/menuscripts/mplay b/bin/menuscripts/mplay index 08fcc46..e4fca54 100755 --- a/bin/menuscripts/mplay +++ b/bin/menuscripts/mplay @@ -1,16 +1,6 @@ #!/bin/sh -# menu select long -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 50% --height 30% --matching-algorithm normal" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 10 -g 1 -x -i" -else - menucmd="fzf" -fi -choice="$(mpc listall | $menucmd)" -test -z "$choice" && - exit 1 -mpc insert "$choice" && - mpc next +choice="$(mpc listall | commander -c -l -d -x)" +[ "$choice" ] || exit 1 +mpc insert "$choice" || exit 1 +mpc next 2> /dev/null +mpc play 2> /dev/null diff --git a/bin/menuscripts/mvid b/bin/menuscripts/mvid index 09ebab8..85187cb 100755 --- a/bin/menuscripts/mvid +++ b/bin/menuscripts/mvid @@ -8,7 +8,7 @@ choice="$(find -L $dirs 2> /dev/null | grep '^.\+\.\(webm\|mp4\|mpeg\|mkv\)$' | sort | tee "$tmp" | sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g" | - commander -n -x)" + commander -d -n -x)" file="$(sed -n "${choice}p" "$tmp")" [ -r "$file" ] || exit 1 -- cgit v1.2.3 From f4fcf0a66c6d427767d6ea71a64e710964e7570c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:30:57 +0200 Subject: [commander] added commander! --- bin/menuscripts/commander | 313 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100755 bin/menuscripts/commander diff --git a/bin/menuscripts/commander b/bin/menuscripts/commander new file mode 100755 index 0000000..028e8a7 --- /dev/null +++ b/bin/menuscripts/commander @@ -0,0 +1,313 @@ +#!/bin/sh + +# An attempt to unify usage of multiple launchers. +# MENUCMD must be set to the name of the lancher +# +# look at the last line to understand how it works + +tmp="$(mktemp -u)" +export menuopts="" +TOFIRC="$HOME/.config/tofi/config" + +options=' +horizontal +center +input +instant +dynamic +long +prompt +numbered +prefix' + +cleanup() { rm -f "$tmp"; } +logn() { >&2 printf '%s\n' "$@"; } + +run() { + IFS=: + set -f + find -L $PATH -type f -printf "%f\n" 2> /dev/null | sort -u +} + +help() { + cat <<-EOF + Usage: commander OPTIONS... + + An attempt to regroup multiple launchers into one, + it detects the value of the MENUCMD variable + + try: + MENUCMD=tofi commander < /etc/passwd + + Options: + -h Display items horizontally + -c Display centered + -i Take an input and return it to stdout + -d Adjust size and style dynamically + -p ARG Prompt user with the specified argument + -l Display in long list format + -n Output the number of matches + -r Select an executable from PATH + -s Invert instant select on single match + -x Invert prefix matching + EOF +} + +add_option() { menuopts="$menuopts $*"; } +get_prop() { awk -F '=' "/$1 *=*/ {print \$2}" "$TOFIRC"; } + + +trap cleanup EXIT + +# Helper functions +case "$MENUCMD" in + "tofi") + # $1: items count + get_height() + { + font_size="$(get_prop "font-size")" + padding_top="$(get_prop "padding-top")" + padding_bottom="$(get_prop "padding-bottom")" + + printf "%s" "$(( + font_size*2 + padding_top + padding_bottom + 2 + + ($1)*(font_size*2 - 2) + ))" + + } + # $1: items length + get_width() + { + font_size="$(get_prop "font-size")" + padding_left="$(get_prop "padding-left")" + padding_right="$(get_prop "padding-right")" + printf "%s" "$(($1*(font_size-2) + 2 + padding_left + padding_right))" + } ;; + "dmenu") ;; + *) ;; +esac + + +main() +{ + # shellcheck disable=SC2317 + case "$MENUCMD" in + "tofi") + center() { add_option "--anchor=center --width=20%"; } + + horizontal() { + add_option "--horizontal=true --height=32" + add_option "--result-spacing=12" + add_option "--selection-background=#88c0d0" + add_option "--selection-background-padding=6,4" + add_option "--padding-top=0 --padding-bottom=0" + add_option "--margin-top=4" + } + + dynamic() { + pre_cmd() + { + max_height="$(get_height 8)" + max_width="$(get_width 48)" + + tee "$tmp" + + items_count="$(wc -l < "$tmp")" + items_length="$(wc -L < "$tmp")" + + if [ "$long" -ne 1 ] + then + height="$(get_height "$items_count")" + [ "$height" -gt "$max_height" ] && height="$max_height" + add_option "--height=$height" + fi + + width="$(get_width "$items_length")" + [ "$width" -gt "$max_width" ] && width="$max_width" + + + if [ "$prompt" -eq 1 ] + then + prompt_width="$(printf "%s" "$prompt_arg" | wc -c)" + width="$((width + $(get_width "$prompt_width")))" + fi + + add_option "--width=$width" + } + } + + long() { add_option "--width=100% --height=$(get_height 20)"; } + + input() { + add_option "--height=$(get_height 0) --width=$(get_width 24)" + pre_filter() { cat /dev/null; } + } + + prefix() { add_option '--matching-algorithm=normal'; } + + instant() { add_option "--auto-accept-single=false"; } + + prompt() { add_option '--prompt-text' "$prompt_arg"; } + + numbered() { + pre_filter() { awk '{print NR, $0}'; } + post_filter() { awk '{print $1}'; } + } + + menucmd() { tofi "$@"; } + ;; + + "dmenu") + horizontal() { add_option "-l 0"; } + + center() { add_option "-c"; } + + long() { add_option "-l 20 -g 1"; } + + input() { + pre_filter() { cat /dev/null; } + } + + dynamic() { + pre_cmd() + { + tee "$tmp" + items_count="$(wc -l < "$tmp")" + number="$items_count" + + for i in $(seq $((number/2))) + do [ "$((number%i))" -eq 0 ] && factors="$i $factors" + done + + min_diff=9999999999 + for factor in $factors + do + quotient="$((number/factor))" + diff=$((quotient - factor)) + if [ "$diff" -ge 0 ] && [ "$diff" -lt "$min_diff" ] + then + columns="$factor" + rows="$quotient" + min_diff="$diff" + fi + done + + add_option "-g $columns" + add_option "-l $rows" + } + } + + instant() { add_option "-n"; } + + prefix() { add_option '-x'; } + + prompt() { add_option '-p' "$prompt_arg"; } + + numbered() { add_option "-px"; } + + menucmd() { dmenu "$@"; } + ;; + + *) + center() { :; } + + horizontal() { :; } + + dynamic() { :; } + + long() { :; } + + input() { + pre_filter() { cat /dev/null; } + add_option '--print-query' + } + + prefix() { :; } + + prompt() { add_option "--prompt" "$prompt_arg"; } + + numbered() { + pre_filter() { awk '{print NR, $0}'; } + add_option '--with-nth' '2..' + post_filter() { awk '{print $1}'; } + } + + menucmd() { fzf "$@"; } + ;; + esac + + for option in $options + do eval "$option=0" + done + + while getopts ":cdhilop:nrsx" opt + do + # shellcheck disable=SC2034 + case $opt in + + # display horizontal + h) horizontal=1 ;; + # display centered + c) center=1 ;; + # take an input and return it on stdout + i) input=1 ;; + # adjust size and style dynamically + d) dynamic=1 ;; + p) prompt=1; prompt_arg="$OPTARG";; + # long list format + l) long=1 ;; + # output number of match + n) numbered=1 ;; + # select an executable from PATH + r) shift + run | $0 "$@" + exit ;; + # invert instant select on single match + s) instant=1 ;; + # invert prefix matching + x) prefix=1 ;; + + :) + logn "Option '-$OPTARG' requires an argument" + help + exit 1 ;; + ?) + logn "Invalid option: -$OPTARG" + help + exit 1 ;; + esac + done + + + # conflicts + [ "$input" -eq 1 ] && [ "$dynamic" -eq 1 ] && logn "conflicting options." && help && exit 1 + + # quit if stdin is empty + [ -t 0 ] && [ "$input" -eq 0 ] && logn "Stdin is empty." && help && exit 1 + + # call options + for option in $options + do eval "test \"\$$option\" -eq 1" && $option + done + + command -v pre_filter > /dev/null || pre_filter() { cat; } + command -v post_filter > /dev/null || post_filter() { cat; } + + which "${MENUCMD:-fzf}" > /dev/null || exit 1 + + + + if command -v pre_cmd > /dev/null + then + pre_cmd > "$tmp" + >&2 printf "menuopts: %s\n" "$menuopts" + # shellcheck disable=SC2086 + pre_filter < "$tmp" | menucmd $menuopts | post_filter + else + >&2 printf "menuopts: %s\n" "$menuopts" + # shellcheck disable=SC2086 + pre_filter | menucmd $menuopts | post_filter + fi +} + +main "$@" -- cgit v1.2.3 From 2e9c5c77562d5aabc1b1f89641fc9eb75b3c9292 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:31:24 +0200 Subject: [zshrc] fixed highlight bug --- config/essentials/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 769c805..eeb4439 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -89,7 +89,7 @@ rehash_precmd() { # window title hooks add-zsh-hook -Uz precmd rehash_precmd set_wt_action () { - print -Pn '\e]0;$1\a' + print -Pn "\e]0;$1\a\033[0m" } add-zsh-hook -Uz preexec set_wt_action set_wt () { -- cgit v1.2.3 From c9dec781ad79c0345c7d2d98ab59de5d4f858ba7 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:32:08 +0200 Subject: [functions.zsh] use log(n) --- config/essentials/zsh/functions.zsh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index eb776f0..1682315 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -20,7 +20,7 @@ nvf() { local match="$(grep -m1 "$1$" "$cache" 2> /dev/null)" if test ! -f "$match" then - die "resetting cache..." + logn "resetting cache..." match="$(goo | tee "$cache" | grep -m 1 "$1$" 2> /dev/null)" # # Alternative: # match="$(goo | grep -m 1 "$1" 2> /dev/null | tee -a | "$cache")" @@ -29,7 +29,7 @@ nvf() { then $EDITOR "$match" && return else - die "no match." && return 1 + logn "no match." && return 1 fi } @@ -249,12 +249,12 @@ pkbs() mime-default () { - die "Setting '$1' as default for its mimetypes" + logn "Setting '$1' as default for its mimetypes" grep "MimeType=" /usr/share/applications/"$1" | cut -d '=' -f 2- | tr ';' '\n' | xargs -I {} xdg-mime default "$1" "{}" - die "Done." + logn "Done." } addedkeys() { @@ -293,12 +293,12 @@ trcp() muttmail() { - die -n "email set: " + log "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]' + log 'Press [Enter to login]' read && mutt } @@ -309,3 +309,5 @@ resize() return 1 convert -resize $1^ -gravity center -crop $1+0+0 -- "$2" "${3:-$1}" } + +rln() { ln -s "$(readlink -f "$1")" "$2"; } -- cgit v1.2.3 From 0b5f4fbc66bc3ba5a1717f70a9b4ae5fb542742c Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:32:46 +0200 Subject: [functions.zsh] fixed typo in ogo --- config/essentials/zsh/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 1682315..7a94207 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -59,7 +59,7 @@ go() ogo() { _googoo_fzf_opt "$1" - cd "$(dirname "$(goo f "$dest")" | fzf $opt)" + cd "$(dirname "$(goo f "$dest" | fzf $opt)")" } dgo() { -- cgit v1.2.3 From c50d95c4ed0316ad040997f61c605870a02d8434 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:33:13 +0200 Subject: [zshenv] edited fzf color --- config/home/.zshenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/home/.zshenv b/config/home/.zshenv index 0c5057e..b83cad5 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -60,6 +60,6 @@ export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' --color=fg:#e5e9f0,hl:#88c0d0 --color=pointer:blue --color=gutter:#2e3440 - --color=fg+:#5e81ac,hl+:#d08770 + --color=fg+:#81a1c1,hl+:#ebcb8b --color=info:#b48ead,prompt:#bf6069,pointer:#b48dac --color=marker:#a3be8b,spinner:#ebcb8b,header:#a3be8b' -- cgit v1.2.3 From 1bb112f2a1f476f82f2752089f397e597aefc1d4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:33:54 +0200 Subject: [hyprland] use commander as launcher --- config/hyprland/hypr/binds.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/hyprland/hypr/binds.conf b/config/hyprland/hypr/binds.conf index eb3d4a2..8100868 100644 --- a/config/hyprland/hypr/binds.conf +++ b/config/hyprland/hypr/binds.conf @@ -2,12 +2,10 @@ $mainMod = SUPER $term = foot -$menu = $(tofi-run) -$menu_opt = $(tofi-run --auto-accept-single=false) +$menu = $(commander -r -h) bind = $mainMod, Return, exec, $term bind = $mainMod SHIFT, Return, exec, $menu -bind = $mainMod CTRL, Return, exec, $menu_opt bind = $mainMod, C, killactive, bind = $mainMod SHIFT, C, exec, hyprctl kill bind = $mainMod SHIFT, Q, exit, -- cgit v1.2.3 From c5ad1cf51c8f276036385103991f318dcdfc1523 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:34:14 +0200 Subject: [remap] removed window reappings --- config/essentials/nvim/lua/user/remap.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/essentials/nvim/lua/user/remap.lua b/config/essentials/nvim/lua/user/remap.lua index e59b81a..c50d346 100644 --- a/config/essentials/nvim/lua/user/remap.lua +++ b/config/essentials/nvim/lua/user/remap.lua @@ -18,12 +18,6 @@ vim.keymap.set("n", "Q", "qa!", { noremap = true }) -- close all except focused buffer vim.keymap.set("n", "1", "%bd|e#", { noremap = true }) --- Windows -vim.keymap.set("n", "", "h", { noremap = true }) -vim.keymap.set("n", "", "j", { noremap = true }) -vim.keymap.set("n", "", "k", { noremap = true }) -vim.keymap.set("n", "", "l", { noremap = true }) -vim.keymap.set("n", "", "o", { noremap = true }) -- command line vim.keymap.set("c", "", "", { noremap = true }) vim.keymap.set("c", "", "", { noremap = true }) -- cgit v1.2.3 From 8fde4230fb9863925b59ace8ba9132332581e8a9 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:34:31 +0200 Subject: [packer] updated telescope tag --- config/essentials/nvim/lua/user/packer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/essentials/nvim/lua/user/packer.lua b/config/essentials/nvim/lua/user/packer.lua index c9e27a2..9351460 100644 --- a/config/essentials/nvim/lua/user/packer.lua +++ b/config/essentials/nvim/lua/user/packer.lua @@ -3,7 +3,7 @@ return require('packer').startup(function(use) -- files use { - 'nvim-telescope/telescope.nvim', tag = '0.1.1', + 'nvim-telescope/telescope.nvim', tag = '0.1.2', requires = { {'nvim-lua/plenary.nvim'} } } use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } -- cgit v1.2.3 From da3519041baaa3127559ba7420848808b3525772 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 00:36:29 +0200 Subject: [tmux] added username to status --- config/common/tmux/tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index e74713a..6bfa47e 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -102,7 +102,7 @@ set -g status-position top set -g window-status-current-style "underscore" set -g status-justify left set -g status-left "#[fg=black,bg=blue,bold] #S #[fg=blue,bg=black,nobold,noitalics,nounderscore]" -set -g status-right "#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %H:%M #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H " +set -g status-right "#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %H:%M #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] #{client_user} #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H " #+--- Colors ---+ set -g status-style bg=black,fg=white -- cgit v1.2.3 From f2633b8d228ddc78a4996822770387ec34687f45 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 25 Aug 2023 22:52:20 +0200 Subject: [tmux] added format for window title string --- config/common/tmux/tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index 6bfa47e..80ab9ca 100755 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -97,6 +97,7 @@ set -g status on #+ Status + #+--------+ #+--- Layout ---+ +set -g set-titles-string "[#S:#I] #T" set -g set-titles on set -g status-position top set -g window-status-current-style "underscore" -- cgit v1.2.3 From cf31b107005e5342cd181277be35f570247a70f6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 27 Aug 2023 12:50:54 +0200 Subject: [commander] added verbose option --- bin/menuscripts/commander | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/menuscripts/commander b/bin/menuscripts/commander index 028e8a7..78a27c9 100755 --- a/bin/menuscripts/commander +++ b/bin/menuscripts/commander @@ -21,7 +21,12 @@ numbered prefix' cleanup() { rm -f "$tmp"; } -logn() { >&2 printf '%s\n' "$@"; } + +logn() +{ + [ "${log_on:=0}" -eq 0 ] && return + >&2 printf '%s\n' "$@" +} run() { IFS=: @@ -240,7 +245,7 @@ main() do eval "$option=0" done - while getopts ":cdhilop:nrsx" opt + while getopts ":cdhilop:nrsxv" opt do # shellcheck disable=SC2034 case $opt in @@ -266,6 +271,7 @@ main() s) instant=1 ;; # invert prefix matching x) prefix=1 ;; + v) log_on=1 ;; :) logn "Option '-$OPTARG' requires an argument" @@ -300,11 +306,11 @@ main() if command -v pre_cmd > /dev/null then pre_cmd > "$tmp" - >&2 printf "menuopts: %s\n" "$menuopts" + logn "menuopts: $menuopts" # shellcheck disable=SC2086 pre_filter < "$tmp" | menucmd $menuopts | post_filter else - >&2 printf "menuopts: %s\n" "$menuopts" + logn "menuopts: $menuopts" # shellcheck disable=SC2086 pre_filter | menucmd $menuopts | post_filter fi -- cgit v1.2.3 From 2877c527c52909d5735e9b2c1c7905bb22bc4d87 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 27 Aug 2023 12:51:13 +0200 Subject: [commander] added placeholder instant function --- bin/menuscripts/commander | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/menuscripts/commander b/bin/menuscripts/commander index 78a27c9..ff58a56 100755 --- a/bin/menuscripts/commander +++ b/bin/menuscripts/commander @@ -227,6 +227,8 @@ main() add_option '--print-query' } + instant() { :; } + prefix() { :; } prompt() { add_option "--prompt" "$prompt_arg"; } -- cgit v1.2.3 From 333aaf38c66a1e4ba41d3acea38b21613c0075b2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 27 Aug 2023 12:53:48 +0200 Subject: [functions] grouped oneliners together --- config/essentials/zsh/functions.zsh | 50 ++++++++++--------------------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 7a94207..22a8fbe 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -3,18 +3,11 @@ log() { >&2 printf '%s' "$@"; } logn() { >&2 printf '%s\n' "$@"; } -awnk() { - awk "{print \$$1}" -} - vmp() { col -b | \ vim -MR \ -c 'set ft=man nolist nonu nornu' } -vimh() { - vim -c "help $1" -c 'call feedkeys("\o")' -} nvf() { local cache="$HOME/.cache/nvf" local match="$(grep -m1 "$1$" "$cache" 2> /dev/null)" @@ -61,14 +54,17 @@ ogo() _googoo_fzf_opt "$1" cd "$(dirname "$(goo f "$dest" | fzf $opt)")" } -dgo() -{ - cd "$(goo d | fzf --filter "$@" | head -n 1)" -} -open() -{ - $EDITOR "$(goo f | fzf --filter "$@" | head -n 1)" -} + +# Onelineres +awnk() { awk "{print \$$1}"; } +vimh() { vi -c "help $1" -c 'call feedkeys("\o")'; } +dgo() { cd "$(goo d ~ | fzf --filter "$@" | head -n 1)"; } +open() { $EDITOR "$(goo f ~ | fzf --filter "$@" | head -n 1)"; } +pkbs() { pkgfile -b "$1" | tee /dev/stderr | doas pacman -S -; } +oclip() { printf "\033]52;c;$(echo -n "$@" | base64)\a"; } +sms() { ssh phone sendmsg "$1" "'$2'"; } +trcp() { scp "$1" db:/media/basilisk/downloads/transmission/torrents/; } +rln() { ln -s "$(readlink -f "$1")" "$2"; } ipc() { @@ -125,7 +121,8 @@ upfile() { curl -F "file=@\"$1\"" ${2:-https://upfast.cronyakatsuki.xyz} } -sgd () { +# git +sgd() { d="$PWD" find $HOME/src -maxdepth 1 -mindepth 1 -type d | while read -r dir @@ -242,10 +239,6 @@ pacsize() expac '%m %n' - | numfmt --to=iec-i --suffix=B --format="%.2f" } -pkbs() -{ - pkgfile -b "$1" | tee /dev/stderr | doas pacman -S - -} mime-default () { @@ -276,21 +269,6 @@ fpass() { xargs pass show -c } -oclip() -{ - printf "\033]52;c;$(echo -n "$@" | base64)\a" -} - -sms() -{ - ssh phone sendmsg "$1" "'$2'" -} - -trcp() -{ - scp "$1" db:/media/basilisk/downloads/transmission/torrents/ -} - muttmail() { log "email set: " @@ -309,5 +287,3 @@ resize() return 1 convert -resize $1^ -gravity center -crop $1+0+0 -- "$2" "${3:-$1}" } - -rln() { ln -s "$(readlink -f "$1")" "$2"; } -- cgit v1.2.3