Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh -e
APPNAME=$(basename $0)
CON_NAME=$1
DATA_DIR="$HOME/.local/share/distrobox/$CON_NAME"
if ! [ $CON_NAME ]
then
echo "Usage:\n\t$APPNAME <container_name>"
exit 1
@iguanajuice
iguanajuice / scratchpad.sh
Last active May 2, 2025 06:39
Use fuzzel to focus windows in Sway's scratchpad
#!/bin/sh
pkill fuzzel && exit
LIST=`swaymsg -t get_tree | jq -r '
.nodes[].nodes[].floating_nodes[] |
select(.marks==[] and .scratchpad_state!="none") |
"[\(.id)] \(.name)"
'`
@iguanajuice
iguanajuice / swaywait.sh
Last active January 26, 2025 07:11
Run a sway command when a window appears. Like `for_window` but temporary.
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Usage: swaywait [app_id/class] [sway_command]"
exit 1
fi
TARGET=$1
COMMAND=$2