]> Freerunner's - dotfiles.git/commitdiff
scripts: add plasma start/kill scripts...
authorAndre Ramnitz <andre.ramnitz@mail.de>
Sun, 30 Aug 2026 20:18:35 +0000 (22:18 +0200)
committerAndre Ramnitz <andre.ramnitz@mail.de>
Sun, 30 Aug 2026 20:18:35 +0000 (22:18 +0200)
...and some other useful things, too

dot-local/bin/hyprconfig [changed from file to symlink]
dot-local/bin/hyprconfig.bash [new file with mode: 0755]
dot-local/bin/hyprconfig.fish [new file with mode: 0755]
dot-local/bin/kde-xxxx-plasmashell [new file with mode: 0755]
dot-local/bin/kdedown [new file with mode: 0755]
dot-local/bin/kdeup [new file with mode: 0755]
dot-local/bin/prefcore-v3 [new file with mode: 0755]
dot-local/bin/run_after_noctalia.sh
dot-local/bin/upgrayyedd
dot-local/bin/wl-freeze [new symlink]

deleted file mode 100755 (executable)
index ba977b2996b03e647f79ffed4d9b6a5f2c38a99f..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-EDITOR=kak
-
-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
-
-"$EDITOR" "${ALLFILES[@]}"
-
-# echo "BASH_VERSION=$BASH_VERSION"
-# declare -p ALLFILES
-
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..1c8797034d07f731a70c7865f53dd5658d83c06e
--- /dev/null
@@ -0,0 +1 @@
+hyprconfig.fish
\ No newline at end of file
diff --git a/dot-local/bin/hyprconfig.bash b/dot-local/bin/hyprconfig.bash
new file mode 100755 (executable)
index 0000000..bd45ec8
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+dirs=(
+    "$HOME/.config/hypr/"
+    "$HOME/.config/hypr/fragments/"
+)
+
+files=()
+
+for dir in "${dirs[@]}"; do
+    while IFS= read -r -d '' file; do
+        files+=("$file")
+    done < <(find "$dir" -maxdepth 1 -type f -name '*.lua' -print0)
+done
+
+printf '%q\n' "${files[@]}"
+
+kak "${files[@]}"
+
diff --git a/dot-local/bin/hyprconfig.fish b/dot-local/bin/hyprconfig.fish
new file mode 100755 (executable)
index 0000000..663085d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/fish
+
+set files \
+    (find ~/.config/hypr/ -maxdepth 1 -type f -name '*.lua') \
+    (find ~/.config/hypr/fragments -maxdepth 1 -type f -name '*.lua')\
+    (find ~/.config/hypr/noctalia/ -maxdepth 1 -type f -name '*.lua')
+
+kak $files
+
diff --git a/dot-local/bin/kde-xxxx-plasmashell b/dot-local/bin/kde-xxxx-plasmashell
new file mode 100755 (executable)
index 0000000..a87fe71
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+killall plasma_session
+killall plasma-shell
+killall plasma-shutdown
+
diff --git a/dot-local/bin/kdedown b/dot-local/bin/kdedown
new file mode 100755 (executable)
index 0000000..b81a092
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+openrc -U default
diff --git a/dot-local/bin/kdeup b/dot-local/bin/kdeup
new file mode 100755 (executable)
index 0000000..3b5a48b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+openrc -U desktop
diff --git a/dot-local/bin/prefcore-v3 b/dot-local/bin/prefcore-v3
new file mode 100755 (executable)
index 0000000..15bdb0b
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+ccd0_sum=0
+ccd1_sum=0
+
+echo "CCD0:"
+i=0
+while [ "$i" -lt 8 ]; do
+    perf=$(cat "/sys/devices/system/cpu/cpu$i/acpi_cppc/highest_perf")
+    printf "cpu%-2d %s\n" "$i" "$perf"
+    ccd0_sum=$((ccd0_sum + perf))
+    i=$((i + 1))
+done
+
+echo
+echo "CCD1:"
+i=8
+while [ "$i" -lt 16 ]; do
+    perf=$(cat "/sys/devices/system/cpu/cpu$i/acpi_cppc/highest_perf")
+    printf "cpu%-2d %s\n" "$i" "$perf"
+    ccd1_sum=$((ccd1_sum + perf))
+    i=$((i + 1))
+done
+
+ccd0_avg=$((ccd0_sum / 8))
+ccd1_avg=$((ccd1_sum / 8))
+
+echo
+printf "CCD0 average highest_perf: %d\n" "$ccd0_avg"
+printf "CCD1 average highest_perf: %d\n" "$ccd1_avg"
+
+echo
+
+if [ "$ccd0_sum" -lt "$ccd1_sum" ]; then
+    echo "Slower CCD: CCD0"
+    echo "BUILD_CPUS=0-7,16-23"
+    echo "FAST_CPUS=8-15,24-31"
+elif [ "$ccd1_sum" -lt "$ccd0_sum" ]; then
+    echo "Slower CCD: CCD1"
+    echo "BUILD_CPUS=8-15,24-31"
+    echo "FAST_CPUS=0-7,16-23"
+else
+    echo "Both CCDs have identical aggregate highest_perf values."
+fi
+
index cf64c5337347dd2846f9d4dcfcb7d23483948664..059f5fc9a603cbdbaaf2dd359b892cb513826727 100755 (executable)
@@ -1,13 +1,13 @@
 #!/bin/bash
 
