eww mako and wezterm
This commit is contained in:
49
mako/.config/mako/config
Normal file
49
mako/.config/mako/config
Normal file
@@ -0,0 +1,49 @@
|
||||
# Mako notification configuration
|
||||
# Styled to match Sway/Fuzzel/eww theme
|
||||
# Generated from template using ~/.config/update-colors
|
||||
|
||||
# Appearance
|
||||
font=JetBrainsMono Nerd Font 10
|
||||
background-color=#1c2433
|
||||
text-color=#afbbd2
|
||||
border-color=#69C3FF
|
||||
border-size=3
|
||||
border-radius=7
|
||||
width=300
|
||||
height=300
|
||||
margin=5
|
||||
padding=8
|
||||
icon-path=/usr/share/icons/Papirus-Dark
|
||||
|
||||
# Layout
|
||||
anchor=top-right
|
||||
outer-margin=30,0,0,0
|
||||
|
||||
# Behavior
|
||||
default-timeout=6000
|
||||
ignore-timeout=0
|
||||
max-visible=20
|
||||
sort=-time
|
||||
|
||||
# Format - show app name in italics
|
||||
format=<b>%s</b> <i>(%a)</i>\n%b
|
||||
markup=1
|
||||
|
||||
# Mouse bindings - click to focus app, invoke action, and close
|
||||
on-button-left=exec ~/.config/mako/scripts/handle-click $id
|
||||
on-button-middle=none
|
||||
on-button-right=exec makoctl dismiss -n $id
|
||||
|
||||
# Urgency levels
|
||||
[urgency=low]
|
||||
background-color=#212a3b
|
||||
border-color=#405275
|
||||
|
||||
[urgency=normal]
|
||||
background-color=#1c2433
|
||||
border-color=#69C3FF
|
||||
|
||||
[urgency=critical]
|
||||
background-color=#1c2433
|
||||
border-color=#FF738A
|
||||
default-timeout=0
|
||||
49
mako/.config/mako/config.template
Normal file
49
mako/.config/mako/config.template
Normal file
@@ -0,0 +1,49 @@
|
||||
# Mako notification configuration
|
||||
# Styled to match Sway/Fuzzel/eww theme
|
||||
# Generated from template using ~/.config/update-colors
|
||||
|
||||
# Appearance
|
||||
font=JetBrainsMono Nerd Font 10
|
||||
background-color=#$BG
|
||||
text-color=#$FG
|
||||
border-color=#$BORDER
|
||||
border-size=3
|
||||
border-radius=7
|
||||
width=300
|
||||
height=300
|
||||
margin=5
|
||||
padding=8
|
||||
icon-path=/usr/share/icons/Papirus-Dark
|
||||
|
||||
# Layout
|
||||
anchor=top-center
|
||||
outer-margin=30,0,0,0
|
||||
|
||||
# Behavior
|
||||
default-timeout=6000
|
||||
ignore-timeout=0
|
||||
max-visible=20
|
||||
sort=-time
|
||||
|
||||
# Format - show app name in italics
|
||||
format=<b>%s</b> <i>(%a)</i>\n%b
|
||||
markup=1
|
||||
|
||||
# Mouse bindings - click to focus app, invoke action, and close
|
||||
on-button-left=exec ~/.config/mako/scripts/handle-click $id
|
||||
on-button-middle=none
|
||||
on-button-right=exec makoctl dismiss -n $id
|
||||
|
||||
# Urgency levels
|
||||
[urgency=low]
|
||||
background-color=#$BG_BAR
|
||||
border-color=#$TRACK
|
||||
|
||||
[urgency=normal]
|
||||
background-color=#$BG
|
||||
border-color=#$BORDER
|
||||
|
||||
[urgency=critical]
|
||||
background-color=#$BG
|
||||
border-color=#$URGENT
|
||||
default-timeout=0
|
||||
43
mako/.config/mako/scripts/handle-click
Normal file
43
mako/.config/mako/scripts/handle-click
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
# Handle notification click: focus app → invoke action → close
|
||||
# Called by mako with notification ID as parameter
|
||||
|
||||
ID="$1"
|
||||
|
||||
if [ -z "$ID" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get app name from notification using makoctl
|
||||
APPNAME=$(makoctl list | grep -A 2 "^Notification $ID" | grep "App name:" | cut -d: -f2- | xargs)
|
||||
|
||||
# Step 1: Focus the application window in Sway (if app name found)
|
||||
if [ -n "$APPNAME" ]; then
|
||||
# Get the workspace of the window
|
||||
WORKSPACE=$(swaymsg -t get_tree | jq -r ".. | select(.app_id?==\"$APPNAME\" or .window_properties?.class?==\"$APPNAME\") | .workspace" | head -1)
|
||||
|
||||
# If workspace not found, try case-insensitive
|
||||
if [ -z "$WORKSPACE" ] || [ "$WORKSPACE" = "null" ]; then
|
||||
WORKSPACE=$(swaymsg -t get_tree | jq -r ".. | select(.app_id?|test(\"$APPNAME\";\"i\") or .window_properties?.class?|test(\"$APPNAME\";\"i\")) | .workspace" | head -1)
|
||||
fi
|
||||
|
||||
# Switch to the workspace if found
|
||||
if [ -n "$WORKSPACE" ] && [ "$WORKSPACE" != "null" ]; then
|
||||
swaymsg workspace "$WORKSPACE" 2>/dev/null
|
||||
sleep 0.1
|
||||
fi
|
||||
|
||||
# Now focus the window
|
||||
swaymsg "[app_id=\"$APPNAME\"]" focus 2>/dev/null || \
|
||||
swaymsg "[app_id=\"(?i)$APPNAME\"]" focus 2>/dev/null || \
|
||||
swaymsg "[class=\"$APPNAME\"]" focus 2>/dev/null || \
|
||||
swaymsg "[class=\"(?i)$APPNAME\"]" focus 2>/dev/null
|
||||
|
||||
sleep 0.1
|
||||
fi
|
||||
|
||||
# Step 2: Invoke the notification's default action (if any)
|
||||
makoctl invoke -n "$ID" 2>/dev/null
|
||||
|
||||
# Step 3: Dismiss the notification
|
||||
makoctl dismiss -n "$ID" 2>/dev/null
|
||||
Reference in New Issue
Block a user