diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-08-01 15:37:58 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-08-01 15:37:58 +0200 |
| commit | aefd78cedc43ca70b1f589df8ad1ca5bcbe42ddc (patch) | |
| tree | 8ffae5894bb1d3fe2223beab4fa188c3c1523a0b /termy | |
| parent | 4595be05ff14bca88141394d1a6e52d9c417e317 (diff) | |
| download | dotfiles-aefd78cedc43ca70b1f589df8ad1ca5bcbe42ddc.tar.gz dotfiles-aefd78cedc43ca70b1f589df8ad1ca5bcbe42ddc.zip | |
Add termy
Diffstat (limited to 'termy')
| -rw-r--r-- | termy | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# if app is not open then launch it -- remove this if you don't want your +# shortcut to launch the application if it hasn't been launched yet +if [ -z "$(xdotool search --class konsole)" ]; then + konsole +fi + +# get current focused window and visible konsole window +CLASS="konsole" +ACTIVE_WINDOW="$(xdotool getactivewindow)" +APP_WINDOW="$(xdotool search --onlyvisible --class $CLASS)" + +# if focused, minimize and hide the konsole, otherwise bring konsole to current desktop and open +if [ "$ACTIVE_WINDOW" = "$APP_WINDOW" ]; then + xdotool getactivewindow windowminimize +else + wmctrl -xR "$CLASS" +fi + |
