From: Andre Ramnitz Date: Fri, 25 Sep 2026 00:25:14 +0000 (+0200) Subject: scripts: tweak upgraayyedd und winecleaner X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=HEAD;p=dotfiles.git scripts: tweak upgraayyedd und winecleaner --- diff --git a/dot-local/bin/steam-foot b/dot-local/bin/steam-foot new file mode 100755 index 0000000..4520689 --- /dev/null +++ b/dot-local/bin/steam-foot @@ -0,0 +1,12 @@ +#!/bin/sh + +{ + echo "WAYLAND_DISPLAY=$WAYLAND_DISPLAY" + echo "GAMESCOPE_WAYLAND_DISPLAY=$GAMESCOPE_WAYLAND_DISPLAY" + ls -l "$XDG_RUNTIME_DIR"/gamescope-* +} > /tmp/steam-foot.log 2>&1 + +export WAYLAND_DISPLAY="${GAMESCOPE_WAYLAND_DISPLAY}" + +exec /usr/bin/foot >>/tmp/steam-foot.log 2>&1 + diff --git a/dot-local/bin/upgrayyedd b/dot-local/bin/upgrayyedd index da5100d..25b1c94 100755 --- a/dot-local/bin/upgrayyedd +++ b/dot-local/bin/upgrayyedd @@ -99,6 +99,11 @@ case "$1" in run_in_portage_cgroup schedtool -D -e emerge -avuDNg @world "${@:2}" exit 0 ;; + wbdeps|wbd) + root_check + run_in_portage_cgroup schedtool -D -e emerge -avuDNg --with-bdeps=y --binpkg-changed-deps=y @world "${@:2}" + exit 0 + ;; daily|all) root_check emaint sync -A diff --git a/dot-local/bin/winecleaner b/dot-local/bin/winecleaner index 26f795a..a312496 100755 --- a/dot-local/bin/winecleaner +++ b/dot-local/bin/winecleaner @@ -1,36 +1,75 @@ -#!/bin/bash +#!/usr/bin/env bash + +yes_or_no() { + local answer -function yes_or_no { while true; do - read -rp "$* [y/n]: " yn - case $yn in - [Yy]*) return 0 ;; - [Nn]*) echo "Aborted" ; return 1 ;; + read -r -p "$1 [y/n]: " answer + + case "$answer" in + [Yy]*) + return 0 + ;; + [Nn]*) + return 1 + ;; esac done } -PSOUTPUT="$(pgrep -l exe)" - -echo "Grepping ps for wine executables..." -if [ -n "$PSOUTPUT" ]; then - echo "The following processes have been found:" - echo "$PSOUTPUT" - yes_or_no "Would you like to send sigTERM to all processes?" && pgrep exe | xargs kill - echo "Verifying that all processes have been cleaned..." - sleep 7 - PSOUTPUT="$(pgrep -l exe)" - echo "After sending sigterm to every process, these ones still remain:" - echo "$PSOUTPUT" - yes_or_no "Would you like to send sigKILL to all processes?" && pgrep exe | xargs kill -9 - echo "Verifying that all processes have been cleaned..." - if [ -n "$PSOUTPUT" ]; then - echo "Still some processes around. Please remove them manually..." - echo "$PSOUTPUT" - else - echo "All processes have been cleaned!" - fi -else - echo "No wine executables found" +get_wine_processes() { + pgrep -af '\.exe([[:space:]]|$)' +} + +echo "Searching for Wine executables..." + +processes="$(get_wine_processes)" + +if [[ -z "$processes" ]]; then + echo "No Wine executables found." + exit 0 fi +echo "The following processes have been found:" +printf '%s\n' "$processes" + +if ! yes_or_no "Would you like to send SIGTERM to all processes?"; then + echo "Aborted." + exit 0 +fi + +pkill -f '\.exe([[:space:]]|$)' + +echo "Waiting for processes to terminate..." +sleep 7 + +processes="$(get_wine_processes)" + +if [[ -z "$processes" ]]; then + echo "All processes have been cleaned!" + exit 0 +fi + +echo "The following processes are still running:" +printf '%s\n' "$processes" + +if ! yes_or_no "Would you like to send SIGKILL to all remaining processes?"; then + echo "Some processes remain:" + printf '%s\n' "$processes" + exit 1 +fi + +pkill -9 -f '\.exe([[:space:]]|$)' + +sleep 1 + +processes="$(get_wine_processes)" + +if [[ -n "$processes" ]]; then + echo "Some processes are still running. Please remove them manually:" + printf '%s\n' "$processes" + exit 1 +fi + +echo "All processes have been cleaned!" +