Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b0f2a40
fixes
h8d13 Jul 23, 2026
003207f
chore: untrack build artifacts, ignore *.o *.a"
h8d13 Jul 23, 2026
e9245a9
add small tooltip about default terminal/menu
h8d13 Jul 23, 2026
4008cc0
attempt to fix `PKGBUILD`
h8d13 Jul 23, 2026
72140e4
feat(build): PKGBUILD + Makefiles
h8d13 Jul 23, 2026
a120fd9
`_FORTIFY_SOURCE` warning + free
h8d13 Jul 23, 2026
8a066e8
bumpv now that no more errors
h8d13 Jul 23, 2026
4f9edd2
chore(build): use one `url` source
h8d13 Jul 23, 2026
cc3e109
indents + comment
h8d13 Jul 23, 2026
fb37d93
docs
h8d13 Jul 23, 2026
d2e6ec1
add support for `_DOCK`, testing polybar
h8d13 Jul 23, 2026
96acbcd
add `movefocus`
h8d13 Jul 23, 2026
6400f15
partial revert, only focus pointer if it had event
h8d13 Jul 23, 2026
b652245
hide cursor when no movement has been registered yet.
h8d13 Jul 23, 2026
a89e28e
single monitor wrapping
h8d13 Jul 23, 2026
4823800
when moving a window out of current desktop, refocus master
h8d13 Jul 23, 2026
9e72482
newly spawned window should have focus
h8d13 Jul 23, 2026
68194ba
continue aprent
h8d13 Jul 23, 2026
d988872
continue(4823800): refocus on close
h8d13 Jul 23, 2026
a707e6c
publish newdesktop on move, not on switch
h8d13 Jul 23, 2026
fd637fa
partial revert parent
h8d13 Jul 23, 2026
fafdaaa
fix default cmd for dmenu
h8d13 Jul 23, 2026
15a88e7
idek
h8d13 Jul 23, 2026
f0720ff
add debug wrapper
h8d13 Jul 23, 2026
3d040f3
giveup
h8d13 Jul 23, 2026
1f34581
rem hardcoded string always logs to $HOME/.ragnarwm.log
h8d13 Jul 23, 2026
70982a8
make deps copy-pastable.
h8d13 Jul 24, 2026
8a2153a
minor readme corrections
h8d13 Jul 24, 2026
b836416
cfg: trailing whitespaces
h8d13 Jul 24, 2026
1cb1209
solidify logic
h8d13 Jul 24, 2026
3942ed6
double free
h8d13 Jul 24, 2026
b9150c3
pointer resizing; only active in floating mode.
h8d13 Jul 24, 2026
c73019f
oops
h8d13 Jul 24, 2026
212fbae
continue paretn
h8d13 Jul 24, 2026
b8f8efa
rem some stuff; unpublish on last
h8d13 Jul 24, 2026
5d4c259
fix paretn
h8d13 Jul 24, 2026
0a859f4
continue parent
h8d13 Jul 24, 2026
afcb838
idek
h8d13 Jul 24, 2026
609be27
EWMH standard receive switch
h8d13 Jul 24, 2026
55b6828
nuke ragnarstart
h8d13 Jul 24, 2026
e2d8f66
misc docs
h8d13 Jul 24, 2026
6e4b1e7
more pkging:
h8d13 Jul 25, 2026
7a06d2f
remove dead deps; respect host linking `--as-needed`
h8d13 Jul 25, 2026
cbfc4a4
docs
h8d13 Jul 25, 2026
1a7a798
rename run -> debug
h8d13 Jul 25, 2026
c7c8e70
chore(git): add attribs
h8d13 Jul 25, 2026
5f30027
chore(git): rem `clang` local artifacts
h8d13 Jul 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# keep CRLF out of the tree
* text=auto eol=lf

# build plumbing, not part of the language breakdown.
# a pattern without a slash matches the basename at any depth, so this
# covers ./Makefile and ./api/Makefile both.
Makefile linguist-detectable=false
flake.nix linguist-detectable=false
File renamed without changes.
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ragnar.o
ragnarstart
*.o
*.a
*.patch
.cache/
bin/
pkg/
ragnar/
**.tar.zst
.gdb.log
compile_commands.json
compile_flags.txt
56 changes: 28 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
CC = cc
CFLAGS = -O3 -ffast-math -Wall -Wextra -pedantic
CFLAGS += -isystem api/include
# ?= so an exported CFLAGS (makepkg, distro build) replaces this wholesale.
# geometry here is ratios and pixel rects cast back to ints, so -ffast-math
# bought nothing and -ffinite-math-only would let divisions by a zero-sized
# monitor fold away instead of showing up.
CFLAGS ?= -O2
ALL_CFLAGS = $(CFLAGS) $(CPPFLAGS) -Wall -Wextra -pedantic -isystem api/include

LDLIBS = -lxcb -lxcb-keysyms -lxcb-icccm -lxcb-cursor -lxcb-randr -lxcb-composite -lxcb-ewmh -lX11 -lX11-xcb -lGL -lm -lconfig -lxcb-util
LDLIBS = -lxcb -lxcb-keysyms -lxcb-icccm -lxcb-cursor -lxcb-randr -lxcb-xfixes -lX11 -lX11-xcb -lconfig

