dotfiles

custom linux config files managed with gnu stow

dotfiles

wmutils/bin/deletelock.sh


#!/bin/sh
#
# wildefyr - 2015 (c) wtfpl
# toggle delete lock for current window

usage() {
    echo "usage: $(basename {{&blob}}) <lock|unlock|toggle|status> <wid>"
    exit 1
}

wid=$(pfw)

case  in
    0x*)
        wid=
        ;;
    *)
        usage
        ;;
esac

case  in
    lock)
        xprop -id $wid -f _WMUTILS_DELETELOCK 8i -set _WMUTILS_DELETELOCK '1'
        ;;
    unlock)
        xprop -id $wid -remove _WMUTILS_DELETELOCK
        ;;
    toggle)
        lockStatus=$(xprop -id $wid _WMUTILS_DELETELOCK | cut -d\  -f 3)
        case $lockStatus in
            1)
                $(basename {{&blob}}) unlock $wid 
                ;;
            *)
                $(basename {{&blob}}) lock $wid 
                ;;
        esac
        ;;
    status)
        lockStatus=$(xprop -id $wid _WMUTILS_DELETELOCK | cut -d\  -f 3)
        case $lockStatus in
            1)
                echo "1"
                ;;
            *)
                echo "0"
                ;;
        esac
        ;;
    *)
        usage
        ;;
esac

Download

raw zip tar