From 74b5ca26448788d61d61efce61650529e00befed Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Fri, 9 Dec 2022 19:38:00 +0100 Subject: Cleanup Scheme code; add more utility functions (dummies for now) * main.scm: Code cleanup * wm.scm: Cleanup and moving of more functions * schewm.c: Implemented more utility functions --- main.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 22 deletions(-) (limited to 'main.scm') diff --git a/main.scm b/main.scm index f77acf2..92b9362 100644 --- a/main.scm +++ b/main.scm @@ -1,39 +1,74 @@ -(use-modules (srfi srfi-9) - (wm)) - -(define-record-type - (make-config - inner-border-width - outer-border-width - magnet-border-width - offset-x - offset-y - offset-width - offset-height) - wm-config? - (inner-border-width config-inner-border-width set-config-inner-border-width!) - (outer-border-width config-outer-border-width set-config-outer-border-width!) - (magnet-border-width config-magnet-border-width set-config-magnet-border-width!) - (offset-x config-offset-x set-config-offset-x!) - (offset-y config-offset-y set-config-offset-y!) - (offset-width config-offset-width set-config-offset-width!) - (offset-height config-offset-height set-config-offset-height!)) +(use-modules (wm)) (define config (make-config + ;; Border sizes 2 ; inner-border-width 0 ; outer-border-width 16 ; magnet-border-width + ;; Margins 0 ; offset-x 0 ; offset-y 0 ; offset-width 0 ; offset-height + ;; Colors + "#35586c" ; focused-color + "#333333" ; unfocused-color + "#ff6666" ; unkillable-color + "#000000" ; empty-color + "#0d131a" ; outer-color )) (define wm-keybindings `((,(make-shift-key "q") . ,wm-quit) + (,(make-key "q") . ,wm-focus-close) + ;; Focus (,(make-key "Tab") . ,wm-focus-prev) - (,(make-shift-key "Tab") . ,wm-focus-next))) + (,(make-shift-key "Tab") . ,wm-focus-next) + (,(make-key "k") . ,wm-focus-prev) + (,(make-key "j") . ,wm-focus-next) + ;; Packing + (,(make-shift-key "Left") . ,wm-pack-left) + (,(make-shift-key "Right") . ,wm-pack-left) + (,(make-shift-key "Up") . ,wm-pack-top) + (,(make-shift-key "Down") . ,wm-pack-bottom) + ;; Toggle between normal and tiled in a certain position + (,(make-key "s") . ,wm-toggle-maximize) + (,(make-key "a") . ,wm-toggle-half-left) + (,(make-key "Left") . ,wm-toggle-half-left) + (,(make-key "d") . ,wm-toggle-half-right) + (,(make-key "Right") . ,wm-toggle-half-right) + (,(make-key "w") . ,wm-toggle-half-top) + (,(make-key "Up") . ,wm-toggle-half-top) + (,(make-key "x") . ,wm-toggle-half-bottom) + (,(make-key "Down") . ,wm-toggle-half-bottom) + (,(make-key "q") . ,wm-toggle-top-left) + (,(make-key "e") . ,wm-toggle-top-right) + (,(make-key "z") . ,wm-toggle-bottom-left) + (,(make-key "c") . ,wm-toggle-bottom-right) + ;; Set current workspace + (,(make-key "1") . ,wm-set-workspace) + (,(make-key "2") . ,wm-set-workspace) + (,(make-key "3") . ,wm-set-workspace) + (,(make-key "4") . ,wm-set-workspace) + (,(make-key "5") . ,wm-set-workspace) + (,(make-key "6") . ,wm-set-workspace) + (,(make-key "7") . ,wm-set-workspace) + (,(make-key "8") . ,wm-set-workspace) + (,(make-key "9") . ,wm-set-workspace) + ;; Send client to workspace + (,(make-shift-key "1") . ,wm-set-client-workspace) + (,(make-shift-key "2") . ,wm-set-client-workspace) + (,(make-shift-key "3") . ,wm-set-client-workspace) + (,(make-shift-key "4") . ,wm-set-client-workspace) + (,(make-shift-key "5") . ,wm-set-client-workspace) + (,(make-shift-key "6") . ,wm-set-client-workspace) + (,(make-shift-key "7") . ,wm-set-client-workspace) + (,(make-shift-key "8") . ,wm-set-client-workspace) + (,(make-shift-key "9") . ,wm-set-client-workspace) + ;; Send client to monitor + (,(make-shift-key "i") . ,wm-client-monitor-prev) + (,(make-shift-key "o") . ,wm-client-monitor-next))) (when (wm-init) (wm-grab-keys wm-keybindings) @@ -43,4 +78,3 @@ (newline))) (wm-run) (wm-quit)) - -- cgit v1.2.3