gimp but for windows: a wayland compositor
git clone https://github.com/m-col/wimp
Files | Refs | Readme

Commit 58fda0371c3e417cc96a308fabeee8e3eaa69f19
Parent: d380f3285d4d326d2f691f4fabcf0fb326b09f7e
Author: mcol <mcol@posteo.net>
Date: 2021-01-24 16:46:46 +0000
Committer: mcol <mcol@posteo.net>
Committed: 2021-01-24 16:46:46 +0000

Rename project to WIMP

wimp.conf Added

@@ -0,0 +1,103 @@
+#
+# ██      ██  ██  ████████    ██████
+# ██  ██  ██      ██  ██  ██  ██    ██
+# ██  ██  ██  ██  ██  ██  ██  ██    ██
+# ██  ██  ██  ██  ██  ██  ██  ██████
+#   ████████  ██  ██      ██  ██
+#             ██              ██
+#             ██
+# 
+# example wimp configuration file
+#
+# All possible options are described here. Lines that start with '#' are
+# ignored. Options that are commented out contain their default values.
+
+
+## General settings
+
+# These specify the min and max magnification bounds when zooming.
+#zoom_min 0.5
+#zoom_max 3
+
+# Set the colour for the mark setter/getter indicator
+#mark_indicator #000000
+
+# Whether to allow VT switching: on or off.
+#vt_switching on
+
+
+## Bindings
+
+# Set the modifier key used for bindings
+# Can be one of: Shift, Caps, Ctrl, Alt, Mod2, Mod3, Logo, Mod5
+#set_modifier Logo
+
+# Define key bindings
+# additional modifiers, key, action(, data)
+bind	Ctrl	Escape		shutdown
+bind	Ctrl	r		reload_config
+
+# These actions act on windows
+bind	Ctrl	q		close_window
+bind		j		focus down
+bind		k		focus up
+bind		h		focus left
+bind		l		focus right
+bind		f		toggle_fullscreen
+
+# These give the focussed window half of the screen
+bind	Shift	J		halfimize down
+bind	Shift	K		halfimize up
+bind	Shift	H		halfimize left
+bind	Shift	L		halfimize right
+
+# And these act on desks
+bind		Tab		next_desk
+bind		ISO_Left_Tab	prev_desk
+bind		i		zoom 15
+bind		o		zoom -15
+bind		r		reset_zoom
+
+# These pan the desk using the given percentage changes in x and y
+bind		s		pan_desk 0 40
+bind		w		pan_desk 0 -40
+bind		a		pan_desk -40 0
+bind		d		pan_desk 40 0
+
+# The line after 'exec' is executed by /bin/sh
+bind		Return		exec gnome-terminal
+
+# These two actions can be used to mark and go to set positions. Each one, once
+# pressed, waits for the next key press and uses that as the 'mark', e.g.
+# hitting 'mod + m' then 'a' will save the current position, then hitting 'mod
+# + `' then 'a' later will move to that marked position. These can be cancelled
+# with the escape key.
+bind		m		set_mark
+bind		grave		go_to_mark
+
+# Possible mouse bindings: motion, scroll (+ additional modifiers)
+bind		scroll		pan_desk_mouse
+bind	Shift	scroll		zoom_mouse
+
+# Scroll direction. Can be one of: natural, reverse
+#scroll_direction natural
+
+
+## Configure desks
+
+# Commands until a further desk is added pertain to desk 1.
+
+# This can be a path to a png image, or a colour in the form #rrggbb.
+background ~/pattern.png
+
+# window border colors
+borders focus #998dd1
+borders normal #3e3e73
+borders width 4
+
+# This adds another desk. Following commands will apply to this desk.
+add_desk
+background #3e3e73
+borders normal #1f1c32
+borders focus #406794
+borders width 5

src/types.h Modified

@@ -15,6 +15,8 @@
 #include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/log.h>
 
