wmutils tricks and tips - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
Workspaces can be reduced to a list on windows to show at a given time. Say you start on ws#0. When you "switch" to ws#2, you save the list of currently visible windows, hide them, then get the list of windows on ws#2 and display them.

This would be a good exercise to start digging into wmutils, and make your first script. Here follows an example implementation if needed (don't spoil yourself too quickly ;))
Code:
#!/bin/sh

wsdir="$HOME/.cache/workspace"

usage() {
    echo "usage: $(basename $0) WORKSPACE" >&2
}

ws_current() {
     if [ -e "$wsdir/current" ]; then
        cat "$wsdir/current"
    else
        echo 0
    fi
}

ws_hide() {
    lsw > "$wsdir/$1"
    mapw -u $(lsw)
}

ws_show() {
    if [ -e "$wsdir/$1" ]; then
        xargs mapw -m < "$wsdir/$1"
    fi
    printf '%s\n' > "$wsdir/current"
}

[ -d "$wsdir" ] || mkdir -p "$wsdir"

ws_hide "$(ws_current)"
ws_show "$1"

As for "gaps", you gotta do the maths when coding your own tilesets.


Messages In This Thread
wmutils tricks and tips - by z3bra - 29-08-2015, 05:53 AM
RE: wmutils tricks and tips - by Wildefyr - 29-08-2015, 09:33 AM
RE: wmutils tricks and tips - by dkeg - 29-08-2015, 06:28 PM
RE: wmutils tricks and tips - by z3bra - 31-08-2015, 05:14 AM
RE: wmutils tricks and tips - by dkeg - 31-08-2015, 10:38 AM
RE: wmutils tricks and tips - by Wildefyr - 14-09-2015, 01:55 AM
RE: wmutils tricks and tips - by pranomostro - 14-09-2015, 08:11 AM
RE: wmutils tricks and tips - by dkeg - 14-09-2015, 08:19 AM
RE: wmutils tricks and tips - by pranomostro - 15-09-2015, 08:01 AM
RE: wmutils tricks and tips - by sagittarius - 15-06-2016, 03:58 PM
RE: wmutils tricks and tips - by pranomostro - 15-06-2016, 06:20 PM
RE: wmutils tricks and tips - by xero - 15-06-2016, 06:56 PM
RE: wmutils tricks and tips - by sagittarius - 15-06-2016, 07:06 PM
RE: wmutils tricks and tips - by lemons - 21-07-2016, 01:55 PM
RE: wmutils tricks and tips - by NetherOrb - 25-11-2016, 02:51 PM
RE: wmutils tricks and tips - by z3bra - 25-11-2016, 03:29 PM
RE: wmutils tricks and tips - by pfr - 24-08-2020, 09:43 PM
RE: wmutils tricks and tips - by seninha - 24-08-2020, 10:29 PM
RE: wmutils tricks and tips - by z3bra - 25-08-2020, 09:14 AM
RE: wmutils tricks and tips - by seninha - 25-08-2020, 01:53 PM
RE: wmutils tricks and tips - by z3bra - 26-08-2020, 03:25 AM
RE: wmutils tricks and tips - by pfr - 06-09-2020, 11:34 PM
RE: wmutils tricks and tips - by z3bra - 07-09-2020, 04:49 AM
RE: wmutils tricks and tips - by humky - 13-12-2021, 07:55 PM
RE: wmutils tricks and tips - by z3bra - 14-12-2021, 01:59 PM
RE: wmutils tricks and tips - by pfr - 08-02-2022, 10:04 PM
RE: wmutils tricks and tips - by z3bra - 09-02-2022, 07:22 AM
RE: wmutils tricks and tips - by pfr - 13-06-2023, 09:31 PM