From 369b32c0c24def06f6c2a05f7faf40a8f95905bf Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Tue, 18 Nov 2025 09:39:47 -0500 Subject: [PATCH] Fix screen detection I am not 100% sold on the function terminal-size. Don't I need to have it in the script itself? --- zshrc.org | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/zshrc.org b/zshrc.org index e92beb6..621241f 100644 --- a/zshrc.org +++ b/zshrc.org @@ -103,8 +103,35 @@ Then, add helper directory to fpath #+begin_src sh fpath=(~/clones/zshrc/ $fpath) #+end_src +*** urxvt helpers :daily: + #+begin_src sh + function terminal-size () { + case $1 in + 2560x1440) echo 82x71;; + 1080x1920) echo 104x47;; + 2240x1400) echo 71x69;; + esac + } + #+end_src + *** KDE helpers :daily: -Define a number of KDE helpers. +#+begin_src sh :tangle kde-utils.sh + #!/bin/zsh + + function kde-active-output-name () { + qdbus6 org.kde.KWin /KWin org.kde.KWin.activeOutputName + } + + function kde-active-output-resolution () { + kscreen-console outputs | grep $(kde-active-output-name) -A10 | grep "^Size:" 2&>/dev/null | cut -f2 -d'(' | sed -e 's/)//' -e 's/, /x/' + } + + function kde-current-activity-name () { + qdbus6 org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName `kde-current-activity` + } +#+end_src + + Define a number of KDE helpers. - ~kde-current-activity~ returns the id of the current activity - ~kde-current-activity-name~ returns the name of the current activity