README.md (2147B)
1 # Simple X Alert 2 <img src="https://mcdim.xyz/projects/sxalert/alectryon.png" alt="Alectryon rooster sxalert logo" style="height: 222px; width:200px;"/> 3 4 Simple alert pop-up utility for X. 5 6 ## Features 7 + Alert & exit -- no daemon 8 + Freetype scalable fonts 9 + UTF-8 support 10 + Configurable & scriptable with shell 11 + Dynamic screen positioning & sizing 12 13 ## Dependencies 14 A c99 compiler, `make`, `Xlib` and `Xft`. 15 16 ## Build & install 17 In order to build, execute the following commands: 18 ``` 19 $ git clone git://mcdim.xyz/sxalert.git && cd sxalert 20 $ make sxalert 21 ``` 22 And to install on /bin: 23 ``` 24 $ sudo make install 25 ``` 26 27 ## Usage 28 You can simply run the tool with each argument being a line of text 29 ``` 30 $ ./sxalert "First line" "Second line" 31 ``` 32 You can also set color, border width & duration: 33 ``` 34 $ ./sxalert -d 1000 -b 5 -t FFFFFF -g 000000 -r FFFFFF "First line" "Second line" 35 ``` 36 These will overwrite the defaults defined in `config.h` 37 38 ## Return values 39 sxalert returns: 40 + 0 - Left click on the notification window 41 + 1 - Midde click on the notification window 42 + 2 - Right click on the notification window 43 + 3 - Time out 44 45 Yes, this does mean that sxalert returns non-zero values even with normal 46 execution, but for a good reason. This makes sxalert excellent for shell 47 scripts. For example: 48 49 You can set your mail to read with an acknowledgment 50 51 ``` 52 $ sxalert "New Mail" && mail-set-to-read 53 ``` 54 55 Or you can create a more elaborate interaction 56 57 ``` 58 sxalert "New Mail: X" "Left click to set to read" \ 59 "Middle click to delete" \ 60 "Right click to close" 61 rc=$? 62 63 case $rc in 64 0) 65 mail-set-to-read x 66 ;; 67 1) 68 mail-delete x 69 ;; 70 2) 71 echo "Unread mail" 72 ;; 73 ``` 74 75 ## Optional D-Bus daemon hack 76 I've created a small Shell script called [sxalertd](https://github.com/MichaelDim02/sxalertd) that can run as a daemon to read the D-Bus and use sxalert to draw the notifications. The script & parsing method are a little hacky but work quite well. 77 78 ## Credit 79 The logo is the Alectryon! The rooster image is by Leys, Thomson W. from the 1883 book "Brett's colonists' guide and cyclopaedia" for New Zealand settlers. The font is Byzantine, and the logo was created in GIMP.