Skip to content

Instantly share code, notes, and snippets.

@lukelex
Last active December 19, 2021 12:11
Show Gist options
  • Save lukelex/d6fb76294ca48787169e21bb7f7d921e to your computer and use it in GitHub Desktop.
Save lukelex/d6fb76294ca48787169e21bb7f7d921e to your computer and use it in GitHub Desktop.
Wired multiple style notifications
notify-send -a Volume \
-i /usr/share/icons/FontAwesome-6/light/512x512/all/volume.png \
-h int:value:35 \
-h string:wired-tag:volume \
"35%"
(
max_notifications: 10,
timeout: 5000,
poll_interval: 16,
history_length: 20,
replacing_enabled: true,
replacing_resets_timeout: true,
min_window_width: 300,
min_window_height: 100,
layout_blocks: [
(
name: "root",
parent: "",
hook: Hook(parent_anchor: TM, self_anchor: TM),
offset: Vec2(x: 0.0, y: 60),
params: NotificationBlock((
monitor: 0,
border_width: 0,
border_rounding: 8,
background_color: Color(hex: "#F5F5F5"),
border_color: Color(hex: "#00000000"),
border_color_low: Color(hex: "#00000000"),
border_color_critical: Color(hex: "#FF0000"),
border_color_paused: Color(hex: "#00000000"),
gap: Vec2(x: 0.0, y: 8.0),
notification_hook: Hook(parent_anchor: BM, self_anchor: TM),
)),
),
(
name: "app_notification",
parent: "root",
hook: Hook(parent_anchor: TM, self_anchor: TM),
offset: Vec2(x: 0, y: 0),
render_criteria: [AppImage],
params: ImageBlock((
image_type: App,
padding: Padding(left: 40, right: 40, top: 8, bottom: 8),
rounding: 4.0,
scale_width: 152,
scale_height: 152,
filter_mode: Lanczos3,
)),
),
(
name: "app_summary",
parent: "app_notification",
hook: Hook(parent_anchor: BM, self_anchor: TM),
offset: Vec2(x: 0, y: 12),
render_criteria: [AppImage],
params: TextBlock((
text: "%s",
font: "Arial Bold 16",
ellipsize: End,
color: Color(hex: "#000000"),
padding: Padding(left: 0, right: 0, top: 0, bottom: 0),
dimensions: (width: (min: -1, max: 185), height: (min: 0, max: 0)),
)),
),
(
name: "app_body",
parent: "app_summary",
hook: Hook(parent_anchor: BM, self_anchor: TM),
offset: Vec2(x: 0, y: 0),
render_criteria: [AppImage],
params: TextBlock((
text: "%b",
font: "Arial Bold 16",
ellipsize: End,
color: Color(hex: "#000000"),
padding: Padding(left: 0, right: 0, top: 0, bottom: 24),
dimensions: (width: (min: -1, max: 250), height: (min: 0, max: 0)),
)),
),
(
name: "app_progress",
parent: "app_notification",
hook: Hook(parent_anchor: BM, self_anchor: TM),
offset: Vec2(x: 0, y: 50),
render_criteria: [AppImage, Progress],
params: ProgressBlock((
padding: Padding(left: 0, right: 0, top: 0, bottom: 32),
border_width: 2,
border_rounding: 2,
border_color: Color(hex: "#000000"),
fill_rounding: 1,
background_color: Color(hex: "#00000000"),
fill_color: Color(hex: "#000000"),
width: -1.0,
height: 30.0,
)),
),
(
name: "status_notification",
parent: "root",
hook: Hook(parent_anchor: TL, self_anchor: TL),
offset: Vec2(x: 0, y: 0),
render_criteria: [HintImage],
params: TextBlock((
text: "%s",
font: "Arial Bold 16",
ellipsize: End,
color: Color(hex: "#000000"),
padding: Padding(left: 8, right: 8, top: 8, bottom: 8),
dimensions: (width: (min: 400, max: 400), height: (min: 84, max: 0)),
)),
),
(
name: "status_body",
parent: "status_notification",
hook: Hook(parent_anchor: ML, self_anchor: TL),
offset: Vec2(x: 0, y: -26),
render_criteria: [HintImage],
params: TextBlock((
text: "%b",
font: "Arial 14",
ellipsize: End,
color: Color(hex: "#000000"),
padding: Padding(left: 8, right: 8, top: 8, bottom: 8),
dimensions: (width: (min: 400, max: 400), height: (min: 0, max: 84)),
scroll_speed: 0.1,
lhs_dist: 35.0,
rhs_dist: 35.0,
scroll_t: 1.0,
)),
),
(
name: "status_image",
parent: "status_notification",
hook: Hook(parent_anchor: TL, self_anchor: TR),
offset: Vec2(x: 0, y: 0),
render_criteria: [HintImage],
params: ImageBlock((
image_type: Hint,
padding: Padding(left: 8, right: 0, top: 8, bottom: 8),
rounding: 4.0,
scale_width: 84,
scale_height: 84,
filter_mode: Lanczos3,
)),
),
],
shortcuts: ShortcutsConfig (
notification_interact: 1,
notification_close: 2,
notification_action1: 3,
),
)
@lukelex
Copy link
Author

lukelex commented Dec 19, 2021

volume-osd-.4.mp4

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