-qs -c noctalia-shell > /dev/null 2>&1 &
+qs -c noctalia > /dev/null 2>&1 &
 
 while ! pgrep -x qs >/dev/null; do
     sleep 1
 done
 
 sleep 5;
-qs -c noctalia-shell ipc call wallpaper random all
+# qs -c noctalia-shell ipc call wallpaper random all
 nextcloud > /dev/null 2>&1 &
 qtpass > /dev/null 2>&1 &
 
index 53077a6029061fcf0db13b6d41e4a08bab5cf9fc..1db7d1f34c781a300b2606f37e131d07d414b736 100755 (executable)
@@ -1,40 +1,73 @@
 #!/bin/bash
 
-#make sure we're running gentoo
-grep -i gentoo /etc/os-release || exit
+PORTAGE_CPUS="8-15,24-31"
+BUILD_CGROUP="/sys/fs/cgroup/openrc.portage-cgroup"
 
-declare precmd
-if [[ $(id -u) -ne 0 ]];
-then
-    precmd="sudo"
-else
-    precmd=""
-fi
+# make sure we're root
+root_check(){
+    if [ "$(id -u)" -ne 0 ];then
+        echo ""
+        echo "You have to run this script with sudo"
+        exit 0
+    fi
+}
+
+pin_to_ccd0() {
+    taskset -pc "$PORTAGE_CPUS" $$ >/dev/null || {
+        echo "CPU affinity konnte nicht gesetzt werden"
+        exit 1
+    }
+}
+
+ccd_emerge() {
+    taskset -c "$PORTAGE_CPUS" /usr/bin/emerge "$@"
+}
+
+ccd_make() {
+    taskset -c "$PORTAGE_CPUS" schedtool -D -e make "$@"
+}
+
+run_in_portage_cgroup () {
+    (
+        echo "$BASHPID" > "$BUILD_CGROUP/cgroup.procs" || exit 1
+        exec "$@"
+    )
+}
+
+# make sure we're running gentoo
+grep -i gentoo /etc/os-release || { echo "Dieses System basiert nicht auf Gentoo" && exit 1; }
 
-numcores="$(echo ""$(nproc)"" -4 | bc)"
+numcores="$(echo ""$(nproc)"" /2 | bc)"
+
+cd_to_src(){
+    readlink -f "/usr/src/linux" || { echo "Symlink /usr/src/linux nicht gesetzt oder fehlerhaft" && exit 2; }
+    cd "/usr/src/linux" || { echo "Verzeichniswechsel fehlgeschlagen" && exit 2; }
+}
 
 clean_builddir(){
     make mrproper
-    cp "/usr/src/config-$arg" "./.config" || exit 2
 }
 
