From 216bc9e422ea2cc0f182f687e3a4f9583ae5921a Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Fri, 5 Sep 2025 10:09:59 -0400 Subject: [PATCH] Migrate to KDE6 utilities --- zshrc.org | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/zshrc.org b/zshrc.org index c5770ca..9597c09 100644 --- a/zshrc.org +++ b/zshrc.org @@ -102,20 +102,26 @@ 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 -The other two swap between build and src dirs on my local git checkout - #+begin_src sh :tangle kde-utils.sh #!/bin/zsh function kde-current-activity () { - qdbus >/dev/null && kactivities-cli --current-activity | awk {'print $2'} + qdbus6 org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity } function kde-current-activity-name () { - qdbus >/dev/null && kactivities-cli --current-activity | awk {'print $3'} + qdbus6 org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.ActivityName `kde-current-activity` } - local kde_src_basedir="/scratch/src/kde" - local kde_build_basedir="/scratch/src/kde/build" +#+end_src + +- ~kde-cd-build~ changes directory to the build dir of the current + project +- ~kde-cd-src~ changes directory to the src dir of the current + project + +#+begin_src sh :tangle kde-utils.sh + local kde_src_basedir="kde/src" + local kde_build_basedir="kde/build" function kde-cd-build () { cd ${PWD/$kde_src_basedir/$kde_build_basedir/} @@ -126,11 +132,11 @@ The other two swap between build and src dirs on my local git checkout } #+end_src -Send a message through OSD +- ~kde-osd-message~ Sends a message through OSD #+begin_src sh :tangle kde-utils.sh function kde-osd-message() { - qdbus org.freedesktop.Notifications /org/kde/osdService org.kde.osdService.showText alert $1 + qdbus6 org.freedesktop.Notifications /org/kde/osdService org.kde.osdService.showText alert $1 } #+end_src