Skip to content

Instantly share code, notes, and snippets.

@Consolatis
Last active January 15, 2025 09:11
Show Gist options
  • Save Consolatis/fcfc66add2385f9466a50561ea493eb6 to your computer and use it in GitHub Desktop.
Save Consolatis/fcfc66add2385f9466a50561ea493eb6 to your computer and use it in GitHub Desktop.
labwc run or raise or minimize
#!/bin/bash
app_id=magic
executable="foot -a $app_id -o colors.alpha=0.8 -o pad=20x20"
# start if not already there
if ! wlrctl window find app_id:$app_id; then
echo "starting up $executable"
$executable &
disown
exit
fi
if ! wlrctl window minimize state:unminimized app_id:$app_id; then
echo "focusing $app_id"
wlrctl window focus app_id:$app_id
else
echo "minimizing $app_id"
fi
@Consolatis
Copy link
Author

Consolatis commented Jan 15, 2025

May be combined with a window rule like

<windowRules>
	<windowRule identifier="magic" serverDecoration="no">
		<action name="SnapToEdge" direction="up" />
		<action name="ToggleAlwaysOnTop" />
	</windowRule>
</windowRules>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment