README.txt (3126B)
1 ~-. 2 ,,,; ~-.~-.~- 3 (.../ ~-.~-.~-.~-.~-. 4 <} o~`, ~-.~-.~-.~-.~-.~-. 5 (/ \ ~-.~-.~-.~-.~-.~-.~-. 6 ; \ ~-.~-.~-.~-.~-.~-.~-. 7 ; {_.~-.~-.~-.~-.~-.~-.~ 8 ;: .-~` ~-.~-.~-.~-.~-. 9 ;.: :' ._ ~-.~-.~-.~-.~- 10 ;::`-. '-._ ~-.~-.~-.~- 11 ;::. `-. '-,~-.~-.~-. 12 ';::::.`''-.-' 13 ';::;;:,:' 14 '||" 15 / | 16 ~` ~"'mic 17 18 '|| . 19 .... ... ... .... || .... ... .. .||. 20 ||. ' '|..' '' .|| || .|...|| ||' '' || 21 . '|.. .|. .|' || || || || || 22 |'..|' .| ||. '|..'|' .||. '|...' .||. '|.' 23 24 25 Simple X Alert 26 ============== 27 28 Simple alert pop-up utility for X. 29 30 Features 31 -------- 32 + Alert & exit -- no daemon 33 + Freetype scalable fonts 34 + UTF-8 support 35 + Configurable & scriptable with shell 36 + Dynamic screen positioning & sizing 37 38 Dependencies 39 ------------ 40 A c99 compiler, make, Xlib and Xft. 41 42 Build & install 43 --------------- 44 In order to build, execute the following commands: 45 46 $ git clone git://mcdim.xyz/sxalert.git && cd sxalert 47 $ make sxalert 48 49 And to install on /bin: 50 51 $ sudo make install 52 53 Usage 54 ----- 55 You can simply run the tool with each argument being a line of text" 56 57 $ sxalert "First line" "Second line" 58 59 You can also set color, border width & duration: 60 61 $ sxalert -d 1000 -b 5 -t FFFFFF -g 000000 -r FFFFFF "Hello world!" 62 63 These will overwrite the defaults defined in `config.h` 64 65 sxalert can read from standard input: 66 67 $ sxalert < banner.txt 68 69 $ { printf '%s\n' '===== BUILD FAILED ====='; \ 70 tail -n 20 build.log; } \ 71 | ./sxalert -s 72 73 Return values 74 ------------- 75 sxalert returns: 76 0 - Left click on the notification window 77 1 - Midde click on the notification window 78 2 - Right click on the notification window 79 3 - Time out 80 81 Yes, this does mean that sxalert returns non-zero values even with normal 82 execution, but for a good reason. This makes sxalert excellent for shell 83 scripts. For example: 84 85 You can set your mail to read with an acknowledgment: 86 87 $ sxalert "New Mail" && mail-set-to-read 88 89 Or you can create a more elaborate interaction: 90 91 sxalert "New Mail: X" "Left click to set to read" \ 92 "Middle click to delete" \ 93 "Right click to close" 94 rc=$? 95 96 case $rc in 97 0) 98 mail-set-to-read x 99 ;; 100 1) 101 mail-delete x 102 ;; 103 2) 104 echo "Unread mail" 105 ;; 106 esac 107 108 Optional D-Bus daemon hack 109 -------------------------- 110 I've created a small Shell script called sxalertd that can run as a pseudo 111 daemon that intercepts D-Bus and uses sxalert to draw the notifications. 112 It's not a proper daemon, and does not own the process, but can work fine. 113 method are a little hacky but work quite well. 114 (https://github.com/MichaelDim02/sxalertd) 115 116 Credit 117 ------ 118 The logo is the Alectryon! The rooster image is by Leys, Thomson W. from 119 the 1883 book "Brett's colonists' guide and cyclopaedia" for New Zealand 120 settlers. The font is Byzantine, and the logo was created in GIMP.