From 291a0b72fbeaf757056fbb7fba0376262360d877 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Mon, 19 Dec 2022 23:02:38 +0100 Subject: Refactoring to reduce repeated code, fix tiling bugs. * Makefile: Add optimization flag * init.scm: Use correct indices for workspaces * schewm.c: Many lines of repeated code removed --- init.scm | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'init.scm') diff --git a/init.scm b/init.scm index 8f3d023..b712add 100644 --- a/init.scm +++ b/init.scm @@ -32,7 +32,7 @@ (,(make-key "j") . ,wm-focus-next) ;; Packing (,(make-shift-key "Left") . ,wm-pack-left) - (,(make-shift-key "Right") . ,wm-pack-left) + (,(make-shift-key "Right") . ,wm-pack-right) (,(make-shift-key "Up") . ,wm-pack-top) (,(make-shift-key "Down") . ,wm-pack-bottom) ;; Toggle between normal and tiled in a certain position @@ -50,25 +50,25 @@ (,(make-key "z") . ,wm-toggle-bottom-left) (,(make-key "c") . ,wm-toggle-bottom-right) ;; Set current workspace - (,(make-key "1") . ,(make-callback wm-set-workspace 1)) - (,(make-key "2") . ,(make-callback wm-set-workspace 2)) - (,(make-key "3") . ,(make-callback wm-set-workspace 3)) - (,(make-key "4") . ,(make-callback wm-set-workspace 4)) - (,(make-key "5") . ,(make-callback wm-set-workspace 5)) - (,(make-key "6") . ,(make-callback wm-set-workspace 6)) - (,(make-key "7") . ,(make-callback wm-set-workspace 7)) - (,(make-key "8") . ,(make-callback wm-set-workspace 8)) - (,(make-key "9") . ,(make-callback wm-set-workspace 9)) + (,(make-key "1") . ,(make-callback wm-set-workspace 0)) + (,(make-key "2") . ,(make-callback wm-set-workspace 1)) + (,(make-key "3") . ,(make-callback wm-set-workspace 2)) + (,(make-key "4") . ,(make-callback wm-set-workspace 3)) + (,(make-key "5") . ,(make-callback wm-set-workspace 4)) + (,(make-key "6") . ,(make-callback wm-set-workspace 5)) + (,(make-key "7") . ,(make-callback wm-set-workspace 6)) + (,(make-key "8") . ,(make-callback wm-set-workspace 7)) + (,(make-key "9") . ,(make-callback wm-set-workspace 8)) ;; Send client to workspace - (,(make-shift-key "1") . ,(make-callback wm-set-focused-client-workspace 1)) - (,(make-shift-key "2") . ,(make-callback wm-set-focused-client-workspace 2)) - (,(make-shift-key "3") . ,(make-callback wm-set-focused-client-workspace 3)) - (,(make-shift-key "4") . ,(make-callback wm-set-focused-client-workspace 4)) - (,(make-shift-key "5") . ,(make-callback wm-set-focused-client-workspace 5)) - (,(make-shift-key "6") . ,(make-callback wm-set-focused-client-workspace 6)) - (,(make-shift-key "7") . ,(make-callback wm-set-focused-client-workspace 7)) - (,(make-shift-key "8") . ,(make-callback wm-set-focused-client-workspace 8)) - (,(make-shift-key "9") . ,(make-callback wm-set-focused-client-workspace 9)) + (,(make-shift-key "1") . ,(make-callback wm-set-focused-client-workspace 0)) + (,(make-shift-key "2") . ,(make-callback wm-set-focused-client-workspace 1)) + (,(make-shift-key "3") . ,(make-callback wm-set-focused-client-workspace 2)) + (,(make-shift-key "4") . ,(make-callback wm-set-focused-client-workspace 3)) + (,(make-shift-key "5") . ,(make-callback wm-set-focused-client-workspace 4)) + (,(make-shift-key "6") . ,(make-callback wm-set-focused-client-workspace 5)) + (,(make-shift-key "7") . ,(make-callback wm-set-focused-client-workspace 6)) + (,(make-shift-key "8") . ,(make-callback wm-set-focused-client-workspace 7)) + (,(make-shift-key "9") . ,(make-callback wm-set-focused-client-workspace 8)) ;; Send client to monitor (,(make-shift-key "i") . ,wm-client-monitor-prev) (,(make-shift-key "o") . ,wm-client-monitor-next))) -- cgit v1.2.3