This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
THIS=$(basename $(realpath $0)) | |
USAGE="'find' GNU cheatsheet/wrapper | |
* for quicker/simpler '-prune' switch mecanism, avoiding traversing unwanted directories, | |
* while having a quick toggling of 'permission denied' errors to /dev/null | |
/!\ without playing/falling in '! -readable' trap | |
usage: | |
${THIS} /path/to/search [${THIS} OPTIONS] [any other 'find' args, ex: -name '*pattern*'] | |
-h | -help | --help : print this help and exit | |
-e : don't redirect stderr to /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## wrapper to window manager focus an already running software or execute it | |
BIN_NAME=$(basename $0) | |
WM_CLASS=$BIN_NAME.$(echo "$BIN_NAME" | sed 's/.*/\u&/') # capitalise BIN_NAME | |
[ $# -gt 0 ] && BIN_ARGS="$@" | |
#~ echo wmx -c $WM_CLASS -b /usr/bin/$BIN_NAME $BIN_ARGS | |
wmx -c $WM_CLASS -b /usr/bin/$BIN_NAME $BIN_ARGS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## window manager focus an already running software / iconify it / run it / pass it args :: r2blue=6E9AD7 | |
USAGE=" | |
Usage: $(basename $0) -c WM_NAME [-e] [-a] [-i] [-f NAME_FOCUS] [-v NAME_PRUNE] [-b BIN_PATH] [BIN_ARGS] | |
-e check only (returning window hex id if running) | |
-a do not limit to user($(whoami)) when checking window hex id | |
-u when already running, bypass any provided args (focus only) | |
-g switch to next window with same class (focus only) | |
-f NAME_FOCUS : targeted title window name | |
-v NAME_PRUNE : comma separated list of title window names to exclude |