-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78445be
commit 47701ae
Showing
12 changed files
with
150 additions
and
126 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Example Config | ||
|
||
This folder contains an example config that implements a basic widget for general notifications, and a special "low battery" widget. Images work as well! | ||
|
||
![Notification Example](../.github/screenshot.png) | ||
|
||
![Notification with images](../.github/images.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[config] | ||
eww-window = "notification-frame" | ||
eww-default-notification-key = "end-notification" | ||
max-notifications = 10 | ||
notification-orientation = "v" | ||
|
||
timeout.urgency.low = 5 | ||
timeout.urgency.normal = 10 | ||
timeout.urgency.critical = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
$end-default-bg: #3a454a; | ||
$end-default-fg: #d3c6aa; | ||
$red: #e67e80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@import 'colors' | ||
|
||
$bgcolor: rgba(0, 0, 0, 0); | ||
|
||
* { | ||
all: unset; | ||
} | ||
|
||
.end-default-notification-box { | ||
background-color: $end-default-bg; | ||
padding: 12px; | ||
padding-left: 8px; | ||
margin: 12px; | ||
border-radius: 10px; | ||
} | ||
|
||
.notification-text { | ||
color: $end-default-fg; | ||
font-family: 'FantasqueSansM Nerd Font Mono'; | ||
} | ||
|
||
.notification-title { | ||
font-weight: bold; | ||
font-size: 1em; | ||
} | ||
|
||
.notification-content { | ||
font-size: .8em; | ||
} | ||
|
||
.content-box { | ||
margin-left: 12px; | ||
} | ||
|
||
.battery-icon { | ||
color: $red; | ||
font-size: 2.1em; | ||
margin-right: 48px; | ||
margin-left: 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
;; Notifications | ||
(defvar end-notifications '') | ||
|
||
(defwindow notification-frame | ||
:monitor 0 | ||
:geometry (geometry | ||
:x "0px" | ||
:y "0px" | ||
:width "480px" | ||
:height "0px" | ||
:anchor "top right") | ||
:stacking "fg" | ||
:windowtype "dialog" | ||
:passthrough true | ||
:wm-ignore true | ||
(literal :content end-notifications)) | ||
|
||
(defwidget end-notification | ||
[notification] | ||
(literal :content { | ||
notification.hints["type"] == "battery" | ||
? '(battery-notification :notification notification)' | ||
: '(base-notification :notification notification)' })) | ||
|
||
(defwidget base-notification | ||
[notification] | ||
(eventbox | ||
:onclick "end close ${notification.id}" ; use the end close command to implement "click-to-dismiss" | ||
:valign "start" | ||
:height 100 | ||
(box | ||
:class "end-default-notification-box" | ||
:orientation "horizontal" | ||
:space-evenly false | ||
(image | ||
:path {notification.hints["image-path"]} ; end sets this property if the notification contains an image | ||
:image-width 100 | ||
:image-height 100 | ||
) | ||
(box | ||
:class "content-box" | ||
:orientation "vertical" | ||
:space-evenly "false" | ||
(label | ||
:class "notification-text notification-title" | ||
:valign "start" | ||
:yalign 0 | ||
:xalign 0 | ||
:text {notification.summary}) | ||
(label | ||
:class "notification-text notification-content" | ||
:valign "start" | ||
:yalign 0 | ||
:xalign 0 | ||
:vexpand true | ||
:wrap true | ||
:text {notification.body}))))) | ||
|
||
(defwidget battery-notification | ||
[notification] | ||
(eventbox | ||
:onclick "end close ${notification.id}" | ||
(box | ||
:class "end-default-notification-box" | ||
:orientation "horizontal" | ||
:space-evenly false | ||
(label | ||
:class "notification-text battery-icon" | ||
:yalign 0.5 | ||
:xalign 0.5 | ||
:text "" | ||
) | ||
(box | ||
:orientation "vertical" | ||
:hexpand true | ||
(label | ||
:class "notification-text notification-title" | ||
:hexpand true | ||
:yalign 0.5 | ||
:xalign 0 | ||
:text "Low Battery") | ||
(label | ||
:class "notification-text" | ||
:vexpand true | ||
:hexpand true | ||
:yalign 0.5 | ||
:xalign 0 | ||
:text "${EWW_BATTERY["BAT0"]["capacity"]}% remaining"))))) ; of course we can still use eww built-ins! |