From 19c5507dbc260e32b1e9932b54818900f1a43c97 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 18 Oct 2022 21:08:50 -0700 Subject: Add simple README --- README.org | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 README.org (limited to 'README.org') diff --git a/README.org b/README.org new file mode 100644 index 0000000..052905c --- /dev/null +++ b/README.org @@ -0,0 +1,29 @@ +#+title: Run-or-raise for Herbstluftwm +#+options: toc:nil num:nil + +A script that switches between windows matching the same window class. If no such window can be found, treat the rest of the command line as the command to start. + +* Requirements + +This script depends on [[https://scsh.net/][scsh]], [[https://herbstluftwm.org/][herbstluftwm]], [[http://tripie.sweb.cz/utils/wmctrl/][wmctrl]], and [[https://code.ryuslash.org/util/tom/hlwm-switch-to-window/][hlwm-switch-to-window]]. + +* Installation + +Put the =hlwm-run-or-raise= script anywhere in your =$PATH=. + +* Usage + +Call the =hlwm-run-or-raise= script with 2 or more arguments: + +- class :: The first argument is the class of the window to look for. This is a regular expression, so that multiple classes can be specified at once. This is matched against the =WM_CLASS= window property (see the output of =xprop=). +- command :: Any other command-line arguments are used to start the program that should create a window with the given class. + +** Examples + +This call will switch between any windows with the class “Emacs”, or start the program =emacsclient --create-frame= if no windows with that class can be found. + +: hlwm-run-or-raise Emacs emacsclient --create-frame + +This call will switch between windows with any of the classes “URxvt”, “Hyper”, or “kitty”. If no window with any of those classes is found, the program =kitty= is called to create one. + +: hlwm-run-or-raise "\(URxvt\|Hyper\|kitty\)" kitty -- cgit v1.2.3-54-g00ecf