gri3-wm/etc/config.scm

153 lines
3.9 KiB
Scheme

(include "hooks.scm")
(display "-- GUILE CONFIGURATION START LOADING --\n")
(define (run-shell-command c)
(system (string-concatenate
(list c " &"))))
;; (include "i3.scm")
(define font "pango:Fira Mono 12")
;; (run-shell-command "./i3bar -b 0")
;; (set-font )
(define (reload)
(display "Reloading (with refresh)!\n")
(load "config.scm")
(refresh))
(define (urxvt)
(display "Starting urxvt\n")
(run-shell-command "urxvt"))
;; (define (config-bars)
;; (bar-start)
;; (set-bar-position "top")
;; (bar-finish)
;; ;; 2 bars
;; (bar-start)
;; (set-bar-position "bottom")
;; (bar-finish)
;; (i3bar))
;; ;; (i3bar)
;; ;; (i3-exec "" "" urxvt)
;; (define (cw)
;; (change-workspace "3"))
(define (cw1)
(change-workspace "1"))
(define (cw2)
(let ((resp (change-workspace "2")))
(if (not (boolean? resp))
(format #f "~A ~A" (car resp) (cadr resp)))))
(define (cwz)
(let ((resp (change-workspace "z")))
(if (not (boolean? resp))
(format #f "~A ~A" (car resp) (cadr resp)))))
;; (define (default)
;; (change-workspace "default"))
(use-modules (ice-9 popen))
(use-modules (ice-9 rdelim))
(define (run-and-read command)
(let* ((port (open-input-pipe command))
(str (read-line port))) ; from (ice-9 rdelim)
(close-pipe port)
str))
(define (eval-expr)
(run-shell-command (format #f "./i3-msg ~S" (run-and-read "echo '' | dmenu"))))
(set-binding "bindsym" "Mod1" "Return" "" "" "" ""
(lambda () (urxvt)))
(set-binding "bindsym" "Mod1" "space" "" "" "" ""
(lambda () (eval-expr)))
(set-binding "bindsym" "Mod1" "r" "" "" "" ""
(lambda () (reload)))
(set-binding "bindsym" "Mod1" "1" "" "" "" ""
(lambda () (cw1)))
(set-binding "bindsym" "Mod1" "2" "" "" "" ""
(lambda () (cw2)))
(set-binding "bindsym" "Mod1" "z" "" "" "" ""
(lambda () (cwz)))
(set-binding "bindsym" "Mod1" "v" "" "" "" ""
(lambda () (split "vertical")))
(set-binding "bindsym" "Mod1" "h" "" "" "" ""
(lambda () (split "horizontal")))
(set-binding "bindsym" "Mod1" "q" "" "" "" ""
(lambda () (kill)))
(set-binding "bindsym" "Mod1" "Right" "" "" "" ""
(lambda () (focus-direction "right")))
(set-binding "bindsym" "Mod1" "Left" "" "" "" ""
(lambda () (focus-direction "left")))
(set-binding "bindsym" "Mod1" "Up" "" "" "" ""
(lambda () (focus-direction "up")))
(set-binding "bindsym" "Mod1" "Down" "" "" "" ""
(lambda () (focus-direction "down")))
(set-binding "bindsym" "Mod1" "w" "" "" "" ""
(lambda () (layout "tabbed")))
(set-binding "bindsym" "Mod1" "s" "" "" "" ""
(lambda () (layout "stacked")))
(set-binding "bindsym" "Mod1" "e" "" "" "" ""
(lambda () (toggle-layout "split")))
;; (set-binding "bindsym" "Mod1" "o" "" "" "" ""
;; (lambda () (move-to-workspace "2")))
(display "Loaded\n")
;; (set-binding "bindsym" "Mod2" "Return" "" "" "" "" urxvt)
;; (set-binding "bindsym" "Mod1" "q" "" "" "" "" kill-window)
;; (set-binding "bindsym" "Mod1" "w" "" "" "" "" kill-client)
;; (set-binding "bindsym" "Mod1" "1" "" "" "" "" default)
;; (set-binding "bindsym" "Mod1" "2" "" "" "" "" cw2)
;; (set-binding "bindsym" "Mod1" "3" "" "" "" "" cw)
;; ;; Con *ws = con_get_workspace(nc)
;; ;; Con *fs = con_get_fullscreen_covering_ws(ws)
;; ;; con_move_to_output(nc, output, false);
;; ;; con_toggle_fullscreen(nc, CF_OUTPUT);
;; ;; con_move_to_output_name(nc, assignment->dest.output, true);
;; (define (move-to-workspace window workspace)
;; (display "Moving window ")
;; (display (window-name window))
;; (display " to workspace ")
;; (display workspace))
;; (define assignments
;; ;; #((matcher) assign-function)
;; `(("urxvt" ,(lambda () (move-to-workspace "O" "3")))))
;; ;; ((lambda () (+ 2 1)))
;; ;; (define (t i) (display ("ICAO")))
;; ;; ((eval '+) 1 2)
;; ;; (call-with-values (cdr `("urxvt" ,t)) 0)
;; (display "-- GUILE CONFIGURATION LOADED --\n")
(define loaded #t)
(run-shell-command "feh --bg-fill ~/freeze/bluescreen_0.png")
;; (split "vertical")