aboutsummaryrefslogtreecommitdiffstats
path: root/mowedline
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-11-24 21:46:47 +0100
committerGravatar Tom Willemse2016-11-24 21:46:47 +0100
commit3077d8d5d16b246f46c7b4b732f7c37bba1d4c56 (patch)
tree9326703f4be482b0b3bc01318d96119eb2c23c48 /mowedline
parentd3d6e313ecb60424a5defe6ffa5d9a5793f61013 (diff)
downloadnew-dotfiles-3077d8d5d16b246f46c7b4b732f7c37bba1d4c56.tar.gz
new-dotfiles-3077d8d5d16b246f46c7b4b732f7c37bba1d4c56.zip
Add clipboard and irc widgets
Diffstat (limited to 'mowedline')
-rw-r--r--mowedline/.config/mowedline/init.org25
1 files changed, 22 insertions, 3 deletions
diff --git a/mowedline/.config/mowedline/init.org b/mowedline/.config/mowedline/init.org
index b89e225..f31be02 100644
--- a/mowedline/.config/mowedline/init.org
+++ b/mowedline/.config/mowedline/init.org
@@ -1,9 +1,10 @@
+# -*- geiser-default-implementation: chicken; -*-
#+TITLE: Mowedline init
Load the =matchable= module so I can use =match-lambda=.
#+BEGIN_SRC scheme
- (use matchable)
+ (use matchable dbus)
#+END_SRC
Set the default font and color to something nicer.
@@ -117,7 +118,7 @@ Define a convenience function to add a Font Awesome icon to a widget.
(define email-widget
(widget:text
#:name "email"
- #:format (compose text-maybe-pad-both (add-fa-icon ""))))
+ #:format (compose text-maybe-pad-left (add-fa-icon ""))))
#+END_SRC
* The window
@@ -125,6 +126,20 @@ Define a convenience function to add a Font Awesome icon to a widget.
Create a mowedline window, put it at the bottom.
#+BEGIN_SRC scheme
+ (define clipboard-widget
+ (widget:text #:format text-maybe-pad-left))
+
+ (let ((ctx (make-context #:service 'org.gnome.GPaste
+ #:interface 'org.gnome.GPaste1
+ #:path "/org/gnome/GPaste")))
+ (register-signal-handler ctx
+ "Update"
+ (lambda (type replace id)
+ (update clipboard-widget "Text copied!")
+ (thread-start! (make-thread (lambda ()
+ (thread-sleep! 3)
+ (update clipboard-widget "")))))))
+
(window #:position 'bottom
#:width 1843
#:margin-bottom 15
@@ -133,7 +148,11 @@ Define a convenience function to add a Font Awesome icon to a widget.
#:background 'transparent
taglist-widget
+
(widget:spacer #:flex 1)
+
+ clipboard-widget
+ (widget:text #:name "irc" #:format (lambda (text) (text-maybe-pad-left (with-input-from-string text read))))
email-widget
- (widget:clock))
+ (widget:clock #:format text-maybe-pad-left))
#+END_SRC