-do_build(){
-[[ $(id -u) -ne 0 ]] && sudo -s arg="$1" cores="$numcores" <<'END_OF_SUDO'
-    schedtool -D -e make oldconfig
-    schedtool -D -e make modules_prepare
-    schedtool -D -e make -j"$cores" || exit 2
-    schedtool -D -e make modules_install
-    schedtool -D -e make install
-    emerge @module-rebuild
-END_OF_SUDO
-sudo -k
+call_makejobs(){
+    pin_to_ccd0
+    ccd_make  oldconfig
+    ccd_make  modules_prepare
+    ccd_make  -j"$numcores" || exit 2
+    ccd_make  modules_install
+    ccd_make  install
+    ccd_emerge @module-rebuild
 }
 
-dont_build(){
-    # echo "/usr/src/config-""$1""" "./.config"
-    echo "/usr/src/config-"$1"" "./.config"
+prepare_config(){
+    cp "/usr/src/config-$1" ".config"
+    test -f "./.config" || { echo "Kopieren der config fehlgeschlagen" && exit 2; }
 }
 
+print_version(){
+    echo "Building version:"
+    head -n5 Makefile
+    echo ""
+}
 
 build_timeout(){
     unset key
@@ -46,107 +79,121 @@ case "$1" in
         emerge -puDNg @world
         ;;
     sync|ref|refresh)
-        "$precmd" emaint sync -A
+        root_check
+        emaint sync -A
         ;;
     world|dup)
-        "$precmd" /usr/bin/emerge -avuDNg @world "${@:2}"
+        root_check
+        run_in_portage_cgroup  schedtool -D -e emerge -avuDNg @world "${@:2}"
         exit 0
         ;;
     daily|all)
-        "$precmd" emaint sync -A
-        "$precmd" /usr/bin/emerge -avuDNg @world "${@:2}"
+        root_check
+        emaint sync -A
+        run_in_portage_cgroup  schedtool -D -e emerge -avuDNg @world "${@:2}"
         exit 0
         ;;
-    install|in)
-        "$precmd" /usr/bin/emerge -avg "${@:2}"
+    pkg|in)
+        root_check
+        run_in_portage_cgroup  schedtool -D -e emerge -avg "${@:2}"
         exit 0
         ;;
     skipkernel)
-        "$precmd" /usr/bin/emerge -avuDNg @world --exclude=dist-kernel --exclude=gentoo-kernel --exclude=gentoo-sources --exclude=git-sources "${@:2}"
+        root_check
+        /usr/bin/emerge -avuDNg @world --exclude=dist-kernel --exclude=gentoo-kernel --exclude=gentoo-sources --exclude=git-sources "${@:2}"
         exit 0
         ;;
     preserved)
-        "$precmd" /usr/bin/emerge -av @preserved-rebuild
+        root_check
+        run_in_portage_cgroup  schedtool -D -e emerge -av @preserved-rebuild
         exit 0
         ;;
     wholeworld)
-        "$precmd" /usr/bin/emerge -avuDeg --with-bdeps=y --usepkg=n --binpkg-changed-deps=n --keep-going=y @world --exclude="acct-group/* acct-user/* virtual/* app-eselect/* sys-kernel/* sys-firmware/* dev-python/* dev-java/* dev-ruby/* dev-perl/* dev-lua/* dev-php/* dev-tex/* dev-texlive/* x11-themes/* */*-bin"
+        PORTAGE_CPUS=32
+        root_check
+        schedtool -B -e /usr/bin/emerge -avuDeg --with-bdeps=y --usepkg=n --binpkg-changed-deps=n --keep-going=y @world --exclude="acct-group/* acct-user/* virtual/* app-eselect/* sys-kernel/* sys-firmware/* dev-python/* dev-java/* dev-ruby/* dev-perl/* dev-lua/* dev-php/* dev-tex/* dev-texlive/* x11-themes/* */*-bin"
         exit 0
         ;;
     search|se)
-        "$precmd" /usr/bin/emerge --search "${@:2}"
+        root_check
+        /usr/bin/emerge --search "${@:2}"
         exit 0
         ;;
     clean|rm)
