diff options
author | Tom Willemsen | 2012-02-23 18:18:51 +0100 |
---|---|---|
committer | Tom Willemsen | 2012-02-23 18:18:51 +0100 |
commit | bb52c255508f9f8f3ca822f6f2ba0b76509896f6 (patch) | |
tree | 7acf51041834c23a057b25b54e58729e1a863f4f /.xbindkeysrc.scm | |
parent | 3cb9146b919ceeda8fdec167b2970c826d8c5936 (diff) | |
download | dotfiles-bb52c255508f9f8f3ca822f6f2ba0b76509896f6.tar.gz dotfiles-bb52c255508f9f8f3ca822f6f2ba0b76509896f6.zip |
.xbindkeysrc.scm
Diffstat (limited to '.xbindkeysrc.scm')
-rw-r--r-- | .xbindkeysrc.scm | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/.xbindkeysrc.scm b/.xbindkeysrc.scm index 93510ff..e068182 100644 --- a/.xbindkeysrc.scm +++ b/.xbindkeysrc.scm @@ -66,19 +66,33 @@ (close-port file) tag)) -(define (switch-tags) - "Switch to another tag" - (let* ((tags (get-tags)) - (tag (choose-tag "Switch to tag" tags))) +(define (switch-to-tag tag) + (let ((tags (get-tags))) (if (string? tag) (begin (if (not (member tag tags)) (system (string-append "herbstclient add " tag))) (set! previous-tag current-tag) (set! current-tag tag) - (run-command (string-append "herbstclient use " tag)))) + (run-command (string-append "herbstclient use " tag)))))) + +(define (switch-tags) + "Switch to another tag" + (let* ((tags (get-tags)) + (tag (choose-tag "Switch to tag" tags))) + (switch-to-tag tag) (reset-main-binding))) +(define (switch-and-run) + "Ask for a command to run, switch to a tag with that name and run +the command." + (let* ((file (open-input-pipe + (string-append "dmenu_pick -p 'Run:' " dmenu-args))) + (prog (read-line file))) + (close-port file) + (switch-to-tag prog) + (run-command prog))) + (define (kill-tag) "Kill a selected tag" (let* ((tags (get-tags)) |