aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2024-03-20 21:24:03 -0400
committertdro <tdro@users.noreply.github.com>2024-03-20 21:24:03 -0400
commit37d616cf4b9793e3ff2e54f571164877af6b18c4 (patch)
tree84e66ebf421036d5ba3ac6552f66fa53cbcf6e69
parentb40c0f34c3d7cc043e2a714195b5b9643e4cce2c (diff)
downloaddotfiles-37d616cf4b9793e3ff2e54f571164877af6b18c4.tar.gz
dotfiles-37d616cf4b9793e3ff2e54f571164877af6b18c4.tar.bz2
dotfiles-37d616cf4b9793e3ff2e54f571164877af6b18c4.zip
.local/bin/seance: List windows
-rwxr-xr-x.local/bin/seance17
1 files changed, 10 insertions, 7 deletions
diff --git a/.local/bin/seance b/.local/bin/seance
index 9013b87..1dcaf36 100755
--- a/.local/bin/seance
+++ b/.local/bin/seance
@@ -27,6 +27,7 @@ Configuration: $spirits
$program list List saved programs.
$program config View current configuration.
$program search Search for a running program.
+ $program windows List running programs
$program start Restore previous session.
$program -h --help Show this help menu.
@@ -40,9 +41,9 @@ mkdir --parents "$directory"
touch "$spirits"
commit() {
- ps aux |
- awk '$1 == "'"$(whoami)"'" { $1=$2=$3=$4=$5=$6=$7=$8=$9=$10=""; print $0 }' |
- awk '!deduplicate[$0]++ { $1=$1; printf "%s &\n", $0 }'
+ ps aux \
+ | awk '$1 == "'"$(whoami)"'" { $1=$2=$3=$4=$5=$6=$7=$8=$9=$10=""; print $0 }' \
+ | awk '!deduplicate[$0]++ { $1=$1; printf "%s &\n", $0 }'
}
[ "${1:-}" = "commit" ] &&
@@ -50,12 +51,14 @@ commit() {
printf 'Session %s canonized.\n' "$session" &&
exit
-[ "${1:-}" = "list" ] && cat "$session" && exit;
+[ "${1:-}" = "list" ] && cat "$session" && exit;
-[ "${1:-}" = "config" ] && cat "$spirits" && exit;
+[ "${1:-}" = "config" ] && cat "$spirits" && exit;
-[ "${1:-}" = "search" ] && commit | grep --ignore-case -- "$2" | head --lines=1 && exit;
+[ "${1:-}" = "windows" ] && wmctrl -lp && exit;
-[ "${1:-}" = "start" ] && /bin/sh "$session" && exit;
+[ "${1:-}" = "search" ] && commit | grep --ignore-case -- "$2" | head --lines=1 && exit;
+
+[ "${1:-}" = "start" ] && /bin/sh "$session" && exit;
help && printf "Error: Unknown argument '%s'.\n\n" "$@" && exit 1;