mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat: add progress to wired-notify
This commit is contained in:
parent
f09c203f8f
commit
056fe1e7fe
3 changed files with 77 additions and 20 deletions
|
@ -86,6 +86,8 @@
|
||||||
entriesStr =
|
entriesStr =
|
||||||
if value ? _ronType
|
if value ? _ronType
|
||||||
then specialType indent value
|
then specialType indent value
|
||||||
|
else if builtins.isList value
|
||||||
|
then list newIndent value
|
||||||
else let
|
else let
|
||||||
entries = mapAttrsToList toEntry value;
|
entries = mapAttrsToList toEntry value;
|
||||||
entriesStrSpace = concatStringsSep ", " entries;
|
entriesStrSpace = concatStringsSep ", " entries;
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
chromium
|
chromium
|
||||||
feh
|
feh
|
||||||
gamescope
|
gamescope
|
||||||
|
obsidian
|
||||||
pavucontrol
|
pavucontrol
|
||||||
pinentry-gnome # For yubikey, gnome = gtk3 variant
|
pinentry-gnome # For yubikey, gnome = gtk3 variant
|
||||||
thunderbird
|
thunderbird
|
||||||
|
@ -77,6 +78,7 @@
|
||||||
persistence."/persist".directories = [
|
persistence."/persist".directories = [
|
||||||
"projects"
|
"projects"
|
||||||
"Pictures" # config.xdg.userDirs.pictures (infinite recursion)
|
"Pictures" # config.xdg.userDirs.pictures (infinite recursion)
|
||||||
|
".config/obsidian"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,7 @@
|
||||||
name = "${name}_root";
|
name = "${name}_root";
|
||||||
parent = "";
|
parent = "";
|
||||||
hook = mkHook "TR" "TR";
|
hook = mkHook "TR" "TR";
|
||||||
offset = mkVec2 (-50) 50;
|
offset = Vec2 (-50) 50; # Vec2 instead of mkVec2 to not apply scaling.
|
||||||
render_criteria = [];
|
|
||||||
params = struct "NotificationBlock" (unnamedStruct {
|
params = struct "NotificationBlock" (unnamedStruct {
|
||||||
monitor = 0;
|
monitor = 0;
|
||||||
border_width = globalScale * 2;
|
border_width = globalScale * 2;
|
||||||
|
@ -122,33 +121,33 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
mkBody = name: yoffset: [
|
mkBody = name: yOffset: [
|
||||||
{
|
{
|
||||||
name = "${name}_hint";
|
name = "${name}_hint";
|
||||||
parent = "${name}_root";
|
parent = "${name}_root";
|
||||||
hook = mkHook "TL" "TL";
|
hook = mkHook "TL" "TL";
|
||||||
offset = mkVec2 0 yoffset;
|
offset = mkVec2 0 yOffset;
|
||||||
params = struct "ImageBlock" (unnamedStruct {
|
params = struct "ImageBlock" (unnamedStruct {
|
||||||
filter_mode = mkLiteral "Lanczos3";
|
filter_mode = mkLiteral "Lanczos3";
|
||||||
image_type = mkLiteral "Hint";
|
image_type = mkLiteral "Hint";
|
||||||
padding = mkPaddingLrBt 12 0 12 12;
|
padding = mkPaddingLrBt 12 0 12 12;
|
||||||
rounding = globalScale * 9;
|
rounding = globalScale * 9;
|
||||||
scale_height = floor (globalScale * 120);
|
scale_height = floor (globalScale * 128);
|
||||||
scale_width = floor (globalScale * 120);
|
scale_width = floor (globalScale * 128);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "${name}_summary";
|
name = "${name}_summary";
|
||||||
parent = "${name}_hint";
|
parent = "${name}_hint";
|
||||||
hook = mkHook "TR" "TL";
|
hook = mkHook "TR" "TL";
|
||||||
offset = mkVec2 0 12;
|
offset = mkVec2 0 0;
|
||||||
params = struct "TextBlock" (unnamedStruct {
|
params = struct "TextBlock" (unnamedStruct {
|
||||||
text = "%s";
|
text = "%s";
|
||||||
font = "${fonts.sansSerif.name} Bold ${toString (globalScale * 16)}";
|
font = "${fonts.sansSerif.name} Bold ${toString (globalScale * 16)}";
|
||||||
ellipsize = mkLiteral "End";
|
ellipsize = mkLiteral "End";
|
||||||
color = colors.base06;
|
color = colors.base06;
|
||||||
padding = mkPaddingLrBt 16 16 0 2;
|
padding = mkPaddingLrBt 16 16 0 8;
|
||||||
dimensions = mkDimensionsWH 572 572 0 30;
|
dimensions = mkDimensionsWH 580 580 0 30;
|
||||||
dimensions_image_hint = mkDimensionsWH 440 440 0 30;
|
dimensions_image_hint = mkDimensionsWH 440 440 0 30;
|
||||||
dimensions_image_both = mkDimensionsWH 440 440 0 30;
|
dimensions_image_both = mkDimensionsWH 440 440 0 30;
|
||||||
});
|
});
|
||||||
|
@ -158,18 +157,55 @@
|
||||||
parent = "${name}_summary";
|
parent = "${name}_summary";
|
||||||
hook = mkHook "BL" "TL";
|
hook = mkHook "BL" "TL";
|
||||||
offset = mkVec2 0 12;
|
offset = mkVec2 0 12;
|
||||||
|
render_criteria = [(mkLiteral "Body")];
|
||||||
params = struct "TextBlock" (unnamedStruct {
|
params = struct "TextBlock" (unnamedStruct {
|
||||||
text = "%b";
|
text = "%b";
|
||||||
font = "${fonts.sansSerif.name} ${toString (globalScale * 16)}";
|
font = "${fonts.sansSerif.name} ${toString (globalScale * 16)}";
|
||||||
ellipsize = mkLiteral "End";
|
ellipsize = mkLiteral "End";
|
||||||
color = colors.base06;
|
color = colors.base06;
|
||||||
padding = mkPaddingLrBt 16 16 12 0;
|
padding = mkPaddingLrBt 16 16 12 0;
|
||||||
dimensions = mkDimensionsWH 572 572 0 80;
|
dimensions = mkDimensionsWH 580 580 0 88;
|
||||||
dimensions_image_hint = mkDimensionsWH 440 440 0 80;
|
dimensions_image_hint = mkDimensionsWH 440 440 0 88;
|
||||||
dimensions_image_both = mkDimensionsWH 440 440 0 80;
|
dimensions_image_both = mkDimensionsWH 440 440 0 88;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
mkProgress = name: yOffset: extra:
|
||||||
|
map (x: x // extra) [
|
||||||
|
{
|
||||||
|
name = "${name}_progress_${toString yOffset}_text";
|
||||||
|
parent = "${name}_root";
|
||||||
|
hook = mkHook "TL" "TL";
|
||||||
|
offset = mkVec2 0 0;
|
||||||
|
params = struct "TextBlock" (unnamedStruct {
|
||||||
|
text = "%p%";
|
||||||
|
font = "${fonts.monospace.name} Bold ${toString (globalScale * 14)}";
|
||||||
|
align = mkLiteral "Right";
|
||||||
|
ellipsize = mkLiteral "End";
|
||||||
|
color = colors.base06;
|
||||||
|
padding = mkPaddingLrBt 12 16 12 yOffset;
|
||||||
|
dimensions = mkDimensionsWH 48 48 24 24;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "${name}_progress_${toString yOffset}";
|
||||||
|
parent = "${name}_root";
|
||||||
|
hook = mkHook "TL" "TL";
|
||||||
|
offset = mkVec2 0 0;
|
||||||
|
params = struct "ProgressBlock" (unnamedStruct {
|
||||||
|
width = globalScale * 520;
|
||||||
|
height = globalScale * 12;
|
||||||
|
border_width = 0.0;
|
||||||
|
border_rounding = globalScale * 6;
|
||||||
|
border_color = colors.base03;
|
||||||
|
background_color = colors.base03;
|
||||||
|
fill_color = colors.base0D;
|
||||||
|
fill_rounding = globalScale * 6;
|
||||||
|
padding = mkPaddingLrBt 68 16 12 (yOffset + 8);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
];
|
||||||
in
|
in
|
||||||
format.generate "wired.ron" (unnamedStruct {
|
format.generate "wired.ron" (unnamedStruct {
|
||||||
max_notifications = 10;
|
max_notifications = 10;
|
||||||
|
@ -179,7 +215,7 @@
|
||||||
replacing_enabled = true;
|
replacing_enabled = true;
|
||||||
replacing_resets_timeout = true;
|
replacing_resets_timeout = true;
|
||||||
min_window_width = floor (globalScale * 600);
|
min_window_width = floor (globalScale * 600);
|
||||||
min_window_height = floor (globalScale * 120);
|
min_window_height = floor (globalScale * 60);
|
||||||
debug = false;
|
debug = false;
|
||||||
|
|
||||||
# https://github.com/Toqozz/wired-notify/wiki/Shortcuts
|
# https://github.com/Toqozz/wired-notify/wiki/Shortcuts
|
||||||
|
@ -189,14 +225,31 @@
|
||||||
notification_action1 = 3; # middle click
|
notification_action1 = 3; # middle click
|
||||||
};
|
};
|
||||||
|
|
||||||
layout_blocks = map unnamedStruct (lib.flatten [
|
layout_blocks = let
|
||||||
(mkRootBlock "general"
|
# Progress for body or hint-image notifications
|
||||||
// {
|
# must be much closer to the bottom
|
||||||
render_criteria = [];
|
bottomProgressCriteria = struct "Or" [
|
||||||
|
(mkLiteral "Body")
|
||||||
|
(mkLiteral "HintImage")
|
||||||
|
];
|
||||||
|
in
|
||||||
|
map unnamedStruct (lib.flatten [
|
||||||
|
(mkRootBlock "general")
|
||||||
|
(mkTopBar "general")
|
||||||
|
(mkBody "general" 36)
|
||||||
|
(mkProgress "general" 180 {
|
||||||
|
render_criteria = [
|
||||||
|
(struct "And" [
|
||||||
|
(mkLiteral "Progress")
|
||||||
|
bottomProgressCriteria
|
||||||
|
])
|
||||||
|
];
|
||||||
})
|
})
|
||||||
(mkTopBar "general")
|
(mkProgress "general" 80 {
|
||||||
(mkBody "general" 36)
|
render_criteria = [(mkLiteral "Progress")];
|
||||||
]);
|
render_anti_criteria = [bottomProgressCriteria];
|
||||||
|
})
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue