-
Hello,
I think, once upon a time i found something related to this need, but can't find it now. Any idea ? |
Beta Was this translation helpful? Give feedback.
Answered by
Airblader
Sep 29, 2021
Replies: 2 comments
-
This might be helpful. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tconstans
-
Thanks for the quick pointer ! I've been able to work out the following solution: #! /bin/bash
set -e
set -u
# arg1: class of window to look for - use xprop to get it - pbly in camelcase
# arg2: program to run if given window is not found (optional)
# ex: execOrRaise.sh KeepPassXC keepassxc ~/Documents/Comptes/Database.kdbx
# use something like this in i3 config:
# bindsym $mod+y exec /home/tom/.i3/execOrRaise.sh KeePassXC keepassxc ~/Documents/Comptes/Database.kdbx
class=$1
prog=$class
if [ $# -gt 1 ] ; then
shift
prog=$@
fi
pattern="[class=\"${class}\"]"
i3-msg "${pattern} focus" &> /dev/null || $prog & |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This might be helpful.