add a standard configure function to modules

This commit is contained in:
Almarhoon Ibraheem 2024-06-18 15:21:36 +03:00
parent 03011cb6f1
commit dcb4a7ef2c
2 changed files with 9 additions and 16 deletions

View file

@ -20,9 +20,7 @@
WORKSPACES
COLUMNS
ROWS
configure-workspaces
configure-rows
configure-columns
workspace-grid-configure
get-active-workspace-index
switch-workspace-up
switch-workspace-right
@ -46,14 +44,10 @@
;; number of columns in the grid
(define COLUMNS 1)
(define (configure-workspaces workspaces)
(set! WORKSPACES workspaces))
(define (configure-rows rows)
(set! ROWS rows))
(define (configure-columns columns)
(set! COLUMNS columns))
(define* (workspace-grid-configure #:key rows columns workspaces)
(when rows (set! ROWS rows))
(when columns (set! COLUMNS columns))
(when workspaces (set! WORKSPACES workspaces)))
(define* (get-active-workspace-name #:optional (workspaces (sway-get-workspaces)))
"get name of active workspace"

View file

@ -22,6 +22,7 @@
#:use-module (swayipc events)
#:export (workspace-groups-init
workspace-groups-configure
OUTPUTS
GROUPS))
@ -40,11 +41,9 @@
;; ("19" "29" "39")))
(define GROUPS '())
(define (configure-outputs outputs)
(set! OUTPUTS outputs))
(define (configure-groups groups)
(set! GROUPS groups))
(define* (workspace-groups-configure #:key outputs groups)
(when outputs (set! OUTPUTS outputs))
(when groups (set! GROUPS groups)))
(define last-switched-group '())