Home of the fox forth system and swapwm - the forth window manager.
fix a off by 1 error in within?
avx: can be run without elf code now; implement vcvtsi2sd and vcvtsd2si; fix ymm@ and ymm!
7571c2b55fec — telesto a year ago
system, mandelbrot-tm: add forth versions of control structures, makes writing asm code easier

heads

tip
browse log

clone

read-only
https://hg.sr.ht/~telesto/fox
read/write
ssh://hg@hg.sr.ht/~telesto/fox

this is the home of fox - a minimalistic forth system and swapwm - a minimalistic x11 window manager.

#fox - a minimalistic forth system

#overview

  • fox bootstrap dictionary written in x86-64 nasm assembly
  • subroutine threaded
  • core instruction set similar to pentium colorforth
  • supports saving compiled forth code to an elf64 object file - can therefore be linked to an executable!
  • two dictionaries - one for forth (normal) words and one for macros
  • code, data and dictionaries are in seperate memory sections
  • todo: can not parse negative numbers yet, so use n neg instead

#installation

to install fox (and swapwm) you need:

  • an x86_64 linux system
  • nasm
  • ld (every linux system has this linker installed)
  • xorg

the installation procedure is as follows:

# download fox and swapwm source code
hg clone https://hg.sr.ht/~telesto/fox
cd fox/
# assemble and link everything
make clean && make

this builds two executable files in <path>/fox/:

  • fox: the forth system
  • swapwm: the window manager

#running

run fox with the system library:

cd <path>/fox/
./fox.sh
1 2 + .

#swapwm - a minimalistic window manager written in fox

#overview

  • written in fox
  • 100% forth - no libx11/libxcb required! swapwm has it's own implementation of the x11 protocol specification! i am not aware of any other window manager with this unique feature.
  • minimalistic - no window decorations, no icons
  • known to work with slackware current 64-bit, i have no idea if swapwm will work with other linux systems. feedback is appreciated.
  • will connect to a local x server using the x server socket. connecting a remote x server using a tcp socket is not supported.

#installation

see fox installation for instructions.

#running

to make swapwm your default window manager just add the line

exec <path>/fox/swapwm
	

to $HOME/.xinitrc.

swapwm provides no application launcher, you can use e.g. xbindkeys and dmenu. swapwm comes with a xbindkey config file example.

#work setup

when working with x11 i have a rather static setup:

  • 2 monitors: one small, one big
  • 2-5 application open at once

swapwm reflects this working setup.

#configuration

running make once will create the file swapwm-config.fox. this file contains the config parameters for swapwm. per default swapwm is configured to run on DISPLAY=:0. if your x server is running on another display edit the socket file name called socket-name. you can also change keyboard commands and modifier keys here. when done run make clean && make to create the swapwm executable.

#default keyboard commands

  • F9: maximize focused window
  • F10: move focused window to next screen and maximize it
  • F12: pull bottom window in window stack to the top

#mouse commands

there are two modifier keys: mod1 (defaults to the win key) and mod2 (defaults to win key + ctrl key)

  • mod1+left button pushed: move focused window
  • mod1+right button pushed: resize focused window
  • mod1+wheel pushed: maximize focused window
  • mod1+wheel up: push top window to the bottom of the window stack
  • mod1+wheel down: pull bottom window to the top of the window stack
  • mod2+left button pushed: tile focused window at the left side of the screen
  • mod2+right button pushed: tile focused window at the right side of the screen
  • mod1+wheel pushed: move focused window to next screen and maximize it

#issues

  • sometimes when shuffling windows using mod1+mouse wheel the input focus will not be set to the top window.