-        "$precmd" /usr/bin/emerge -a --depclean "${@:2}"
+        root_check
+        /usr/bin/emerge -a --depclean "${@:2}"
+        exit 0
+        ;;
+    checkclean)
+        /usr/bin/emerge -apv --depclean "${@:2}"
         exit 0
         ;;
     live)
-        "$precmd" /usr/bin/emerge -av @live-rebuild
+        root_check
+        /usr/bin/emerge -av @live-rebuild
         ;;
     flatpaks)
         flatpak update
         ;;
     kernel-live)
-               cd "/usr/src/linux" || exit 2
+        root_check
+               cd_to_src
                 test -f "./.config" || exit 2
-               echo "Building version:"
-               head -n5 Makefile
+               print_version
                build_timeout
-               echo ""
-               do_build
-               echo "Build completed. Remember to upgrayyedd /usr/src/config-* if necessary."
+               call_makejobs
                exit 0
         ;;
     kernel-gentoo)
+        root_check
                cd "/usr/src/linux" || exit 2
                clean_builddir
-               echo "Building version:"
-               head -n5 Makefile
+               prepare_config "gentoo"
+               print_version
                build_timeout
-               echo ""
-               do_build gentoo
+               call_makejobs
                echo "Build completed. Remember to upgrayyedd /usr/src/config-* if necessary."
                exit 0
         ;;
     kernel-llvm)
+        root_check
                cd "/usr/src/linux" || exit 2
                clean_builddir
-               echo "Building version:"
-               head -n5 Makefile
+               prepare_config "llvm"
+               print_version
                build_timeout
-               echo ""
-               do_build llvm
+               call_makejobs
                echo "Build completed. Remember to upgrayyedd /usr/src/config-* if necessary."
                exit 0
         ;;
     kernel-git)
+        root_check
                cd "/usr/src/linux" || exit 2
                clean_builddir
-               echo "Building version:"
-               head -n5 Makefile
+               prepare_config "git"
+               print_version
                build_timeout
-               echo ""
-               do_build git
+               call_makejobs
                echo "Build completed. Remember to upgrayyedd /usr/src/config-* if necessary."
                exit 0
         ;;
     kernel-server)
+        root_check
                cd "/usr/src/linux" || exit 2
                clean_builddir
-               echo "Building version:"
-               head -n5 Makefile
+               prepare_config "server"
+               print_version
                build_timeout
-               echo ""
-               do_build server
+               call_makejobs
                echo "Build completed. Remember to upgrayyedd /usr/src/config-* if necessary."
                exit 0
         ;;
     clean-kernels)
+        root_check
         echo "Relevant files in /boot:"
-               echo ""
+       echo ""
         command ls -1 --hide='*/' /boot/System.map* /boot/initramfs* /boot/vmlinuz*
-        "$precmd" eclean-kernel -aA -L std
+        eclean-kernel -aA -L std
         ;;
     log)
         grep -i --color=auto "completed" /var/log/emerge.log
@@ -157,10 +204,13 @@ case "$1" in
         echo "note: use 'date -d @[unixtime]' to convert the timestamp"
         ;;
     testify)
-        echo "${@:2}"
-        echo "Precmd is: $precmd"
-        echo "$numcores"
-        dont_build gentoo
+        run_in_portage_cgroup bash -c '
+        echo "PID: $$"
+        echo "cgroup:"
+        cat /proc/$$/cgroup
+        echo "allowed CPUs:"
+        grep Cpus_allowed_list /proc/$$/status
+        '
         ;;
     *)
         printf '\nCurrently available commands:\n\n'
@@ -183,6 +233,7 @@ case "$1" in
        'kernel-git    ' 'build kernel flavor: git' \
        'kernel-server ' 'build kernel flavor: server' \
        ' ' ' ' \
+       'checkclean    ' 'check for orphans' \
        'clean         ' 'clean orphaned packages' \
        'preserved     ' 'clean-up old libraries' \
        'clean-kernels ' 'remove old kernels' \
diff --git a/dot-local/bin/wl-freeze b/dot-local/bin/wl-freeze
new file mode 120000 (symlink)
index 0000000..0c5f1bd
--- /dev/null
@@ -0,0 +1 @@
+/media/source/wl-freeze/wl-freeze
\ No newline at end of file