From: Andre Ramnitz Date: Fri, 23 Jan 2026 18:29:10 +0000 (+0100) Subject: scripts: update kks helpers, xdg-debug helper, etc. X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=98563d2a4ba9141eaee0cee494792f350e242877;p=dotfiles.git scripts: update kks helpers, xdg-debug helper, etc. --- diff --git a/dot-local/bin/debug_xdg.sh b/dot-local/bin/debug_xdg.sh new file mode 100755 index 00000000..d4cc594c --- /dev/null +++ b/dot-local/bin/debug_xdg.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "XDG_SESSION_TYPE = $XDG_SESSION_TYPE" +echo "XDG_SESSION_DESKTOP = $XDG_SESSION_DESKTOP" +echo "XDG_CURRENT_DESKTOP = $XDG_CURRENT_DESKTOP" + +echo "DBUS_SESSION_BUS_ADDRESS = $DBUS_SESSION_BUS_ADDRESS" + +echo "XDG_MENU_PREFIX = $XDG_MENU_PREFIX" + +echo "QT_QPA_PLATFORMTHEME = $QT_QPA_PLATFORMTHEME" diff --git a/dot-local/bin/hyprconfig b/dot-local/bin/hyprconfig new file mode 100755 index 00000000..fd86e992 --- /dev/null +++ b/dot-local/bin/hyprconfig @@ -0,0 +1,25 @@ +#!/bin/bash + +CONFS=(hyprland hypridle hyprlauncher hyprlock hyprpaper hyprqt6engine noctalia/noctalia-colors) + +mapfile -d '' FRAGMENTS < <( find "$HOME/.config/hypr/fragments" -maxdepth 1 -type f -print0 ) +# mapfile -d '' FRAGMENTS < <( find "$HOME/.config/hypr/scripts" -maxdepth 1 -type f -print0 ) + +ALLFILES=() +for conf in "${CONFS[@]}"; do + ALLFILES+=("$HOME/.config/hypr/${conf}.conf") +done + +for fragment in "${FRAGMENTS[@]}"; do + ALLFILES+=("${fragment}") +done + +# for script in "${SCRIPTS[@]}"; do +# ALLFILES+=("${script}") +# done + +kak "${ALLFILES[@]}" + +# echo "BASH_VERSION=$BASH_VERSION" +# declare -p ALLFILES + diff --git a/dot-local/bin/kks-buffers b/dot-local/bin/kks-buffers index e8a7a03b..5e83c2e4 100755 --- a/dot-local/bin/kks-buffers +++ b/dot-local/bin/kks-buffers @@ -10,10 +10,9 @@ preview_cmd="bat --color=always --line-range=:500" history_file="$HOME/.cache/kks-buffers-history" [ -f "$history_file" ] || touch "$history_file" - kks get '%val{buflist}' | - grep -F "$*" | - fzf --height 100% --layout reverse --style full --prompt 'buf> ' --preview "kks cat -b {} | $preview_cmd" \ + grep -F "$*" | sort -r | + fzf --layout reverse --style full --prompt 'buf> ' --preview-window=right,60% --preview "kks cat -b {} | $preview_cmd" \ --header="[c-x] delete, [c-t] new scratch" \ --bind="ctrl-x:execute-silent(kks send -b {} delete-buffer)+reload(kks get '%val{buflist}')" \ --bind="ctrl-t:execute-silent(kks send edit -scratch {q})+reload(kks get '%val{buflist}')" \ diff --git a/dot-local/bin/kks-files b/dot-local/bin/kks-files index a5f88ee5..3fccb251 100755 --- a/dot-local/bin/kks-files +++ b/dot-local/bin/kks-files @@ -12,8 +12,9 @@ history_file="$HOME/.cache/kks-files-history" [ -f "$history_file" ] || touch "$history_file" -fd --type file . "$@" | +fd --type file . "$@" | sort -r --ignore-case | fzf --multi --height 100% --style full --prompt 'files> ' \ + --preview-window=right,60% \ --preview "$preview_cmd {}" --history="$history_file" | while read -r file; do kks edit "$file" diff --git a/dot-local/bin/kks-git-files b/dot-local/bin/kks-git-files index 084dcca5..5343ab6c 100755 --- a/dot-local/bin/kks-git-files +++ b/dot-local/bin/kks-git-files @@ -13,6 +13,7 @@ history_file="$HOME/.cache/kks-files-history" git ls-files --full-name "$(git rev-parse --show-toplevel)" "$@" | fzf --multi --height 100% --style full --prompt 'files> ' \ + --preview-window=right,60% \ --preview "$preview_cmd {}" --history="$history_file" | while read -r file; do kks edit "$file" diff --git a/dot-local/bin/kks-grep b/dot-local/bin/kks-grep index 5ca9c88e..aef6f1b3 100755 --- a/dot-local/bin/kks-grep +++ b/dot-local/bin/kks-grep @@ -15,6 +15,7 @@ query="" rg --vimgrep '.+' "$@" | SHELL=sh fzf --delimiter=":" --query="$query" --height="100%" --prompt="grep> " --history="$history_file" \ + --preview-window=right,60% \ --preview='range="$(echo {2}-5 | bc | sed "s/^-.*/0/"):$(echo {2}+20 | bc)"; bat -r "$range" -n --color always -H {2} {1}' | awk -F':' '{print $1 " " "+" $2 ":" $3 }' | xargs -r kks edit diff --git a/dot-local/bin/kks-mru b/dot-local/bin/kks-mru index 62dfd0ee..2586044a 100755 --- a/dot-local/bin/kks-mru +++ b/dot-local/bin/kks-mru @@ -18,4 +18,5 @@ preview_cmd="bat --color=always --line-range=:500" (fzf --height 100% --prompt 'mru> ' --style full --preview "$preview_cmd {}" | + --preview-window=right,60% \ xargs -r kks edit) < ~/.cache/kak-mru diff --git a/dot-local/bin/kks-select b/dot-local/bin/kks-select index 13f7574a..f75f55f1 100755 --- a/dot-local/bin/kks-select +++ b/dot-local/bin/kks-select @@ -10,6 +10,7 @@ command kak -clear kks list | fzf -d '\t*: *' --style full \ + --preview-window=right,60% \ --header="[c-x] kill, [c-t] new, [c-r] reload" \ --bind="ctrl-x:execute-silent(kks kill -s {1})+reload(sleep 0.1; kks list)" \ --bind="ctrl-t:execute-silent(kks new {q})+reload(sleep 0.1; kks list)" \ diff --git a/dot-local/bin/mkchroot2_wip b/dot-local/bin/mkchroot2_wip new file mode 100755 index 00000000..21186b87 --- /dev/null +++ b/dot-local/bin/mkchroot2_wip @@ -0,0 +1,50 @@ +#!/bin/bash + +if [ "$UID" != "0" ]; then + echo "You have to be root" >&2 + exit 1 +fi + +if [ -z "$1" ]; then + echo "Enter absolute path as argument 1" + exit 1 +fi + +if [ ! "$(command ls -A $1/)" ]; then + echo "Target path 1 is empty" + exit 1 +fi + +if [ -z "$2" ]; then + echo "Enter absolute path as argument 2" + exit 1 +fi + +for mountpoint in /sys /dev; do + echo "-- Mounting $mountpoint on $1/$mountpoint/" + mount --rbind "$mountpoint" "$1/$mountpoint/" + mount --make-rslave "$1/$mountpoint/" +done + +for mountpoint in /run; do + echo "-- Mounting $mountpoint on $1/$mountpoint/" + mount --bind "$mountpoint" "$1/$mountpoint/" + mount --make-rslave "$1/$mountpoint/" +done + +for mountpoint in /proc; do + echo "-- Mounting $mountpoint on $1/$mountpoint/" + mount -t proc "$mountpoint" "$1/$mountpoint/" +done + +echo "-- Mounting $1 on $1/$2/" +mkdir -p "$1/$2" +mount "$2" "$1/$2" + +cp "/etc/resolv.conf" "$1/etc/" + +echo "-- Entering chroot" +chroot "$1" "/bin/bash" + +echo "Remember to umount -r $mountpoint" + diff --git a/dot-local/bin/wp+ b/dot-local/bin/wp+ index c322885e..d6256277 100755 --- a/dot-local/bin/wp+ +++ b/dot-local/bin/wp+ @@ -7,5 +7,5 @@ volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) volume=$(echo "$volume" | awk '{print $2}') volume=$(echo "( $volume * 100 ) / 1" | bc) -notify-send -t 1000 -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%" +notify-send -t 500 -u low -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%" diff --git a/dot-local/bin/wp- b/dot-local/bin/wp- index 4118dd7c..f5e2c0d9 100755 --- a/dot-local/bin/wp- +++ b/dot-local/bin/wp- @@ -7,5 +7,5 @@ volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) volume=$(echo "$volume" | awk '{print $2}') volume=$(echo "( $volume * 100 ) / 1" | bc) -notify-send -t 1000 -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%" +notify-send -t 500 -u low -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%" diff --git a/dot-local/bin/wp-vol b/dot-local/bin/wp-vol index 0808b662..63b8004c 100755 --- a/dot-local/bin/wp-vol +++ b/dot-local/bin/wp-vol @@ -5,5 +5,5 @@ volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) volume=$(echo "$volume" | awk '{print $2}') volume=$(echo "( $volume * 100 ) / 1" | bc) -notify-send -t 1000 -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%" +notify-send -t 500 -u low -a 'wp-vol' -h int:value:"$volume" "Volume: ${volume}%"