feat(rumno): tune notification rules and timeout handling
This commit is contained in:
@@ -218,16 +218,14 @@ windowrule = match:title ^(Confirm)$, float on
|
|||||||
|
|
||||||
# Rumno OSD/notifications: treat as an overlay, not a "real" managed window.
|
# Rumno OSD/notifications: treat as an overlay, not a "real" managed window.
|
||||||
# (Matches both class and title because rumno may set either depending on backend.)
|
# (Matches both class and title because rumno may set either depending on backend.)
|
||||||
windowrulev2 = float, class:.*[Rr]umno.*
|
windowrule = match:class ^(.*[Rr]umno.*)$, float on
|
||||||
windowrulev2 = pin, class:.*[Rr]umno.*
|
windowrule = match:class ^(.*[Rr]umno.*)$, pin on
|
||||||
windowrulev2 = noborder, class:.*[Rr]umno.*
|
windowrule = match:class ^(.*[Rr]umno.*)$, decorate off
|
||||||
windowrulev2 = noshadow, class:.*[Rr]umno.*
|
windowrule = match:class ^(.*[Rr]umno.*)$, no_shadow on
|
||||||
windowrulev2 = noinitialfocus, class:.*[Rr]umno.*
|
windowrule = match:title ^(.*[Rr]umno.*)$, float on
|
||||||
windowrulev2 = float, title:.*[Rr]umno.*
|
windowrule = match:title ^(.*[Rr]umno.*)$, pin on
|
||||||
windowrulev2 = pin, title:.*[Rr]umno.*
|
windowrule = match:title ^(.*[Rr]umno.*)$, decorate off
|
||||||
windowrulev2 = noborder, title:.*[Rr]umno.*
|
windowrule = match:title ^(.*[Rr]umno.*)$, no_shadow on
|
||||||
windowrulev2 = noshadow, title:.*[Rr]umno.*
|
|
||||||
windowrulev2 = noinitialfocus, title:.*[Rr]umno.*
|
|
||||||
|
|
||||||
# Scratchpad sizing handled by hyprscratch exec rules (see hyprland.nix)
|
# Scratchpad sizing handled by hyprscratch exec rules (see hyprland.nix)
|
||||||
# Using hyprscratch rules instead of windowrule to avoid affecting child windows (e.g. Slack meets)
|
# Using hyprscratch rules instead of windowrule to avoid affecting child windows (e.g. Slack meets)
|
||||||
|
|||||||
@@ -130,11 +130,12 @@ getAverageBrightness = do
|
|||||||
-- Send notification using rumno if available
|
-- Send notification using rumno if available
|
||||||
sendNotification :: Int -> IO ()
|
sendNotification :: Int -> IO ()
|
||||||
sendNotification brightness = do
|
sendNotification brightness = do
|
||||||
|
let timeoutSeconds = "2.5"
|
||||||
rumnoExists <- (== ExitSuccess) <$>
|
rumnoExists <- (== ExitSuccess) <$>
|
||||||
rawSystem "sh" ["-c", "command -v rumno >/dev/null 2>&1"]
|
rawSystem "sh" ["-c", "command -v rumno >/dev/null 2>&1"]
|
||||||
if rumnoExists
|
if rumnoExists
|
||||||
then do
|
then do
|
||||||
_ <- readProcess "rumno" ["notify", "-b", show brightness] ""
|
_ <- readProcess "rumno" ["notify", "-t", timeoutSeconds, "-b", show brightness] ""
|
||||||
return ()
|
return ()
|
||||||
else putStrLn (show brightness)
|
else putStrLn (show brightness)
|
||||||
|
|
||||||
|
|||||||
@@ -83,10 +83,11 @@ fi
|
|||||||
|
|
||||||
# Get current brightness percentage for display
|
# Get current brightness percentage for display
|
||||||
BRIGHTNESS=$(get_brightness_percentage)
|
BRIGHTNESS=$(get_brightness_percentage)
|
||||||
|
RUMNO_TIMEOUT="${RUMNO_TIMEOUT:-2.5}"
|
||||||
|
|
||||||
# Show notification if rumno is available
|
# Show notification if rumno is available
|
||||||
if command -v rumno &> /dev/null; then
|
if command -v rumno &> /dev/null; then
|
||||||
rumno notify -b "$BRIGHTNESS"
|
rumno notify -t "$RUMNO_TIMEOUT" -b "$BRIGHTNESS"
|
||||||
else
|
else
|
||||||
echo "$BRIGHTNESS"
|
echo "$BRIGHTNESS"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
function pashowvolume {
|
function pashowvolume {
|
||||||
|
timeout="${RUMNO_TIMEOUT:-2.5}"
|
||||||
if paismuted; then
|
if paismuted; then
|
||||||
rumno notify -m
|
rumno notify -t "$timeout" -m
|
||||||
else
|
else
|
||||||
actual=$(pavolume)
|
actual=$(pavolume)
|
||||||
max=100
|
max=100
|
||||||
show=$(( actual < max ? actual : max ))
|
show=$(( actual < max ? actual : max ))
|
||||||
rumno notify -v "$show"
|
rumno notify -t "$timeout" -v "$show"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pashowvolume
|
pashowvolume
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user