KDE Plasma commands

Query the current KDE Plasma activity and desktop name through qdbus and wmctrl aliases.

1 min read Updated

Small KDE Plasma helpers that query the current activity and desktop through qdbus and wmctrl, exposed as shell aliases. They are useful in status bars, window rules or scripts that need to know which activity is active. The aliases are listed below.

  • Activity ID
  • Activity Name
  • Desktop Name

~/.bash_aliases

text
alias activity-id='qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity'
alias activity-name='qdbus org.kde.ActivityManager /ActivityManager/Activities ActivityName `qdbus org.kde.ActivityManager /ActivityManager/Activities CurrentActivity`'
alias desktop-name="wmctrl -d | grep -e '*' | sed -E 's/.*[0-9]+,[0-9]+ [0-9]+x[0-9]+ +([a-zA-Z0-9 _-]+)/\1/p' | tac | egrep -m 1 ."

Search articles

Type to filter articles. Use the arrow keys to move through results and Enter to open one. Press Escape to close.