From d0e734e122c8f3cfb2ff4ed2eb5b4e86c0dfb3a1 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 23 Feb 2012 09:29:46 +0100 Subject: .xbindkeysrc.scm --- .xbindkeysrc.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.xbindkeysrc.scm') diff --git a/.xbindkeysrc.scm b/.xbindkeysrc.scm index 9e17422..79addce 100644 --- a/.xbindkeysrc.scm +++ b/.xbindkeysrc.scm @@ -142,6 +142,10 @@ (xbindkey '(XF86AudioPrev) "mpc prev") (xbindkey '(XF86AudioNext) "mpc next") (xbindkey '(XF86Tools) "ncmpcpp") + (xbindkey `(,modkey b) "herbstclient focus left") + (xbindkey `(,modkey n) "herbstclient focus down") + (xbindkey `(,modkey p) "herbstclient focus up") + (xbindkey `(,modkey f) "herbstclient focus right") (xbindkey-function `(,modkey g) reset-main-binding)) (create-map X-function-map -- cgit v1.2.3-54-g00ecf From 3cb9146b919ceeda8fdec167b2970c826d8c5936 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 23 Feb 2012 17:02:11 +0100 Subject: .xbindkeysrc.scm --- .xbindkeysrc.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to '.xbindkeysrc.scm') diff --git a/.xbindkeysrc.scm b/.xbindkeysrc.scm index 79addce..93510ff 100644 --- a/.xbindkeysrc.scm +++ b/.xbindkeysrc.scm @@ -1,8 +1,8 @@ -;; -*- eval: (git-auto-commit-mode 1) -*- +;;;_ Import (use-modules (ice-9 popen) (ice-9 rdelim)) -;;; Variables +;;;_ Variables (define modkey 'mod4) (define dmenu-font "-misc-tamsyn-medium-r-normal-*-14-*-*-*-*-*-iso8859-*") @@ -22,7 +22,7 @@ (define previous-tag '()) (define current-tag "default") -;;; Macros +;;;_ Macros (define-macro (cmd command) `(lambda () (run-command ,command) @@ -36,7 +36,7 @@ (xbindkey-function `(,modkey g) reset-main-binding) (grab-all-keys))) -;;; Functions +;;;_ Functions (define (reset-main-binding) "reset first binding" (close-gui-window) @@ -123,7 +123,7 @@ (close-pipe dzen-pipe) (set! dzen-pipe '()))) -;;; Maps +;;;_ Maps (define (main-binding) "First binding" (xbindkey `(,modkey shift "1") (string-append "dmenu_run -p 'Run:' " dmenu-args)) @@ -190,5 +190,10 @@ (xbindkey `(,modkey f) "herbstclient resize right +0.05") (xbindkey-function '(Return) reset-main-binding)) -;;; Main +;;;_ Main (main-binding) + +;;;_ Local Variables +;; Local Variables: +;; eval: (git-auto-commit-mode 1) +;; End: -- cgit v1.2.3-54-g00ecf From bb52c255508f9f8f3ca822f6f2ba0b76509896f6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 23 Feb 2012 18:18:51 +0100 Subject: .xbindkeysrc.scm --- .xbindkeysrc.scm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to '.xbindkeysrc.scm') 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)) -- cgit v1.2.3-54-g00ecf From d201c46b95f82416c04c6239616c5778b86c7990 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 23 Feb 2012 18:20:00 +0100 Subject: .xbindkeysrc.scm --- .xbindkeysrc.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.xbindkeysrc.scm') diff --git a/.xbindkeysrc.scm b/.xbindkeysrc.scm index e068182..c21da0f 100644 --- a/.xbindkeysrc.scm +++ b/.xbindkeysrc.scm @@ -172,11 +172,12 @@ the command." (xbindkey-function '("3") (cmd "herbstclient split horizontal 0.5")) (xbindkey-function '("2") (cmd "herbstclient split vertical 0.5")) (xbindkey-function '(space) (cmd "herbstclient cycle_layout 1")) - (xbindkey-function '(f) (cmd "herbstclient floating toggle")) + ;(xbindkey-function '(f) (cmd "herbstclient floating toggle")) (xbindkey-function '(shift f) (cmd "herbstclient fullscreen toggle")) (xbindkey-function '(p) (cmd "herbstclient pseudotile toggle")) (xbindkey-function '(r) resize-map) - (xbindkey-function '(m) move-to-tag)) + (xbindkey-function '(m) move-to-tag) + (xbindkey-function '(f) switch-and-run)) (create-map W-function-map (gui-print "S-w") -- cgit v1.2.3-54-g00ecf From a0810b7d9714cbd7b29d220a60f1e37f8202b624 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 23 Feb 2012 18:20:38 +0100 Subject: .xbindkeysrc.scm --- .xbindkeysrc.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.xbindkeysrc.scm') diff --git a/.xbindkeysrc.scm b/.xbindkeysrc.scm index c21da0f..e90701f 100644 --- a/.xbindkeysrc.scm +++ b/.xbindkeysrc.scm @@ -172,12 +172,12 @@ the command." (xbindkey-function '("3") (cmd "herbstclient split horizontal 0.5")) (xbindkey-function '("2") (cmd "herbstclient split vertical 0.5")) (xbindkey-function '(space) (cmd "herbstclient cycle_layout 1")) - ;(xbindkey-function '(f) (cmd "herbstclient floating toggle")) + (xbindkey-function '(f) (cmd "herbstclient floating toggle")) (xbindkey-function '(shift f) (cmd "herbstclient fullscreen toggle")) (xbindkey-function '(p) (cmd "herbstclient pseudotile toggle")) (xbindkey-function '(r) resize-map) (xbindkey-function '(m) move-to-tag) - (xbindkey-function '(f) switch-and-run)) + (xbindkey-function `(,modkey f) switch-and-run)) (create-map W-function-map (gui-print "S-w") -- cgit v1.2.3-54-g00ecf From 9670d3d9e6ccf9e09492706dbfbd9a822e395241 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 23 Feb 2012 18:21:28 +0100 Subject: .xbindkeysrc.scm --- .xbindkeysrc.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.xbindkeysrc.scm') diff --git a/.xbindkeysrc.scm b/.xbindkeysrc.scm index e90701f..d1c9479 100644 --- a/.xbindkeysrc.scm +++ b/.xbindkeysrc.scm @@ -91,7 +91,8 @@ the command." (prog (read-line file))) (close-port file) (switch-to-tag prog) - (run-command prog))) + (run-command prog)) + (reset-main-binding)) (define (kill-tag) "Kill a selected tag" -- cgit v1.2.3-54-g00ecf