SRC = ./src/*.c ./src/ipc/*.c
BIN = ragnar

RAGNAR_API = api/lib/ragnar.a

PREFIX = /usr
BINDIR = $(PREFIX)/bin
SYSCONFDIR = /etc

.PHONY: all
all: $(RAGNAR_API)
all:
mkdir -p ./bin
$(CC) -o bin/$(BIN) $(CFLAGS) $(SRC) $(LDLIBS)
$(CC) -o bin/$(BIN) $(ALL_CFLAGS) $(LDFLAGS) $(SRC) $(LDLIBS)

$(RAGNAR_API):
# client-side IPC library. the WM links none of it, only the headers under
# api/include are needed to build. opt-in, for writing external clients.
.PHONY: api
api:
$(MAKE) -C api

.PHONY: install-api
install-api:
$(MAKE) -C api install

DEST_DIR := $(HOME)/.config/ragnarwm
CONFIG_FILE := $(DEST_DIR)/ragnar.cfg

.PHONY: config
config:
@if [ ! -f "$(CONFIG_FILE)" ]; then \
echo "Config file does not exist. Copying default config..."; \
mkdir -p "$(DEST_DIR)"; \
cp -r "./cfg/ragnar.cfg" "$(CONFIG_FILE)"; \
else \
echo "Config file already exists. Skipping copy $(CONFIG_FILE)."; \
fi

# no user config target: ragnar reads $HOME/.config/ragnarwm/ragnar.cfg first
# and falls back to the copy installed below. an override is a plain cp, and
# writing $HOME from a root install lands in the wrong home.
# mirrors PKGBUILD logic, and is "standard practice" for config files.
.PHONY: install
install:
install -Dm755 bin/$(BIN) -t $(BINDIR)
install -Dm755 ragnarstart -t $(BINDIR)
cp -f ragnar.desktop $(PREFIX)/share/xsessions/
install:
install -Dm755 bin/$(BIN) -t $(DESTDIR)$(BINDIR)
install -Dm644 ragnar.desktop -t $(DESTDIR)$(PREFIX)/share/xsessions
install -Dm644 cfg/ragnar.cfg -t $(DESTDIR)$(SYSCONFDIR)/ragnarwm

.PHONY: clean
clean:
$(RM) bin/*

.PHONY: uninstall
uninstall:
$(RM) $(BINDIR)/ragnar
$(RM) $(PREFIX)/share/xsessions/ragnar.desktop
$(RM) $(BINDIR)/ragnarstart
$(RM) $(DESTDIR)$(BINDIR)/$(BIN)
$(RM) $(DESTDIR)$(PREFIX)/share/xsessions/ragnar.desktop
$(RM) -r $(DESTDIR)$(SYSCONFDIR)/ragnarwm
46 changes: 33 additions & 13 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,33 +1,53 @@
# Contributor: Luxzi <luxzi@pm.me>
# Contributor: h8d13 <hadean-eon-dev@proton.me>

pkgname=ragnarwm
_pkgname="Ragnar"
pkgver='1.3'
_pkgname="ragnar"
pkgver='2'
pkgrel=1
pkgdesc="Minimal, flexible & user-friendly X tiling window manager"
arch=('x86_64')
url="https://github.com/cococry/Ragnar"
url="https://github.com/h8d13/ragnar"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'd have to edit these back to your repo; was needed for testing only on a fresh box.

license=('GPL')
groups=()
depends=('xcb' 'xcb-util' '')
# mirrors the NEEDED entries of bin/ragnar, nothing more:
# libxcb covers xcb + randr + xfixes, libx11 covers X11 + X11-xcb.
depends=(
'libxcb'
'libx11'
'xcb-util-keysyms'
'xcb-util-cursor'
'xcb-util-wm'
'libconfig'
'xorg-server'
'xorg-xinit'
)
makedepends=('git' 'make' 'gcc')
optdepends=(
'alacritty: default terminal keybind'
'polybar: optional status/desktops bars'
'ttf-dejavu: fonts for both the above'
)
provides=('ragnarwm')
source=("${_pkgname}::git+https://github.com/cococry/${_pkgname}.git")
options=('!debug')
backup=('etc/ragnarwm/ragnar.cfg')
source=("${_pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
cd $_pkgname
echo $pkgver
cd $_pkgname || exit 1
echo $pkgver
}

build() {
cd $_pkgname
make ragnar
cd $_pkgname || exit 1
make
}

package() {
cd $_pkgname
install -D -m777 ./ragnar "$pkgdir/usr/bin/ragnar"
install -D -m777 ./ragnar.desktop "$pkgdir/usr/share/applications/ragnar.desktop"
install -D -m777 ./ragnarstart "$pkgdir/usr/bin/ragnarstart"
cd $_pkgname || exit 1
# single source of truth: same install target ./install.sh drives.
# only the systemwide default cfg is installed, user cfg is a manual cp.
# this is usually convention for most WM configs, template in /etc
make DESTDIR="$pkgdir" PREFIX=/usr install
}
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ Installing Ragnar involves two steps.
Install the following dependencies:

```console
xcb-util
xcb-proto
xcb-util-keysyms
xcb-util-cursor
xcb-util-wm
xorg-server
xorg-xinit
mesa
libxcb \
libx11 \
xcb-util-keysyms \
xcb-util-cursor \
xcb-util-wm \
xorg-server \
xorg-xinit \
libconfig
```

Expand Down Expand Up @@ -74,11 +73,23 @@ The IPC system communicates through a socket using binary data. This allows exte
Ragnar uses `libconfig` to load an external configuration file:

```console
~/.config/ragnarwm.cfg
# by default, system-wide:
/etc/ragnarwm/ragnar.cfg
# or mkdir -p and cp the default per user.
~/.config/ragnarwm/ragnar.cfg
```

The configuration is loaded on startup and can be reloaded while the window manager is running, typically through a keybinding.

You can add to `.xinitrc`:

`exec path/to/ragnar` Then simply; `startx`

> By default it uses `alacritty` (Super+Return) and `dmenu` (Super+S), if you haven't edited these yet.
> Both of these need fonts file; for instance `ttf-dejavu`

You can also for example add: `polybar &` before the `exec ragnar` line.

---

## Code Structure
Expand Down
8 changes: 4 additions & 4 deletions api/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CC=gcc
CFLAGS=
all: lib/ragnar.a
lib/ragnar.a: lib/api.o
CFLAGS ?=
all: lib/libragnar.a
lib/libragnar.a: lib/api.o
ar cr lib/libragnar.a lib/*.o
lib/api.o: lib
lib/api.o: api.c include/ragnar/api.h | lib
${CC} -c api.c -o lib/api.o ${CFLAGS}

lib:
Expand Down
Binary file removed api/lib/api.o
Binary file not shown.
Binary file removed api/lib/libragnar.a
Binary file not shown.
Loading