significantly more sane design
This commit is contained in:
parent
fbf758efe4
commit
1360406d5a
5 changed files with 28 additions and 23 deletions
1
.#README.md
Symbolic link
1
.#README.md
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
ink@Magellan.6427:1563239860
|
||||
18
CHANGELOG.md
18
CHANGELOG.md
|
|
@ -5,20 +5,4 @@ All notable changes to this project will be documented in this file. This change
|
|||
### Changed
|
||||
- Add a new arity to `make-widget-async` to provide a different widget shape.
|
||||
|
||||
## [0.1.1] - 2019-07-06
|
||||
### Changed
|
||||
- Documentation on how to make the widgets.
|
||||
|
||||
### Removed
|
||||
- `make-widget-sync` - we're all async, all the time.
|
||||
|
||||
### Fixed
|
||||
- Fixed widget maker to keep working when daylight savings switches over.
|
||||
|
||||
## 0.1.0 - 2019-07-06
|
||||
### Added
|
||||
- Files from the new template.
|
||||
- Widget maker public API - `make-widget-sync`.
|
||||
|
||||
[Unreleased]: https://github.com/your-name/whisper/compare/0.1.1...HEAD
|
||||
[0.1.1]: https://github.com/your-name/whisper/compare/0.1.0...0.1.1
|
||||
[Unreleased]: https://git.aidanis.online/aidan/whisper/compare/HEAD
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
(:use [whisper.ui]
|
||||
[whisper.signald]))
|
||||
|
||||
;; SEESAW GUI STUFF
|
||||
(def mainWindow (frame :title "Signald Version Reader"))
|
||||
(defn main-loop
|
||||
"updates UI with data from Signald"
|
||||
[content]
|
||||
(update mainWindow content)
|
||||
(recur (get-next-update)))
|
||||
|
||||
(defn -main
|
||||
"packs and shows main window with signald version string"
|
||||
[& args]
|
||||
(println (config! (-> mainWindow pack! show!)
|
||||
:content (reduce (fn [k v]
|
||||
(apply str [k v]))
|
||||
(get-next-update)))))
|
||||
())
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@
|
|||
(org.newsclub.net.unix AFUNIXSocket AFUNIXSocketAddress)
|
||||
(java.io File BufferedReader InputStreamReader)))
|
||||
|
||||
;; Signald global state vars
|
||||
(def sigdSock (AFUNIXSocket/connectTo
|
||||
(AFUNIXSocketAddress. (File. "/var/run/signald/signald.sock"))))
|
||||
(def sigdRead (BufferedReader. (InputStreamReader.
|
||||
(. sigdSock getInputStream))))
|
||||
(def sigdWrite (. sigdSock getOutputStream))
|
||||
|
||||
;; Signald Functions
|
||||
(defn get-next-update
|
||||
"Retrieves and parses next line of incoming data from signald"
|
||||
[]
|
||||
|
|
|
|||
18
src/whisper/ui.clj
Normal file
18
src/whisper/ui.clj
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(ns whisper.ui
|
||||
"Whisper UI Module"
|
||||
(:use [seesaw.core]))
|
||||
|
||||
;; UI Global State
|
||||
(native!)
|
||||
(def mainWindow (frame :title "Signald Version Reader"
|
||||
:content " Loading... "
|
||||
:width 250
|
||||
:height 40))
|
||||
|
||||
;; UI Functions
|
||||
(defn update
|
||||
"Updates WINDOW to display additional content: CONTENT"
|
||||
[window content]
|
||||
(config! window :content
|
||||
(concat (:content window) content))
|
||||
window)
|
||||
Loading…
Add table
Add a link
Reference in a new issue