From 48877209efe7dabbeb20b9677d372ac2452fa73e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 17 Jan 2024 00:23:37 -0600 Subject: Update .gitignore --- .gitignore | 7 +++- acdwm | Bin 70664 -> 42792 bytes acdwm.scm | 110 ------------------------------------------------------------- 3 files changed, 6 insertions(+), 111 deletions(-) delete mode 100755 acdwm.scm diff --git a/.gitignore b/.gitignore index 75039f1..89f1a5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +acdwm .fr *.build.sh -*.install.sh \ No newline at end of file +*.install.sh +*.so +*.link +*.o +*.import.scm diff --git a/acdwm b/acdwm index a847fa2..0471d86 100755 Binary files a/acdwm and b/acdwm differ diff --git a/acdwm.scm b/acdwm.scm deleted file mode 100755 index fdd8395..0000000 --- a/acdwm.scm +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -#| -*- scheme -*- -exec csi -ss "$0" "$@" ; acdwm -based on tinywm: https://github.com/mackstann/tinywm/ -|# - -(import (chicken bitwise) - (chicken process-context) - (srfi 1) - matchable - xlib) - -(define TRUE 1) -(define FALSE 0) - -(define dpy (make-parameter #f)) -(define screen (make-parameter #f)) -(define root (make-parameter #f)) - -(define (grab-keys) - (xgrabkey (dpy) - (char->integer (xkeysymtokeycode (dpy) (xstringtokeysym "F1"))) - MOD1MASK - (root) - TRUE - GRABMODEASYNC - GRABMODEASYNC) - (xgrabbutton (dpy) - 1 - MOD1MASK - (root) - TRUE - (bitwise-ior BUTTONPRESSMASK - BUTTONRELEASEMASK - POINTERMOTIONMASK) - GRABMODEASYNC - GRABMODEASYNC - NONE - NONE) - (xgrabbutton (dpy) - 3 - MOD1MASK - (root) - TRUE - (bitwise-ior BUTTONPRESSMASK - BUTTONRELEASEMASK - POINTERMOTIONMASK) - GRABMODEASYNC - GRABMODEASYNC - NONE - NONE)) - -(define (handle-events) - (let ((event (make-xevent)) - (start (make-xbuttonevent)) - (attrs (make-xwindowattributes))) - (set-xbuttonevent-subwindow! start NONE) - (let loop () - (xnextevent (dpy) event) - (cond - ((and (= KEYPRESS (xevent-type event)) - (not (= NONE (xevent-xkey-subwindow event)))) - (xraisewindow (dpy) (xevent-xkey-subwindow event))) - - ((and (= BUTTONPRESS (xevent-type event)) - (not (= NONE (xevent-xbutton-subwindow event)))) - (print "button!") - (xgetwindowattributes (dpy) (xevent-xbutton-subwindow event) attrs) - (set-xbuttonevent-x_root! start (xevent-xbutton-x_root event)) - (set-xbuttonevent-y_root! start (xevent-xbutton-y_root event)) - (set-xbuttonevent-button! start (xevent-xbutton-button event)) - (set-xbuttonevent-subwindow! start (xevent-xbutton-subwindow event))) - - ((and (= MOTIONNOTIFY (xevent-type event)) - (not (= NONE (xbuttonevent-subwindow start)))) - (let ((xdiff (- (xevent-xbutton-x_root event) - (xbuttonevent-x_root start))) - (ydiff (- (xevent-xbutton-y_root event) - (xbuttonevent-y_root start))) - (button (xbuttonevent-button start))) - (xmoveresizewindow (dpy) - (xbuttonevent-subwindow start) - (+ (xwindowattributes-x attrs) - (if (= button 1) xdiff 0)) - (+ (xwindowattributes-y attrs) - (if (= button 1) ydiff 0)) - (max 1 (+ (xwindowattributes-width attrs) - (if (= button 3) xdiff 0))) - (max 1 (+ (xwindowattributes-height attrs) - (if (= button 3) ydiff 0)))))) - - ((= BUTTONRELEASE (xevent-type event)) - (print "buttonrelease!") - (set-xbuttonevent-subwindow! start NONE))) - - ;; Annnd go around again - (loop)))) - -(define (main args) - (parameterize ((dpy (xopendisplay #f))) - (assert (dpy)) - (parameterize ((screen (xdefaultscreen (dpy)))) - (parameterize ((root (xrootwindow (dpy) (screen)))) - (grab-keys) - (handle-events))))) - -(cond-expand - ((or chicken-script compiling) - (main (command-line-arguments))) - (else)) -- cgit 1.4.1-21-gabe81