+#define THIS "wimp"
+
 enum cursor_mode {
     CURSOR_PASSTHROUGH,
     CURSOR_MOD,

src/main.c Modified

@@ -23,7 +23,7 @@
 
 
 static const char usage[] =
-    "usage: deskwm [options...]\n"
+    "usage: " THIS " [options...]\n"
     "    -h         show this help message\n"
     "    -c <file>  specify config file\n"
     "    -d         set logging to debug mode\n"

src/config.c Modified

@@ -12,6 +12,8 @@
 #include "types.h"
 
 #define is_number(s) (strspn(s, "0123456789.-") == strlen(s))
+#define CONFIG_HOME "$HOME/.config/" THIS ".conf"
+#define CONFIG_HOME_XDG "$XDG_CONFIG_HOME/.config/" THIS ".conf"
 
 
 static const char *DEFAULT_CONFIG =  "\n\
@@ -436,8 +438,7 @@
 
     if (server->config_file == NULL) {
 	xdg_config = getenv("XDG_CONFIG_HOME");
-	config = (xdg_config && *xdg_config) ?
-	    "$XDG_CONFIG_HOME/.config/deskwm.conf" : "$HOME/.config/deskwm.conf";
+	config = (xdg_config && *xdg_config) ? CONFIG_HOME_XDG : CONFIG_HOME;
 	server->config_file = strdup(config);
     };
 

readme.rst Modified

@@ -1,17 +1,14 @@
-   █           █                 
-   █           █                 
-████ ████ ████ █  █ █   █ █████  
-█  █ █  █ █    █  █ █   █ █ █ █  
-█  █ ████ ████ ███  █ █ █ █ █ █  
-█  █ █       █ █  █ █ █ █ █   █  
-████ ████ ████ █  █ █████ █   █  
 
+ ██      ██  ██  ████████    ██████
+ ██  ██  ██      ██  ██  ██  ██    ██
+ ██  ██  ██  ██  ██  ██  ██  ██    ██
+ ██  ██  ██  ██  ██  ██  ██  ██████
+   ████████  ██  ██      ██  ██
+             ██              ██
+             ██
 
-A Wayland compositor that takes the desktop metaphor quite literally.
 
-WORK IN PROGRESS.
-
-This project is still new, and will not be useful.
+A WIP Wayland compositor that takes the desktop metaphor quite literally.
 
 To do list:
  - make configuration much nicer and remove all the strcmps

deskwm.conf Deleted

@@ -1,103 +0,0 @@
-#
-#    █           █                 
-#    █           █                 
-# ████ ████ ████ █  █ █   █ █████  
-# █  █ █  █ █    █  █ █   █ █ █ █  
-# █  █ ████ ████ ███  █ █ █ █ █ █  
-# █  █ █       █ █  █ █ █ █ █   █  
-# ████ ████ ████ █  █ █████ █   █  
-#
-# example deskwm configuration file
-#
-# All possible options are described here. Lines that start with '#' are
-# ignored. Options that are commented out contain their default values.
-
-
-## General settings
-
-# These specify the min and max magnification bounds when zooming.
-#zoom_min 0.5
-#zoom_max 3
-
-# Set the colour for the mark setter/getter indicator
-#mark_indicator #000000
-
-# Whether to allow VT switching: on or off.
-#vt_switching on
-
-
-## Bindings
-
-# Set the modifier key used for bindings
-# Can be one of: Shift, Caps, Ctrl, Alt, Mod2, Mod3, Logo, Mod5
-#set_modifier Logo
-
-# Define key bindings
-# additional modifiers, key, action(, data)
-bind	Ctrl	Escape		shutdown
-bind	Ctrl	r		reload_config
-
-# These actions act on windows
-bind	Ctrl	q		close_window
-bind		j		focus down
-bind		k		focus up
-bind		h		focus left
-bind		l		focus right
-bind		f		toggle_fullscreen
-
-# These give the focussed window half of the screen
-bind	Shift	J		halfimize down
-bind	Shift	K		halfimize up
-bind	Shift	H		halfimize left
-bind	Shift	L		halfimize right
-
-# And these act on desks
-bind		Tab		next_desk
-bind		ISO_Left_Tab	prev_desk
-bind		i		zoom 15
-bind		o		zoom -15
-bind		r		reset_zoom
-
-# These pan the desk using the given percentage changes in x and y
-bind		s		pan_desk 0 40
-bind		w		pan_desk 0 -40
-bind		a		pan_desk -40 0
-bind		d		pan_desk 40 0
-
-# The line after 'exec' is executed by /bin/sh
-bind		Return		exec gnome-terminal
-
-# These two actions can be used to mark and go to set positions. Each one, once
-# pressed, waits for the following key press and uses that as the 'mark', e.g.
-# hitting 'mod + m' then 'a' will save the current position, then hitting
-# 'mod + `' then 'a' later will move to that marked position. These can be
-# cancelled with the escape key.
-bind		m		set_mark
-bind		grave		go_to_mark
-
-# Possible mouse bindings: motion, scroll (+ additional modifiers)
-bind		scroll		pan_desk_mouse
-bind	Shift	scroll		zoom_mouse
-
-# Scroll direction. Can be one of: natural, reverse
-#scroll_direction natural
-
-
-## Configure desks
-
-# Commands until a further desk is added pertain to desk 1.
-
-# This can be a path to a png image, or a colour in the form #rrggbb.
-background ~/pattern.png
-
-# window border colors
-borders focus #998dd1
-borders normal #3e3e73
-borders width 4
-
-# This adds another desk. Following commands will apply to this desk.
-add_desk
-background #3e3e73
-borders normal #1f1c32
-borders focus #406794
-borders width 5

Makefile Modified

@@ -1,4 +1,4 @@
-OUT	= deskwm
+OUT	= wimp
 SOURCES	= $(wildcard src/*.c)
 OBJECTS	= $(SOURCES:.c=.o)
 CFLAGS  += -g -I. -DWLR_USE_UNSTABLE -Wall -Wextra -pedantic -Wno-unused-parameter

.gitignore Modified

@@ -1,4 +1,4 @@
-deskwm
+wimp
 src/*.o
 *-protocol.c
 *-protocol.h