]> Freerunner's - dotfiles.git/commitdiff
scripts: update kks helpers, xdg-debug helper, etc.
authorAndre Ramnitz <tux.rising@gmail.com>
Fri, 23 Jan 2026 18:29:10 +0000 (19:29 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Fri, 23 Jan 2026 19:02:29 +0000 (20:02 +0100)
12 files changed:
dot-local/bin/debug_xdg.sh [new file with mode: 0755]
dot-local/bin/hyprconfig [new file with mode: 0755]
dot-local/bin/kks-buffers
dot-local/bin/kks-files
dot-local/bin/kks-git-files
dot-local/bin/kks-grep
dot-local/bin/kks-mru
dot-local/bin/kks-select
dot-local/bin/mkchroot2_wip [new file with mode: 0755]
dot-local/bin/wp+
dot-local/bin/wp-
dot-local/bin/wp-vol

diff --git a/dot-local/bin/debug_xdg.sh b/dot-local/bin/debug_xdg.sh
new file mode 100755 (executable)
index 0000000..d4cc594
--- /dev/null
@@ -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 (executable)
index 0000000..fd86e99
--- /dev/null
@@ -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
+
index e8a7a03bba763bcabfb66dee5831ca8a4b1afff7..5e83c2e4d7e400e00d94b89d7645dd8918e38da2 100755 (executable)
@@ -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}')" \
index a5f88ee5a47cbec31bbfde50e59ac352411ac81a..3fccb2514d445b9130bcc1d1f5b49e7de8a93202 100755 (executable)
@@ -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"
index 084dcca57a2eed62664790da8d70fcd59bd973af..5343ab6c992176555495e7e2ebd3b34bf712080e 100755 (executable)
@@ -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"
index 5ca9c88e091feef15640f8acf6acfbf4bcca31d5..aef6f1b3eb613f3a8205b0f2bf8c43ec54807d3d 100755 (executable)
@@ -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
index 62dfd0ee3af2149b0ae52ebd8830ed570a2b2971..2586044a3443077a1d3ae2c3d9d4c8063792735c 100755 (executable)
@@ -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
index 13f7574a491210ee9b549635de04f92df76beaa8..f75f55f1f9cda950138698ee78ca6bbf38c21af5 100755 (executable)
@@ -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 (executable)
index 0000000..21186b8
--- /dev/null
@@ -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"
+
index c322885e179964689c9e04f1721b99e829b6c054..d6256277b31ba0015b1c8e3d8cf739ea7ea39b88 100755 (executable)
@@ -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}%"
 
index 4118dd7ced0d3e6a2e579bcde2f4073384e5f97f..f5e2c0d977952dad63037a810790337510f1b275 100755 (executable)
@@ -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}%"
 
index 0808b662cc31bf4cb2f87b7cf1c50f649d535500..63b8004cac02fbbba5261975d46c6c51ab764052 100755 (executable)
@@ -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}%"