Hi, > On Sat, 2 Oct 2010 16:36:57 +0200 > wrote Christopher Roy Bratusek <zanghar freenet de>: > ... > - dark-tabbed (ultimate-best would be all four merged into on) ;;; Fuchur? > ... Here my first try. But you need patches. Changelog: 01_tabs.patch: autoload.jl: remove Tabs from autoload tab.jl: remove Tabs from sawfish-config add set-tab-adjustments and gaol for set-tab-adjustments rename classes tab tab-s tab-l to tabbar-horizontal-left-edge tabbar-horizontal tabbar-horizontal-right-edge rename classes tab-ls tab-r tab-rs to tabbar-vertical-top-edge tabbar-vertical tabbar-vertical-bottom-edge remove cursor, x-justify, y-justify from classes (can set by theme.jl) remove keymap for classes tabgroup.jl: add settings for state-changed title-position raise all windows automatical if one window in tabgroup get focus (no change in sawfish-config necessary) make all windows automatical sticky if one window in tabgroup gets sticky (no change in sawfish-config necessary) remove/replace some hooks from tabgroup (makes sawfish's tabgroup faster) add some provisionally settings and "bugfixes" (need rework later but it should work) 02_keymaps.jl.patch 03_frames.jl.patch: add keybindings for tabbar-horizontal tabbar-vertical 04_focus.jl.patch: add tab-raise-on-hover to Focus from removed Tabs (tab-raise-on-hover works not only on tabbar and need a fix) 05_gaol.jl.patch: add sawfish.wm.tabs.tab to gaol.jl 06_title-position.patch: add title-position for windows-rules and windows-history (patch from mailinglist) 07_themes.patch: makes Elberg-tabbed and get-S-tabbed compatible to tab.jl/tabgroup.jl --------------------------------------------------------------------------- New themes DarkTab SmoothlyTab: http://mitglied.lycos.de/fuchur2004/DarkTab.tar.bz2 http://mitglied.lycos.de/fuchur2004/SmoothlyTab.tar.bz2 Please remove Dark-Tab* Smoothly-Tab* from your themes folder if you try the new themes. After set one of the new theme or other tab themes as default theme you need restart sawfish once at this moment. Keybindings: Title/Tabbar on top: Left-click on icon -> put title on left Middle-click on icon -> put title on bottom Right-click on icon -> put title on right Title/Tabbar on left: Left-click on icon -> put title on bottom Middle-click on icon -> put title on top Right-click on icon -> put title on right Title/Tabbar on right: Left-click on icon -> put title on left Middle-click on icon -> put title on top Right-click on icon -> put title on bottom Title/Tabbar on bottom: Left-click on icon -> put title on left Middle-click on icon -> put title on top Right-click on icon -> put title on right frame-type button: left click -> toogle frame transient shaped-transient and resize window middle click -> unframed and resize window window right click -> toogle frame default transient and resize window > On Sat, 2 Oct 2010 16:36:57 +0200 >> wrote Christopher Roy Bratusek <zanghar freenet de>: > ... >>Am Sun, 3 Oct 2010 07:56:24 +0200 >>schrieb fuchur <flohtransporter gmail com>: >> ... >> Secondly to remember which window has the titlebar on >> left/right/top/bottom you need a new "Window Properties" >> (http://home.avvanta.com/~sand/sawfish/v0.12/sawfish/Standard-Properties.html#Standard-Properties) >> and add a drop-down box in windows rules. > >see the attached patch and (window-get window 'frame-position), the second hunk is >optional, but in that case recommended, I think. ... If you use window-rules to set title to left/right/bottom for a window, sawfish remember the position (start window, restart sawfish) but if you call "sawfish-config --group=appearance" sawfish set the title for all the windows to default. But if you then restart sawfish, the title for window are placed correct. It has something to do with after-setting-default-frame or/and reframe in "lisp/sawfish/wm/frames.jl", and it should work like if you restart sawfish. Can you try to fix (or someone else he/she know what he/she doing ;) ). If done i can continue the work at tab/tabgroup. -- Regards, Fuchur GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53 C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish.orgi/lisp/sawfish/wm/autoload.jl sawfish/lisp/sawfish/wm/autoload.jl --- sawfish.orgi/lisp/sawfish/wm/autoload.jl +++ sawfish/lisp/sawfish/wm/autoload.jl @@ -128,7 +128,6 @@ (autoload-command 'slide-group-down 'sawfish.wm.commands.slide-window) (defgroup gpsy "Grow, Pack, Shrink & Yank" :group move :require sawfish.wm.commands.grow-pack) (defgroup cycle "Window Cycling" :group focus :require sawfish.wm.commands.x-cycle) -(defgroup tabs "Tabs" :require sawfish.wm.tabs.tab) (autoload-command 'cycle-windows 'sawfish.wm.commands.x-cycle) (autoload-command 'cycle-windows-backwards 'sawfish.wm.commands.x-cycle) (autoload-command 'cycle-group 'sawfish.wm.commands.x-cycle) diff -urNad sawfish.orgi/lisp/sawfish/wm/tabs/tab.jl sawfish/lisp/sawfish/wm/tabs/tab.jl --- sawfish.orgi/lisp/sawfish/wm/tabs/tab.jl +++ sawfish/lisp/sawfish/wm/tabs/tab.jl @@ -21,7 +21,7 @@ (define-structure sawfish.wm.tabs.tab (export tab-add-to-group - raise-tabs-on-hover-setter) + set-tab-adjustments) (open rep rep.system @@ -32,9 +32,9 @@ sawfish.wm.tabs.tabgroup sawfish.wm.util.marks sawfish.wm.windows - sawfish.wm.stacking) + sawfish.wm.gaol) - (define-structure-alias tab sawfish.wm.tabs.tab) + (define-structure-alias tab sawfish.wm.tabs.tab) ;; TODO: ;; - change other tab sizes when window resizes itself, should fixed @@ -42,45 +42,22 @@ ;; - hide some frame parts on leftmost and rightmost tabs, should fixed ;; - add a drag-n-drop way to group windows by tabs - ;;###autoload (defgroup tabs "Tabs") - - (defgroup tabs "Tabs") - - (defcustom tab-left-dec-width 11 "Width of tab's left-edge decoration" - :group tabs - :type number - :after-set reframe-all-windows) - - (defcustom tab-right-dec-width 11 "Width of tab's right-edge decoration" - :group tabs - :type number - :after-set reframe-all-windows) - - (defcustom tab-left-margin 66 "Width of tab area's left-edge decoration" - :group tabs - :type number - :after-set reframe-all-windows) - - (defcustom tab-right-margin 68 "Width of tab area's right-edge decoration" - :group tabs - :type number - :after-set reframe-all-windows) - - (defcustom tab-left-margin-transient 44 "Width of tab area's left-edge-transient decoration" - :group tabs - :type number - :after-set reframe-all-windows) - - (defcustom tab-right-margin-transient 24 "Width of tab area's right-edge-transient decoration" - :group tabs - :type number - :after-set reframe-all-windows) + (define (set-tab-adjustments #!key theme-left-dec-width theme-right-dec-width theme-left-margin + theme-right-margin theme-left-margin-transient theme-right-margin-transient) + (if theme-left-dec-width + (defvar-setq tabbar-left-dec-width theme-left-dec-width)) + (if theme-right-dec-width + (defvar-setq tabbar-right-dec-width theme-right-dec-width)) + (if theme-left-margin + (defvar-setq tabbar-left-margin theme-left-margin)) + (if theme-right-margin + (defvar-setq tabbar-right-margin theme-right-margin)) + (if theme-left-margin-transient + (defvar-setq tabbar-left-margin-transient theme-left-margin-transient)) + (if theme-right-margin-transient + (defvar-setq tabbar-right-margin-transient theme-right-margin-transient))) - (defcustom tab-raise-on-hover nil - "Raise Tabs on Hover" - :group tabs - :type boolean - :after-set (lambda () (raise-tabs-on-hover-setter))) + (gaol-add set-tab-adjustments) (define (get-tab-pos win) (let* ((group (tab-find-window win)) @@ -94,13 +71,13 @@ (margin-l (if (or (eq (window-get win 'type) 'transient) (eq (window-get win 'type) 'shaped-transient)) - tab-left-margin-transient - tab-left-margin)) + tabbar-left-margin-transient + tabbar-left-margin)) (margin-r (if (or (eq (window-get win 'type) 'transient) (eq (window-get win 'type) 'shaped-transient)) - tab-right-margin-transient - tab-right-margin)) + tabbar-right-margin-transient + tabbar-right-margin)) (tabarea-width (- dim-x margin-l margin-r)) (tabarea-height (- dim-y margin-l margin-r)) (numtabs (length (tab-group-window-list group))) @@ -108,6 +85,7 @@ (bottom (quotient (* tabnum tabarea-height) numtabs)) ;; the right edge is not always "left + (window-width / numtabs)" ;; that would be inaccurate due to rounding errors + ;; (right (quotient (* (+ tabnum 1) tabarea-width) numtabs)) (top (quotient (* (+ tabnum 1) tabarea-height) numtabs)) (width (- right left)) @@ -115,111 +93,89 @@ (list dim-x dim-y margin-l margin-r left right width bottom top height))) (define (tab-title-text-width win) - "Width of the title text area is the tabwidth minus decorations" + "Width of the title text area is the tabwidth minus decorations by horizontal titlebar themes" (let* ((tabwidth (nth 6 (get-tab-pos win)))) - (+ tabwidth - (- tab-left-dec-width) - (- tab-right-dec-width)))) + (+ tabwidth + (- tabbar-left-dec-width) + (- tabbar-right-dec-width)))) (define (tab-title-text-height win) - "Height of the title text area is the tabheight minus decorations by a left or right titlebar themes" + "Height of the title text area is the tabheight minus decorations by vertical titlebar themes" (let* ((tabheight (nth 9 (get-tab-pos win)))) (when (> tabheight 0) (+ tabheight - (- tab-left-dec-width) - (- tab-right-dec-width))))) + (- tabbar-left-dec-width) + (- tabbar-right-dec-width))))) (define (tab-left-edge win) - "Compute left edge of tab" + "Compute left edge of tab by horizontal titlebar themes" (let* ((left (nth 4 (get-tab-pos win))) (margin-l (nth 2 (get-tab-pos win)))) - (+ left margin-l))) + (+ left margin-l))) (define (tab-bottom-edge win) - "Compute bottom edge of tab by a left or right titlebar themes" + "Compute bottom edge of tab by vertical titlebar themes" (let* ((bottom (nth 7 (get-tab-pos win))) (margin-l (nth 2 (get-tab-pos win)))) - (+ bottom margin-l))) + (+ bottom margin-l))) (define (tab-right-dec-pos win) - "Compute position of tab's right-edge decoration" + "Compute position of tab's right-edge decoration by horizontal titlebar themes" (let* ((right (nth 5 (get-tab-pos win))) (margin-l (nth 2 (get-tab-pos win))) (dim-x (nth 0 (get-tab-pos win)))) (when (> dim-x margin-l) ;; don't display outside from frame - (+ right margin-l (- tab-right-dec-width))))) + (+ right margin-l (- tabbar-right-dec-width))))) (define (tab-top-dec-pos win) - "Compute position of tab's top-edge decoration by a left or right titlebar themes" + "Compute position of tab's top-edge decoration by vertical titlebar themes" (let* ((top (nth 8 (get-tab-pos win))) (margin-l (nth 2 (get-tab-pos win))) (dim-y (nth 1 (get-tab-pos win)))) (when (> dim-y margin-l) ;; don't display outside from frame - ;; use double size for icon support - (+ top margin-l (- (* tab-right-dec-width 2)))))) - + ;; use double size for icon support + (+ top margin-l (- (* tabbar-right-dec-width 2)))))) + (define (tab-title-left-edge win) - "Compute left edge of tab" - (+ (tab-left-edge win) tab-left-dec-width)) + "Compute left edge of tab by horizontal titlebar themes" + (+ (tab-left-edge win) tabbar-left-dec-width)) (define (tab-title-bottom-edge win) - "Compute bottom edge of tab by a left or right titlebar themes" - (+ (tab-bottom-edge win) tab-left-dec-width)) + "Compute bottom edge of tab by vertical titlebar themes" + (+ (tab-bottom-edge win) tabbar-left-dec-width)) - ;; new class : tab - (define-frame-class 'tab - `((cursor . left_ptr) - (x-justify . 12) - (y-justify . center) - (left-edge . ,tab-title-left-edge) - (width . ,tab-title-text-width))) + ;; new classes tabs : tabbar-horizontal-left-edge tabbar-horizontal tabbar-horizontal-right-edge + ;; + (define-frame-class 'tabbar-horizontal-left-edge + `((left-edge . ,tab-left-edge)) t) - (set-frame-part-value 'tab 'keymap 'title-keymap) + (define-frame-class 'tabbar-horizontal + `((left-edge . ,tab-title-left-edge) + (width . ,tab-title-text-width))) - ;; side tab arena - (define-frame-class 'tab-s - `((cursor . left_ptr) - (x-justify . 12) - (y-justify . center) - (bottom-edge . ,tab-title-bottom-edge) - (height . ,tab-title-text-height))) + (define-frame-class 'tabbar-horizontal-right-edge + `((left-edge . ,tab-right-dec-pos)) t) - (set-frame-part-value 'tab-s 'keymap 'title-keymap) - - (define-frame-class 'tab-l - `((cursor . left_ptr) - (left-edge . ,tab-left-edge)) t) + ;; new classes tabs on side : tabbar-vertical-top-edge tabbar-vertical tabbar-vertical-bottom-edge + ;; + (define-frame-class 'tabbar-vertical-top-edge + `((bottom-edge . ,tab-top-dec-pos)) t) - ;; side tab arena bottom end - (define-frame-class 'tab-ls - `((cursor . left_ptr) - (bottom-edge . ,tab-bottom-edge)) t) - - (define-frame-class 'tab-r - `((cursor . left_ptr) - (left-edge . ,tab-right-dec-pos)) t) + (define-frame-class 'tabbar-vertical + `((bottom-edge . ,tab-title-bottom-edge) + (height . ,tab-title-text-height))) - ;; side tab arena top end - (define-frame-class 'tab-rs - `((cursor . left_ptr) - (bottom-edge . ,tab-top-dec-pos)) t) + (define-frame-class 'tabbar-vertical-bottom-edge + `((bottom-edge . ,tab-bottom-edge)) t) (define (mygroup win) (if (marked-windows) (progn (apply-on-marked-windows (lambda (w) (tab-group-window w win))) (unmark-all-windows)) - (mark-window win))) - - (define-command 'tab-add-to-group mygroup #:spec "%W") - - (define (raise-tabs-on-hover-action win) - (raise-window win)) + (mark-window win))) - (define (raise-tabs-on-hover-setter) - (if (eq tab-raise-on-hover 't) - (add-hook 'enter-frame-part-hook raise-tabs-on-hover-action) - (remove-hook 'enter-frame-part-hook raise-tabs-on-hover-action)))) + (define-command 'tab-add-to-group mygroup #:spec "%W")) ;;(require 'x-cycle) ;;(define-cycle-command-pair diff -urNad sawfish.orgi/lisp/sawfish/wm/tabs/tabgroup.jl sawfish/lisp/sawfish/wm/tabs/tabgroup.jl --- sawfish.orgi/lisp/sawfish/wm/tabs/tabgroup.jl +++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl @@ -30,7 +30,7 @@ tab-rank tab-group-window-list tab-group-window) - + (open rep rep.system rep.data.records @@ -44,16 +44,15 @@ sawfish.wm.commands.move-resize sawfish.wm.stacking sawfish.wm.util.groups + sawfish.wm.commands.groups sawfish.wm.workspace) (define-structure-alias tabgroup sawfish.wm.tabs.tabgroup) (defvar tab-groups nil) - (defvar tab-refresh-lock t) (defvar tab-move-lock t) - (define-record-type :tab-group (tab-build-group p d wl) tab-group? @@ -80,26 +79,26 @@ (define (tab-find-window win) "Return a group containing win" (let loop ((gr tab-groups)) - (cond - ((null gr) - (tab-make-new-group win) - ) - ((member win (tab-group-window-list (car gr))) - (car gr)) - (t - (loop (cdr gr)))))) + (cond + ((null gr) + (tab-make-new-group win) + ) + ((member win (tab-group-window-list (car gr))) + (car gr)) + (t + (loop (cdr gr)))))) (define (tab-window-group-index win) "Return the index of the group containing win" (let loop ((index 0)) - (cond - ((eq index (length tab-groups)) - (tab-make-new-group win) - index) - ((member win (tab-group-window-list (nth index tab-groups))) - index) - (t - (loop (+ index 1)))))) + (cond + ((eq index (length tab-groups)) + (tab-make-new-group win) + index) + ((member win (tab-group-window-list (nth index tab-groups))) + index) + (t + (loop (+ index 1)))))) (define (tab-rank elem list) (if (eq elem (car list)) @@ -116,6 +115,7 @@ (tab-build-group (tab-group-position old) (tab-group-dimensions old) l)) ;; releas from sawfish "default" group adopt by tab-group-window (add-window-to-new-group win) + (tab-refresh-group win 'frame) (window-put win 'fixed-position nil) (tab-refresh-group (car l) 'frame)))) @@ -133,6 +133,7 @@ (tab-group-dimensions group) (append (tab-group-window-list group) (list win)))) (tab-move-resize-frame-window-to win (car pos) (cdr pos) (car dim) (cdr dim)) + (raise-group win) (rebuild-frame win))) (define (tab-refresh-group win prop) @@ -152,8 +153,8 @@ (reframe-window w)) wins)) ((eq prop 'reframe-style) (let ((group-frame-style (window-get win 'frame-style)) - (dim (window-frame-dimensions win)) - (pos (window-position win))) + (dim (window-frame-dimensions win)) + (pos (window-position win))) (mapcar (lambda (w) (set-frame-style w group-frame-style) (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim)) @@ -168,19 +169,19 @@ (tab-build-group pos dim wins)))) ((eq prop 'fixed-position) (let ((group-frame-fixed-position (window-get win 'fixed-position))) - (mapcar (lambda (w) - (window-put w 'fixed-position group-frame-fixed-position) - (rebuild-frame w)) wins))) + (mapcar (lambda (w) + (window-put w 'fixed-position group-frame-fixed-position) + (rebuild-frame w)) wins))) ((eq prop 'type) (let ((group-frame-type (window-get win 'type))) - (mapcar (lambda (w) - (window-put w 'type group-frame-type) - (rebuild-frame w)) wins))) + (mapcar (lambda (w) + (window-put w 'type group-frame-type) + (reframe-window w)) wins))) ((eq prop 'depth) (let ((group-frame-depth (window-get win 'depth))) - (mapcar (lambda (w) - (window-put w 'depth group-frame-depth) - (rebuild-frame w)) wins))) + (mapcar (lambda (w) + (window-put w 'depth group-frame-depth) + (rebuild-frame w)) wins))) ((eq prop 'iconify) (mapcar (lambda (w) (iconify-window w) @@ -213,6 +214,7 @@ (group-frame-type (window-get win 'type)) (group-frame-sticky (window-get win 'sticky)) (group-frame-fixed-position (window-get win 'fixed-position)) + (group-frame-title-position (window-get win 'title-position)) (group-frame-depth (window-get win 'depth)) ;; adopt group for the new tab ;; use sawfish's "default" groups @@ -221,14 +223,19 @@ (window-put w 'sticky group-frame-sticky) (window-put w 'depth group-frame-depth) (window-put w 'fixed-position group-frame-fixed-position) + (window-put w 'title-position group-frame-title-position) (window-put w 'frame-style group-frame-style) ;; ugly hack, don't know why it's needed, but new groups are ;; listed with pos (0,0): + (tab-refresh-group w 'reframe) (tab-refresh-group win 'move) (add-window-to-group w group-id) (tab-put-window-in-group w index) + ;; + ;; call hook to redraw tablength from theme file + (call-window-hook 'window-state-change-hook w (list '(title-position))) (tab-delete-window-from-group w index2) - (tab-refresh-group win 'move))) + (tab-refresh-group win 'move))) (define (tab-release-window w) "Release active window from its group" @@ -243,7 +250,7 @@ (size (length gr)) (r (tab-rank win gr))) (nth (modulo (+ r n) size) gr))) - + (define (tab-same-group-p w1 w2) "Predicate : true <=> w1 and w2 are grouped together" (member w1 (tab-group-window-list (tab-find-window w2)))) @@ -271,7 +278,20 @@ (lambda (w) (eq w win)) (tab-group-window-list (tab-find-window win)))) ) + (define (raise-tab-group w) + (raise-group w)) + + (define (tab-group-sticky w) + (if (window-get w 'sticky) + (make-group-sticky w) + (make-group-unsticky w))) + (unless batch-mode + (add-hook 'focus-in-hook raise-tab-group) + (add-hook 'window-state-change-hook + (lambda (win args) + (if (= '(sticky) args) + (tab-group-sticky win)))) (add-hook 'window-state-change-hook (lambda (win args) (if (= '(fixed-position) args) @@ -289,11 +309,15 @@ (if (= '(stacking) args) (tab-refresh-group win 'depth)))) (add-hook 'after-move-hook (lambda (win) (tab-refresh-group win 'move))) - (add-hook 'while-moving-hook (lambda (win) (tab-refresh-group win 'move))) + (add-hook 'after-resize-hook (lambda (win) (tab-refresh-group win 'resize))) + ;; only update tabs by move if opaque move mode (opaque = slow) + ;; + (when (eq move-outline-mode 'opaque) + (add-hook 'while-moving-hook (lambda (win) (tab-refresh-group win 'move))) + ) (add-hook 'window-resized-hook (lambda (win) (tab-refresh-group win 'resize))) (add-hook 'shade-window-hook (lambda (win) (tab-refresh-group win 'shade))) (add-hook 'unshade-window-hook (lambda (win) (tab-refresh-group win 'unshade))) (add-hook 'iconify-window-hook (lambda (win) (tab-refresh-group win 'iconify))) (add-hook 'uniconify-window-hook (lambda (win) (tab-refresh-group win 'uniconify))) - (add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups) - (add-hook 'after-framing-hook (lambda (win) (tab-refresh-group win 'reframe))))) + (add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups)))
--- sawfish/lisp/sawfish.orgi/wm/keymaps.jl +++ sawfish/lisp/sawfish/wm/keymaps.jl @@ -126,6 +126,17 @@ :group bindings :type keymap) + (defcustom tabbar-keymap (bind-keys (make-keymap) + "Button1-Off2" 'toggle-window-shaded + "Button1-Move" 'move-window-interactively + "C-Button1-Off" 'tab-add-to-group + "C-Button1-Click" 'tab-release-window + "C-Button1-Move" 'move-window-interactively) + "Keymap containing bindings active when the pointer is in the tabbar of +a window. (Only mouse-bindings are evaluated in this map.)" + :group bindings + :type keymap) + (defcustom border-keymap (bind-keys (make-keymap) "Button3-Off" 'raise-lower-window "Button2-Move" 'move-window-interactively
--- sawfish/lisp/sawfish.orgi/wm/frames.jl +++ sawfish/lisp/sawfish/wm/frames.jl @@ -659,6 +659,12 @@ (define-frame-class 'title `((keymap . title-keymap) (cursor . ,(cursor-for-frame-part 'title)))) + (define-frame-class 'tabbar-horizontal `((keymap . tabbar-keymap) + (cursor . ,(cursor-for-frame-part 'title)))) + + (define-frame-class 'tabbar-vertical `((keymap . tabbar-keymap) + (cursor . ,(cursor-for-frame-part 'title)))) + (mapc (lambda (x) (define-frame-class x `((cursor . ,(cursor-for-frame-part x)) (keymap . border-keymap))))
diff -urNad sawfish.orgi/lisp/sawfish/wm/focus.jl sawfish/lisp/sawfish/wm/focus.jl --- sawfish.orgi/lisp/sawfish/wm/focus.jl +++ sawfish/lisp/sawfish/wm/focus.jl @@ -23,11 +23,12 @@ (export define-focus-mode autoload-focus-mode focus-mode + raise-tabs-on-hover-setter set-focus-mode focus-push-map focus-pop-map warp-pointer-if-necessary - focus-revert + focus-revert focus-within-click-event) (open rep @@ -51,6 +52,12 @@ :before-set (lambda () (focus-mode-changed 'before)) :after-set (lambda () (focus-mode-changed 'after))) + (defcustom tab-raise-on-hover nil + "Raise tabs on hover" + :group focus + :type boolean + :after-set (lambda () (raise-tabs-on-hover-setter))) + (defcustom focus-click-through t "Click-to-focus mode passes the click through to the application." :type boolean @@ -209,6 +216,16 @@ (window-really-wants-input-p w)) (set-input-focus w)))))) + (define (raise-tabs-on-hover-action w) + (require 'sawfish.wm.stacking) + (raise-window w)) + + (define (raise-tabs-on-hover-setter) + (if (eq tab-raise-on-hover 't) + (add-hook 'enter-frame-part-hook raise-tabs-on-hover-action) + (when (add-hook 'enter-frame-part-hook raise-tabs-on-hover-action) + (remove-hook 'enter-frame-part-hook raise-tabs-on-hover-action)))) + (define (focus-click) (let ((w (current-event-window)) (event (current-event)))
--- sawfish/lisp/sawfish.orgi/wm/gaol.jl +++ sawfish/lisp/sawfish/wm/gaol.jl @@ -71,6 +71,7 @@ sawfish.wm.util.gradient sawfish.wm.util.recolor-image sawfish.wm.theming.make-theme + sawfish.wm.tabs.tab ;; compatibility timers gradient make-theme))
diff --git a/lisp/sawfish/wm/ext/match-window.jl b/lisp/sawfish/wm/ext/match-window.jl index 2fa9421..8b9bfef 100644 --- a/lisp/sawfish/wm/ext/match-window.jl +++ b/lisp/sawfish/wm/ext/match-window.jl @@ -91,6 +91,7 @@ `(choice ,@(mapcar car match-window-types)))) (frame-style ,(lambda () `(symbol ,@(find-all-frame-styles t)))) + (title-position (choice top bottom right left)) (dimensions (pair (number 1) (number 1))) (maximized (choice all vertical horizontal fullscreen full-xinerama)) diff --git a/lisp/sawfish/wm/ext/window-history.jl b/lisp/sawfish/wm/ext/window-history.jl index 4746f00..015275b 100644 --- a/lisp/sawfish/wm/ext/window-history.jl +++ b/lisp/sawfish/wm/ext/window-history.jl @@ -74,7 +74,7 @@ ;; list of states in window-state-change-hook that should be tracked (defvar window-history-states '(sticky ignored never-focus type maximized frame-style cycle-skip - window-list-skip)) + window-list-skip title-position)) ;; property matched on (defvar window-history-key-property '(WM_CLASS WM_WINDOW_ROLE))
diff -urNad sawfish.orgi/themes/Elberg-tabbed/theme.jl sawfish/themes/Elberg-tabbed/theme.jl --- sawfish.orgi/themes/Elberg-tabbed/theme.jl +++ sawfish/themes/Elberg-tabbed/theme.jl @@ -8,440 +8,508 @@ ;; Modified to add tabbed windowing support by Scott Scriven. -(let* - ;; Update window title pixel length - ((title-width - (lambda (w) - (let - ((w-width (car (window-dimensions w)))) - (max 0 (min (- w-width 100) (text-width (window-name w))))))) - - ;; 6x19 - upper left corner - (upper-left-images (list (make-image "i-ul.png") - (make-image "a-ul.png"))) - (upper-left-shaped-images (list (make-image "i-uls.png") - (make-image "a-uls.png"))) - - ;; 16x19 - upper left menu button - (menu-images (list (make-image "i-th.png") - (make-image "a-th.png") - (make-image "p-th.png") - (make-image "c-th.png"))) - - ;; 11x19 - upper left grey to green border - (top-lefthollow-images (list (make-image "i-t1.png") - (make-image "a-t1.png"))) - - ;; 3x19 - upper green background - (top-hollow-images (list (make-image "i-t2.png") - (make-image "a-t2.png"))) - ;; 11x19 - upper right green to grey border - (top-righthollow-images (list (make-image "i-t3.png") - (make-image "a-t3.png"))) - - ;; 3x19 - upper grey background - (top-grey-images (list (make-image "i-t0.png") - (make-image "a-t0.png"))) - - ;; 17x16 - iconify icon - (iconify-images (list (make-image "i-ti.png") - (make-image "a-ti.png") - (make-image "p-ti.png") - (make-image "c-ti.png"))) - - ;; 17x16 - maximize icon - (maximize-images (list (make-image "i-tm.png") - (make-image "a-tm.png") - (make-image "p-tm.png") - (make-image "c-tm.png"))) - - ;; 17x16 - close icon - (close-images (list (make-image "i-tx.png") - (make-image "a-tx.png") - (make-image "p-tx.png") - (make-image "c-tx.png"))) - - ;; 18x6 - upper right corner - (upper-right-images (list (make-image "i-ur.png") - (make-image "a-ur.png"))) - (upper-right-shaped-images (list (make-image "i-urs.png") - (make-image "a-urs.png"))) - - - ;; 6x18 - left side - (left-side-images (list (make-image "i-ls.png") - (make-image "a-ls.png"))) - ;; 6x18 - right side - (right-side-images (list (make-image "i-rs.png") - (make-image "a-rs.png"))) - - ;; 6x6 - lower left corner - (bottom-left-images (list (make-image "i-ll.png") - (make-image "a-ll.png"))) - ;; 18x6 - lower ledge - (bottom-images (list (make-image "i-bot.png") - (make-image "a-bot.png"))) - ;; 6x6 - lower right corner - (bottom-right-images (list (make-image "i-lr.png") - (make-image "a-lr.png"))) - - ;; 4x4 - (t-upper-left-images (list (make-image "i-tul.png") - (make-image "a-tul.png"))) - ;; 11x4 - (t-upper-side-images (list (make-image "i-ttop.png") - (make-image "a-ttop.png"))) - ;; 17x4 - (t-upper-right-images (list (make-image "i-tur.png") - (make-image "a-tur.png"))) - (t-upper-right-shaped-images (list (make-image "i-turs.png") - (make-image "a-turs.png"))) - - ;; 4x17 - (t-left-images (list (make-image "i-tls.png") - (make-image "a-tls.png"))) - - ;; 17x16 - (t-close-images (list (make-image "i-ttx.png") - (make-image "a-ttx.png") - (make-image "p-ttx.png") - (make-image "c-ttx.png"))) - - ;; 17x3 - (t-right-images (list (make-image "i-tt0.png") - (make-image "a-tt0.png"))) - - ;; 4x4 - (t-bottom-left-images (list (make-image "i-tll.png") - (make-image "a-tll.png"))) - ;; 11x4 - (t-bottom-side-images (list (make-image "i-tbot.png") - (make-image "a-tbot.png"))) - ;; 17x4 - (t-bottom-right-images (list (make-image "i-tlr.png") - (make-image "a-tlr.png"))) - (t-bottom-right-shaped-images (list (make-image "i-tlrs.png") - (make-image "a-tlrs.png"))) - - - (text-colors '("grey85" "white")) - - ;; frame layout - - (frame `(((background . ,upper-left-images) - (left-edge . -6) - (top-edge . -19) - (class . top-left-corner)) - - ;; menu button - ((background . ,menu-images) - (top-edge . -19) - (left-edge . 0) - (class . menu-button)) - - ;; top curves - ;;((background . ,top-lefthollow-images) - ;; (top-edge . -19) - ;; ;(left-edge . 16) - ;; (left-edge . 0) - ;; (class . title)) - - ;; top green - ;;((background . ,top-hollow-images) - ;; (foreground . ,text-colors) - ;; (text . ,window-name) - ;; (x-justify . 4) - ;; (y-justify . center) - ;; (top-edge . -19) - ;; ;(left-edge . 27) - ;; (left-edge . 11) - ;; (width . ,(lambda (w) (+ (title-width w) 13))) - ;; ;(right-edge . 27) - ;; (class . title)) - - ;; top curves - ;;((background . ,top-righthollow-images) - ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 37))) - ;; (left-edge . ,(lambda (w) (+ (title-width w) 21))) - ;; ;(right-edge . 16) - ;; (top-edge . -19) - ;; (class . title)) - - ;; top grey - ;;((background . ,top-grey-images) - ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 48))) - ;; (left-edge . ,(lambda (w) (+ (title-width w) 32))) - ;; (top-edge . -19) - ;; ;(right-edge . 48) - ;; (right-edge . 16) - ;; (class . title)) +;;(define title-width +;; (lambda (w) +;; (let +;; ((w-width (car (window-dimensions w)))) +;; (max 0 (min (- w-width 100) (text-width (window-name w))))))) - ;; left border - ((background . ,left-side-images) - (left-edge . -6) - (top-edge . 0) - (bottom-edge . 0) - (class . left-border)) +;; 6x19 - upper left corner +(define upper-left-images (list (make-image "i-ul.png") + (make-image "a-ul.png"))) +(define upper-left-shaped-images (list (make-image "i-uls.png") + (make-image "a-uls.png"))) - ;; top-right corner - ((background . ,upper-right-images) - (right-edge . -6) - (top-edge . -19) - (class . top-right-corner)) +;; 16x19 - upper left menu button +(define menu-images + (list (make-image "i-th.png") + (make-image "a-th.png") + (make-image "p-th.png") + (make-image "c-th.png"))) - ;; right border - ((background . ,right-side-images) - (right-edge . -6) - (top-edge . 0) - (bottom-edge . 0) - (class . right-border)) +;; 11x19 - upper left grey to green border +(define top-lefthollow-images + (list (make-image "i-t1.png") + (make-image "a-t1.png"))) - ;; bottom border - ((background . ,bottom-images) - (left-edge . 0) - (right-edge . 0) - (bottom-edge . -6) - (class . bottom-border)) +;; 3x19 - upper green background +(define top-hollow-images + (list (make-image "i-t2.png") + (make-image "a-t2.png"))) - ;; bottom-left corner - ((background . ,bottom-left-images) - (left-edge . -6) - (bottom-edge . -6) - (class . bottom-left-corner)) +;; 11x19 - upper right green to grey border +(define top-righthollow-images + (list (make-image "i-t3.png") + (make-image "a-t3.png"))) - ;; bottom-right corner - ((background . ,bottom-right-images) - (right-edge . -6) - (bottom-edge . -6) - (class . bottom-right-corner)) +;; 3x19 - upper grey background +(define top-grey-images + (list (make-image "i-t0.png") + (make-image "a-t0.png"))) - ;; iconify button - ;((background . ,iconify-images) - ; (right-edge . 32) - ; (top-edge . -19) - ; (class . iconify-button)) +;; 17x16 - iconify icon +(define iconify-images + (list (make-image "i-ti.png") + (make-image "a-ti.png") + (make-image "p-ti.png") + (make-image "c-ti.png"))) - ;; maximize button - ;((background . ,maximize-images) - ; (right-edge . 16) - ; (top-edge . -19) - ; (class . maximize-button)) +;; 17x16 - maximize icon +(define maximize-images + (list (make-image "i-tm.png") + (make-image "a-tm.png") + (make-image "p-tm.png") + (make-image "c-tm.png"))) - ;; delete button - ((background . ,close-images) - (right-edge . 0) - (top-edge . -19) - (class . close-button)) +;; 17x16 - close icon +(define close-images + (list (make-image "i-tx.png") + (make-image "a-tx.png") + (make-image "p-tx.png") + (make-image "c-tx.png"))) - ;; tab left curve - ((background . ,top-lefthollow-images) - (top-edge . -19) - (class . tab-l)) +;; 18x6 - upper right corner +(define upper-right-images + (list (make-image "i-ur.png") + (make-image "a-ur.png"))) - ;; tab - ( - (background . ,top-hollow-images) - (foreground . ,text-colors) - (top-edge . -19) - ;(left-edge . 0) - (height . 19) - (text . ,window-name) - ;(x-justify . 4) - ;(y-justify . center) - (class . tab)) +(define upper-right-shaped-images + (list (make-image "i-urs.png") + (make-image "a-urs.png"))) - ;; tab right curve - ((background . ,top-righthollow-images) - (top-edge . -19) - (class . tab-r)) +;; 6x18 - left side +(define left-side-images + (list (make-image "i-ls.png") + (make-image "a-ls.png"))) +;; 6x18 - right side +(define right-side-images + (list (make-image "i-rs.png") + (make-image "a-rs.png"))) - )) +;; 6x6 - lower left corner +(define bottom-left-images + (list (make-image "i-ll.png") + (make-image "a-ll.png"))) - (shaped-frame `(((background . ,upper-left-shaped-images) - (left-edge . -6) - (top-edge . -19) - (height . 19) - (class . top-left-corner)) +;; 18x6 - lower ledge +(define bottom-images + (list (make-image "i-bot.png") + (make-image "a-bot.png"))) - ;; menu button - ((background . ,menu-images) - (top-edge . -19) - (left-edge . 0) - (class . menu-button)) +;; 6x6 - lower right corner +(define bottom-right-images + (list (make-image "i-lr.png") + (make-image "a-lr.png"))) - ;; top curves - ;((background . ,top-lefthollow-images) - ;(top-edge . -19) - ;(left-edge . 16) - ;(class . title)) +;; 4x4 +(define t-upper-left-images + (list (make-image "i-tul.png") + (make-image "a-tul.png"))) - ;; Title text area - ;((background . ,top-hollow-images) - ;(foreground . ,text-colors) - ;(text . ,window-name) - ;(x-justify . 4) - ;(y-justify . center) - ;(top-edge . -19) - ;(left-edge . 27) - ;(width . ,(lambda (w) (+ (title-width w) 13))) - ;(class . title)) +;; 11x4 +(define t-upper-side-images + (list (make-image "i-ttop.png") + (make-image "a-ttop.png"))) - ;; top curves - ;((background . ,top-righthollow-images) - ;(left-edge . ,(lambda (w) (+ (title-width w) 37))) - ;(top-edge . -19) - ;(class . title)) +;; 17x4 +(define t-upper-right-images + (list (make-image "i-tur.png") + (make-image "a-tur.png"))) - ;; top grey - ;((background . ,top-grey-images) - ;(left-edge . ,(lambda (w) (+ (title-width w) 48))) - ;(top-edge . -19) - ;(right-edge . 48) - ;(class . title)) +(define t-upper-right-shaped-images + (list (make-image "i-turs.png") + (make-image "a-turs.png"))) - ;; top-right corner - ((background . ,upper-right-shaped-images) - (right-edge . -6) - (top-edge . -19) - (height . 19) - (class . top-right-corner)) +;; 4x17 +(define t-left-images + (list (make-image "i-tls.png") + (make-image "a-tls.png"))) - ;; iconify button - ;((background . ,iconify-images) - ;(right-edge . 32) - ;(top-edge . -19) - ;(class . iconify-button)) +;; 17x16 +(define t-close-images + (list (make-image "i-ttx.png") + (make-image "a-ttx.png") + (make-image "p-ttx.png") + (make-image "c-ttx.png"))) - ;; maximize button - ;((background . ,maximize-images) - ;(right-edge . 16) - ;(top-edge . -19) - ;(class . maximize-button)) +;; 17x3 +(define t-right-images + (list (make-image "i-tt0.png") + (make-image "a-tt0.png"))) - ;; delete button - ((background . ,close-images) - (right-edge . 0) - (top-edge . -19) - (class . close-button)) +;; 4x4 +(define t-bottom-left-images + (list (make-image "i-tll.png") + (make-image "a-tll.png"))) - ;; tab left curve - ((background . ,top-lefthollow-images) - (top-edge . -19) - (class . tab-l)) +;; 11x4 +(define t-bottom-side-images + (list (make-image "i-tbot.png") + (make-image "a-tbot.png"))) - ;; tab - ( - (background . ,top-hollow-images) - (foreground . ,text-colors) - (top-edge . -19) - ;(left-edge . 0) - (height . 19) - (text . ,window-name) - ;(x-justify . 4) - ;(y-justify . center) - (class . tab)) +;; 17x4 +(define t-bottom-right-images + (list (make-image "i-tlr.png") + (make-image "a-tlr.png"))) - ;; tab right curve - ((background . ,top-righthollow-images) - (top-edge . -19) - (class . tab-r)) +(define t-bottom-right-shaped-images + (list (make-image "i-tlrs.png") + (make-image "a-tlrs.png"))) - )) +(define text-colors (list "grey50" "white")) - (transient-frame `(((background . ,t-upper-left-images) - (left-edge . -4) - (top-edge . -4) - (class . top-left-corner)) +;; frame layout - ;;top-right corner - ((background . ,t-upper-right-images) - (right-edge . -17) - (top-edge . -4) - (class . top-right-corner)) +(define frame + `(((background . ,upper-left-images) + (left-edge . -6) + (top-edge . -19) + (class . top-left-corner)) + + ;; menu button + ((background . ,menu-images) + (top-edge . -19) + (left-edge . 0) + (class . menu-button)) + + ;; top curves + ;;((background . ,top-lefthollow-images) + ;; (top-edge . -19) + ;; ;(left-edge . 16) + ;; (left-edge . 0) + ;; (class . title)) + + ;; top green + ;;((background . ,top-hollow-images) + ;; (foreground . ,text-colors) + ;; (text . ,window-name) + ;; (x-justify . 4) + ;; (y-justify . center) + ;; (top-edge . -19) + ;; ;(left-edge . 27) + ;; (left-edge . 11) + ;; (width . ,(lambda (w) (+ (title-width w) 13))) + ;; ;(right-edge . 27) + ;; (class . title)) + + ;; top curves + ;;((background . ,top-righthollow-images) + ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 37))) + ;; (left-edge . ,(lambda (w) (+ (title-width w) 21))) + ;; ;(right-edge . 16) + ;; (top-edge . -19) + ;; (class . title)) + + ;; top grey + ;;((background . ,top-grey-images) + ;; ;(left-edge . ,(lambda (w) (+ (title-width w) 48))) + ;; (left-edge . ,(lambda (w) (+ (title-width w) 32))) + ;; (top-edge . -19) + ;; ;(right-edge . 48) + ;; (right-edge . 16) + ;; (class . title)) + + ;; left border + ((background . ,left-side-images) + (left-edge . -6) + (top-edge . 0) + (bottom-edge . 0) + (class . left-border)) + + ;; top-right corner + ((background . ,upper-right-images) + (right-edge . -6) + (top-edge . -19) + (class . top-right-corner)) + + ;; right border + ((background . ,right-side-images) + (right-edge . -6) + (top-edge . 0) + (bottom-edge . 0) + (class . right-border)) + + ;; bottom border + ((background . ,bottom-images) + (left-edge . 0) + (right-edge . 0) + (bottom-edge . -6) + (class . bottom-border)) + + ;; bottom-left corner + ((background . ,bottom-left-images) + (left-edge . -6) + (bottom-edge . -6) + (class . bottom-left-corner)) + + ;; bottom-right corner + ((background . ,bottom-right-images) + (right-edge . -6) + (bottom-edge . -6) + (class . bottom-right-corner)) + + ;; iconify button + ;;((background . ,iconify-images) + ;; (right-edge . 32) + ;; (top-edge . -19) + ;; (class . iconify-button)) + + ;; maximize button + ;;((background . ,maximize-images) + ;; (right-edge . 16) + ;; (top-edge . -19) + ;; (class . maximize-button)) + + ;; delete button + ((background . ,close-images) + (right-edge . 0) + (top-edge . -19) + (class . close-button)) + + ;; tab left curve + ((background . ,top-lefthollow-images) + (top-edge . -19) + (class . tabbar-horizontal-left-edge)) + + ;; tab + ((background . ,top-hollow-images) + (foreground . ,text-colors) + (top-edge . -19) + ;;(left-edge . 0) + (height . 19) + (text . ,window-name) + ;;(x-justify . 4) + ;;(y-justify . center) + (class . tabbar-horizontal)) + + ;; tab right curve + ((background . ,top-righthollow-images) + (top-edge . -19) + (class . tabbar-horizontal-right-edge)))) - ;;title border - ((background . ,t-upper-side-images) - (left-edge . -1) - (right-edge . -1) - (top-edge . -4) - (class . top-border)) +(define shaped-frame + `(((background . ,upper-left-shaped-images) + (left-edge . -6) + (top-edge . -19) + (height . 19) + (class . top-left-corner)) + + ;; menu button + ((background . ,menu-images) + (top-edge . -19) + (left-edge . 0) + (class . menu-button)) + + ;; top curves + ;;((background . ,top-lefthollow-images) + ;;(top-edge . -19) + ;;(left-edge . 16) + ;;(class . title)) + + ;; Title text area + ;;((background . ,top-hollow-images) + ;;(foreground . ,text-colors) + ;;(text . ,window-name) + ;;(x-justify . 4) + ;;(y-justify . center) + ;;(top-edge . -19) + ;;(left-edge . 27) + ;;(width . ,(lambda (w) (+ (title-width w) 13))) + ;;(class . title)) + + ;; top curves + ;;((background . ,top-righthollow-images) + ;;(left-edge . ,(lambda (w) (+ (title-width w) 37))) + ;;(top-edge . -19) + ;;(class . title)) + + ;; top grey + ;;((background . ,top-grey-images) + ;;(left-edge . ,(lambda (w) (+ (title-width w) 48))) + ;;(top-edge . -19) + ;;(right-edge . 48) + ;;(class . title)) + + ;; top-right corner + ((background . ,upper-right-shaped-images) + (right-edge . -6) + (top-edge . -19) + (height . 19) + (class . top-right-corner)) + + ;; iconify button + ;;((background . ,iconify-images) + ;;(right-edge . 32) + ;;(top-edge . -19) + ;;(class . iconify-button)) + + ;; maximize button + ;;((background . ,maximize-images) + ;;(right-edge . 16) + ;;(top-edge . -19) + ;;(class . maximize-button)) + + ;; delete button + ((background . ,close-images) + (right-edge . 0) + (top-edge . -19) + (class . close-button)) + + ;; tab left curve + ((background . ,top-lefthollow-images) + (top-edge . -19) + (class . tabbar-horizontal-left-edge)) + + ;; tab + ((background . ,top-hollow-images) + (foreground . ,text-colors) + (top-edge . -19) + ;;(left-edge . 0) + (height . 19) + (text . ,window-name) + ;;(x-justify . 4) + ;;(y-justify . center) + (class . tabbar-horizontal)) + + ;; tab right curve + ((background . ,top-righthollow-images) + (top-edge . -19) + (class . tabbar-horizontal-right-edge)))) - ;; left border - ((background . ,t-left-images) - (left-edge . -4) - (top-edge . -1) - (bottom-edge . -1) - (class . left-border)) - ;; right border - ((background . ,t-right-images) - (right-edge . -17) - (top-edge . -1) - (bottom-edge . -1) - (class . title)) +(define transient-frame + `(((background . ,t-upper-left-images) + (left-edge . -4) + (top-edge . -4) + (class . top-left-corner)) - ;; bottom border - ((background . ,t-bottom-side-images) - (left-edge . -1) - (right-edge . -1) - (bottom-edge . -4) - (class . bottom-border)) + ;;top-right corner + ((background . ,t-upper-right-images) + (right-edge . -17) + (top-edge . -4) + (class . top-right-corner)) + + ;;title border + ((background . ,t-upper-side-images) + (left-edge . -1) + (right-edge . -1) + (top-edge . -4) + (class . top-border)) + + ;; left border + ((background . ,t-left-images) + (left-edge . -4) + (top-edge . -1) + (bottom-edge . -1) + (class . left-border)) + + ;; right border + ((background . ,t-right-images) + (right-edge . -17) + (top-edge . -1) + (bottom-edge . -1) + (class . title)) + + ;; bottom border + ((background . ,t-bottom-side-images) + (left-edge . -1) + (right-edge . -1) + (bottom-edge . -4) + (class . bottom-border)) + + ;; bottom-left corner + ((background . ,t-bottom-left-images) + (left-edge . -4) + (bottom-edge . -4) + (class . bottom-left-corner)) + + ;; bottom-right corner + ((background . ,t-bottom-right-images) + (right-edge . -17) + (bottom-edge . -4) + (class . bottom-right-corner)) + + ;; delete button + ((background . ,t-close-images) + (right-edge . -17) + (top-edge . 1) + (class . close-button)))) - ;; bottom-left corner - ((background . ,t-bottom-left-images) - (left-edge . -4) - (bottom-edge . -4) - (class . bottom-left-corner)) - ;; bottom-right corner - ((background . ,t-bottom-right-images) - (right-edge . -17) - (bottom-edge . -4) - (class . bottom-right-corner)) +(define shaped-transient-frame + `(((background . ,t-upper-right-shaped-images) + (right-edge . -17) + (top-edge . -4) + (class . top-right-corner)) + + ;; right border + ((background . ,t-right-images) + (right-edge . -17) + (top-edge . -1) + (bottom-edge . -1) + (class . title)) + + ;; bottom-right corner + ((background . ,t-bottom-right-shaped-images) + (right-edge . -17) + (bottom-edge . -4) + (class . bottom-right-corner)) + + ;; delete button + ((background . ,t-close-images) + (right-edge . -17) + (top-edge . 1) + (class . close-button)))) - ;; delete button - ((background . ,t-close-images) - (right-edge . -17) - (top-edge . 1) - (class . close-button)) +(define create-frames + (lambda () + (let ((Elberg-left-d-w 11) + (Elberg-right-d-w 11) + (Elberg-left-m 16) + (Elberg-rigth-m 16) + (Elberg-left-m-t 0) + (Elberg-right-m-t 0)) + (require 'sawfish.wm.tabs.tab) + (set-tab-adjustments #:theme-left-dec-width Elberg-left-d-w #:theme-right-dec-width Elberg-right-d-w #:theme-left-margin + Elberg-left-m #:theme-right-margin Elberg-rigth-m #:theme-left-margin-transient Elberg-left-m-t + #:theme-right-margin-transient Elberg-right-m-t)))) - )) +(create-frames) + +(add-frame-style 'Elberg-tabbed + (lambda (w type) + (case type + ((default) frame) + ((transient) transient-frame) + ((shaped) shaped-frame) + ((shaped-transient) shaped-transient-frame)))) - (shaped-transient-frame `(((background . ,t-upper-right-shaped-images) - (right-edge . -17) - (top-edge . -4) - (class . top-right-corner)) +(define (create-frames-only w) + (lambda () + (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed) + (create-frames)))) - ;; right border - ((background . ,t-right-images) - (right-edge . -17) - (top-edge . -1) - (bottom-edge . -1) - (class . title)) +(define (reframe-one w) + (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed) + (create-frames) + (reframe-window w))) - ;; bottom-right corner - ((background . ,t-bottom-right-shaped-images) - (right-edge . -17) - (bottom-edge . -4) - (class . bottom-right-corner)) +(define (reframe-group w) + (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed) + (map-window-group + (lambda (x) + (reframe-one x)) w))) - ;; delete button - ((background . ,t-close-images) - (right-edge . -17) - (top-edge . 1) - (class . close-button))))) +;; create only frames when focus a window don't draw +;; +(add-hook 'focus-in-hook create-frames-only) +(add-hook 'add-window-hook create-frames-only) - (add-frame-style 'Elberg-tabbed - (lambda (w type) - (case type - ((default) frame) - ((transient) transient-frame) - ((shaped) shaped-frame) - ((shaped-transient) shaped-transient-frame)))) +(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one) - (call-after-property-changed - '(WM_NAME _NET_WM_NAME) (lambda (w prop state) - (reframe-window w)))) +;; tabgroup.jl call +;; +(call-after-state-changed '(title-position) reframe-group) diff -urNad sawfish.orgi/themes/get-S-tabbed/theme.jl sawfish/themes/get-S-tabbed/theme.jl --- sawfish.orgi/themes/get-S-tabbed/theme.jl +++ sawfish/themes/get-S-tabbed/theme.jl @@ -2,319 +2,352 @@ ;; Based off of my arctic Enlightenment theme.... +(define font default-font) +(define font-colors (list "grey50" "white")) -(let* - ( - ;;(font (get-font "-*-lucida-medium-r-normal-*-*-100-*-*-p-*-iso8859-1")) - ;;(font (get-font "Sans 9")) - (font default-font) - (font-colors (list "grey50" "white")) - - (title-images - (list (make-image "title-bar-inactive.png") - (make-image "title-bar-active.png"))) - - (title-left-images - (list (set-image-border - (make-image "title-left-inactive.png") 10 10 0 0) - (set-image-border - (make-image "title-left-active.png") 10 10 0 0))) - - (title-left-f-images - (list (set-image-border - (make-image "title-left-inactive-f.png") 10 10 3 1) - (set-image-border - (make-image "title-left-active-f.png") 10 10 3 1))) - - (title-left-l-images - (list (make-image "title-left-inactive-l.png") - (make-image "title-left-active-l.png"))) - - (title-left-m-images - (list (set-image-border - (make-image "title-left-inactive-m.png") 10 10 0 0) - (set-image-border - (make-image "title-left-active-m.png") 10 10 0 0))) - - (title-left-r-images - (list (make-image "title-left-inactive-r.png") - (make-image "title-left-active-r.png"))) - - (iconify-images - (list (make-image "iconify-normal.png") - nil nil - (make-image "iconify-clicked.png"))) - - (maximize-images - (list (make-image "maximize-normal.png") - nil nil - (make-image "maximize-clicked.png"))) - - (menu-images - (list (make-image "menu-normal.png") - nil nil - (make-image "menu-clicked.png"))) - - (close-images - (list (make-image "close-normal.png") - nil nil - (make-image "close-clicked.png"))) - - (title-right - (set-image-border(make-image "title-right.png")10 10 10 10)) - (title-right-l - (set-image-border(make-image "title-right-l.png") 3 0 10 10)) - (title-right-r - (set-image-border(make-image "title-right-r.png") 0 3 10 10)) - (border-top (make-image "border_top.png")) - (border-bottom (make-image "border_bottom.png")) - (border-right (make-image "border_right.png")) - (border-left (make-image "border_left.png")) - - (corner-tl (make-image "corner_top_left.png")) - (corner-tr (make-image "corner_top_right.png")) - (corner-tl-2 (make-image "corner_top_left_2.png")) - (corner-tr-2 (make-image "corner_top_right_2.png")) - (corner-bl (make-image "corner_bottom_left.png")) - (corner-br (make-image "corner_bottom_right.png")) - (corner-bl-2 (make-image "corner_bottom_left_2.png")) - (corner-br-2 (make-image "corner_bottom_right_2.png")) - - (shaped-frame `(((background . ,title-left-images) - (foreground . ,font-colors) - (font . ,font) - (text . ,window-name) - (x-justify . center) - (y-justify . center) - (top-edge . -16) - (left-edge . 15) - (right-edge . 40) - (class . title)))) - - (shaped-transient-frame `(((background . ,title-images) - (foreground . ,font-colors) - (font . ,font) - (text . ,window-name) - (x-justify . center) - (y-justify . center) - (top-edge . -12) - (left-edge . 0) - (right-edge . 0) - (class . title)) - - ((background . ,menu-images) - (top-edge . -12) - (left-edge . 1) - (class . menu-button)) - - ((background . ,iconify-images) - (top-edge . -12) - (right-edge . 26) - (class . iconify-button)) - - ((background . ,maximize-images) - (top-edge . -12) - (right-edge . 13) - (class . maximize-button)) - - ((background . ,close-images) - (top-edge . -12) - (right-edge . 1) - (class . close-button)) - - ((background . ,border-left) - (top-edge . -12) - ;;(bottom-edge . 0) - (left-edge . -2) - (class . left-border)) - - ((background . ,border-right) - (top-edge . -12) - ;;(bottom-edge . 0) - (right-edge . -2) - (class . right-border)) - - ((background . ,border-top) - (top-edge . -14) - (right-edge . 0) - (left-edge . 0) - (class . top-border)) - - ((background . ,border-bottom) - (top-edge . 0) - (right-edge . 0) - (left-edge . 0) - (class . bottom-border)) - - ((background . ,corner-tl) - (top-edge . -14) - (left-edge . -2) - (class . top-left-corner)) - - ((background . ,corner-tr) - (top-edge . -14) - (right-edge . -2) - (class . top-right-corner)) - - ((background . ,corner-bl-2) - (top-edge . 0) - (left-edge . -2) - (class . bottom-left-corner)) - ((background . ,corner-br-2) - (top-edge . 0) - (right-edge . -2) - (class . bottom-right-corner)))) +(define title-images + (list (make-image "title-bar-inactive.png") + (make-image "title-bar-active.png"))) - (transient-frame `(((background . ,border-left) - (top-edge . -2) - (bottom-edge . 0) - (left-edge . -2) - (class . left-border)) +(define title-left-images + (list (set-image-border + (make-image "title-left-inactive.png") 10 10 0 0) + (set-image-border + (make-image "title-left-active.png") 10 10 0 0))) - ((background . ,border-right) - (top-edge . -2) - (bottom-edge . 0) - (right-edge . -2) - (class . right-border)) +(define title-left-f-images + (list (set-image-border + (make-image "title-left-inactive-f.png") 10 10 3 1) + (set-image-border + (make-image "title-left-active-f.png") 10 10 3 1))) - ((background . ,border-top) - (top-edge . -2) - (right-edge . 0) - (left-edge . 0) - (class . title)) +(define title-left-l-images + (list (make-image "title-left-inactive-l.png") + (make-image "title-left-active-l.png"))) - ((background . ,border-bottom) - (bottom-edge . -2) - (right-edge . 0) - (left-edge . 0) - (class . bottom-border)) +(define title-left-m-images + (list (set-image-border + (make-image "title-left-inactive-m.png") 10 10 0 0) + (set-image-border + (make-image "title-left-active-m.png") 10 10 0 0))) - ((background . ,corner-tl-2) - (top-edge . -2) - (left-edge . -2) - (class . top-left-corner)) +(define title-left-r-images + (list (make-image "title-left-inactive-r.png") + (make-image "title-left-active-r.png"))) - ((background . ,corner-tr-2) - (top-edge . -2) - (right-edge . -2) - (class . top-right-corner)) +(define iconify-images + (list (make-image "iconify-normal.png") + nil nil + (make-image "iconify-clicked.png"))) - ((background . ,corner-bl) - (bottom-edge . -2) - (left-edge . -2) - (class . bottom-left-corner)) +(define maximize-images + (list (make-image "maximize-normal.png") + nil nil + (make-image "maximize-clicked.png"))) - ((background . ,corner-br) - (bottom-edge . -2) - (right-edge . -2) - (class . bottom-right-corner)))) +(define menu-images + (list (make-image "menu-normal.png") + nil nil + (make-image "menu-clicked.png"))) - (frame `( - ;; TODO: re-add this part - ;;((background . ,title-right) - ;; (top-edge . -14) - ;; (left-edge . -3) - ;; (right-edge . -3) - ;; (class . title)) +(define close-images + (list (make-image "close-normal.png") + nil nil + (make-image "close-clicked.png"))) - ;; left part of title background - ((background . ,title-right-l) - (top-edge . -14) - (left-edge . -3) - (width . 18) - (class . title)) +(define title-right + (set-image-border(make-image "title-right.png")10 10 10 10)) +(define title-right-l + (set-image-border(make-image "title-right-l.png") 3 0 10 10)) +(define title-right-r + (set-image-border(make-image "title-right-r.png") 0 3 10 10)) +(define border-top (make-image "border_top.png")) +(define border-bottom (make-image "border_bottom.png")) +(define border-right (make-image "border_right.png")) +(define border-left (make-image "border_left.png")) - ;; right part of title background - ((background . ,title-right-r) - (top-edge . -14) - (width . 42) - (right-edge . -3) - (class . title)) +(define corner-tl (make-image "corner_top_left.png")) +(define corner-tr (make-image "corner_top_right.png")) +(define corner-tl-2 (make-image "corner_top_left_2.png")) +(define corner-tr-2 (make-image "corner_top_right_2.png")) +(define corner-bl (make-image "corner_bottom_left.png")) +(define corner-br (make-image "corner_bottom_right.png")) +(define corner-bl-2 (make-image "corner_bottom_left_2.png")) +(define corner-br-2 (make-image "corner_bottom_right_2.png")) - ;; tab - ;;((background . ,title-left-f-images) - ((background . ,title-left-m-images) - (foreground . ,font-colors) - (font . ,font) - (text . ,window-name) - (x-justify . center) - (y-justify . center) - (top-edge . -16) - ;;(left-edge . 15) - ;;(right-edge . 40) - (class . tab)) +(define shaped-frame + `(((background . ,title-left-images) + (foreground . ,font-colors) + (font . ,font) + (text . ,window-name) + (x-justify . center) + (y-justify . center) + (top-edge . -16) + (left-edge . 15) + (right-edge . 40) + (class . title)))) - ;; tab - ((background . ,title-left-l-images) - (top-edge . -16) - (class . tab-l)) +(define shaped-transient-frame + `(((background . ,title-images) + (foreground . ,font-colors) + (font . ,font) + (text . ,window-name) + (x-justify . center) + (y-justify . center) + (top-edge . -12) + (left-edge . 0) + (right-edge . 0) + (class . title)) + + ((background . ,menu-images) + (top-edge . -12) + (left-edge . 1) + (class . menu-button)) + + ((background . ,iconify-images) + (top-edge . -12) + (right-edge . 26) + (class . iconify-button)) + + ((background . ,maximize-images) + (top-edge . -12) + (right-edge . 13) + (class . maximize-button)) + + ((background . ,close-images) + (top-edge . -12) + (right-edge . 1) + (class . close-button)) - ;; tab - ((background . ,title-left-r-images) - (top-edge . -16) - (class . tab-r)) + ((background . ,border-left) + (top-edge . -12) + ;;(bottom-edge . 0) + (left-edge . -2) + (class . left-border)) + + ((background . ,border-right) + (top-edge . -12) + ;;(bottom-edge . 0) + (right-edge . -2) + (class . right-border)) - ((background . ,menu-images) - (top-edge . -12) - (left-edge . 1) - (class . menu-button)) + ((background . ,border-top) + (top-edge . -14) + (right-edge . 0) + (left-edge . 0) + (class . top-border)) + + ((background . ,border-bottom) + (top-edge . 0) + (right-edge . 0) + (left-edge . 0) + (class . bottom-border)) + + ((background . ,corner-tl) + (top-edge . -14) + (left-edge . -2) + (class . top-left-corner)) + + ((background . ,corner-tr) + (top-edge . -14) + (right-edge . -2) + (class . top-right-corner)) + + ((background . ,corner-bl-2) + (top-edge . 0) + (left-edge . -2) + (class . bottom-left-corner)) + + ((background . ,corner-br-2) + (top-edge . 0) + (right-edge . -2) + (class . bottom-right-corner)))) - ((background . ,iconify-images) - (top-edge . -12) - (right-edge . 26) - (class . iconify-button)) +(define transient-frame + `(((background . ,border-left) + (top-edge . -2) + (bottom-edge . 0) + (left-edge . -2) + (class . left-border)) + + ((background . ,border-right) + (top-edge . -2) + (bottom-edge . 0) + (right-edge . -2) + (class . right-border)) + + ((background . ,border-top) + (top-edge . -2) + (right-edge . 0) + (left-edge . 0) + (class . title)) + + ((background . ,border-bottom) + (bottom-edge . -2) + (right-edge . 0) + (left-edge . 0) + (class . bottom-border)) + + ((background . ,corner-tl-2) + (top-edge . -2) + (left-edge . -2) + (class . top-left-corner)) + + ((background . ,corner-tr-2) + (top-edge . -2) + (right-edge . -2) + (class . top-right-corner)) + + ((background . ,corner-bl) + (bottom-edge . -2) + (left-edge . -2) + (class . bottom-left-corner)) + + ((background . ,corner-br) + (bottom-edge . -2) + (right-edge . -2) + (class . bottom-right-corner)))) - ((background . ,maximize-images) - (top-edge . -12) - (right-edge . 13) - (class . maximize-button)) +(define frame + `( + ;; TODO: re-add this part + ;;((background . ,title-right) + ;; (top-edge . -14) + ;; (left-edge . -3) + ;; (right-edge . -3) + ;; (class . title)) + + ;; left part of title background + ((background . ,title-right-l) + (top-edge . -14) + (left-edge . -3) + (width . 18) + (class . title)) + + ;; right part of title background + ((background . ,title-right-r) + (top-edge . -14) + (width . 42) + (right-edge . -3) + (class . title)) + + ;; tab + ;;((background . ,title-left-f-images) + ((background . ,title-left-m-images) + (foreground . ,font-colors) + (font . ,font) + (text . ,window-name) + (x-justify . center) + (y-justify . center) + (top-edge . -16) + ;;(left-edge . 15) + ;;(right-edge . 40) + (class . tabbar-horizontal)) + + ;; tab + ((background . ,title-left-l-images) + (top-edge . -16) + (class . tabbar-horizontal-left-edge)) + + ;; tab + ((background . ,title-left-r-images) + (top-edge . -16) + (class . tabbar-horizontal-right-edge)) + + ((background . ,menu-images) + (top-edge . -12) + (left-edge . 1) + (class . menu-button)) + + ((background . ,iconify-images) + (top-edge . -12) + (right-edge . 26) + (class . iconify-button)) + + ((background . ,maximize-images) + (top-edge . -12) + (right-edge . 13) + (class . maximize-button)) + + ((background . ,close-images) + (top-edge . -12) + (right-edge . 1) + (class . close-button)) + + ((background . ,border-left) + (top-edge . 0) + (bottom-edge . 0) + (left-edge . -2) + (class . left-border)) + + ((background . ,border-right) + (top-edge . 0) + (bottom-edge . 0) + (right-edge . -2) + (class . right-border)) + + ((background . ,border-bottom) + (bottom-edge . 0) + (right-edge . 0) + (left-edge . 0) + (class . bottom-border)) + + ((background . ,corner-bl) + (bottom-edge . 0) + (left-edge . -2) + (class . bottom-left-corner)) + + ((background . ,corner-br) + (bottom-edge . 0) + (right-edge . -2) + (class . bottom-right-corner)))) - ((background . ,close-images) - (top-edge . -12) - (right-edge . 1) - (class . close-button)) +(define create-frames + (lambda () + (let ((left-d-w 5) + (right-d-w 5) + (left-m 14) + (rigth-m 38) + (left-m-t 0) + (right-m-t 0)) + (require 'sawfish.wm.tabs.tab) + (set-tab-adjustments #:theme-left-dec-width left-d-w #:theme-right-dec-width right-d-w #:theme-left-margin left-m #:theme-right-margin rigth-m + #:theme-left-margin-transient left-m-t #:theme-right-margin-transient right-m-t)))) - ((background . ,border-left) - (top-edge . 0) - (bottom-edge . 0) - (left-edge . -2) - (class . left-border)) +(create-frames) - ((background . ,border-right) - (top-edge . 0) - (bottom-edge . 0) - (right-edge . -2) - (class . right-border)) +(add-frame-style 'get-S-tabbed + (lambda (w type) + (case type + ((default) frame) + ((transient) transient-frame) + ((shaped) shaped-frame) + ((shaped-transient) shaped-transient-frame)))) - ((background . ,border-bottom) - (bottom-edge . 0) - (right-edge . 0) - (left-edge . 0) - (class . bottom-border)) +(define (create-frames-only w) + (lambda () + (when (eq (window-get w 'current-frame-style) 'get-S-tabbed) + (create-frames)))) - ((background . ,corner-bl) - (bottom-edge . 0) - (left-edge . -2) - (class . bottom-left-corner)) +(define (reframe-one w) + (when (eq (window-get w 'current-frame-style) 'get-S-tabbed) + (create-frames) + (reframe-window w))) - ((background . ,corner-br) - (bottom-edge . 0) - (right-edge . -2) - (class . bottom-right-corner))))) +(define (reframe-group w) + (when (eq (window-get w 'current-frame-style) 'get-S-tabbed) + (map-window-group + (lambda (x) + (reframe-one x)) w))) - (add-frame-style 'get-S-tabbed - (lambda (w type) - (case type - ((default) frame) - ((transient) transient-frame) - ((shaped) shaped-frame) - ((shaped-transient) shaped-transient-frame)))) +;; create only frames when focus a window don't draw +;; +(add-hook 'focus-in-hook create-frames-only) +(add-hook 'add-window-hook create-frames-only) - ;; TODO: figure out how to store this info in this file correctly - ;;(custom-set-typed-variable'tab-left-dec-width '5 'number) - ;;(custom-set-typed-variable'tab-right-dec-width '5 'number) - ;;(custom-set-typed-variable'tab-left-margin '14 'number) - ;;(custom-set-typed-variable'tab-right-margin '38 'number) +(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one) - ) +;; tabgroup.jl call +;; +(call-after-state-changed '(title-position) reframe-group)
Attachment:
signature.asc
Description: PGP signature