Git Product home page Git Product logo

ragnar's Introduction

RagnarWM

Overview

Ragnar is a minimal window manager for X written in C. The goal of this project is to create a window manager that has minimal bloat but is still aesthetic and usable.

Features

  • Tiling layout
  • Multi-monitor support
  • Altering layout (Application switching, changing master size...)
  • Fullscreening windows
  • Multiple Desktops
  • Status Bar
  • Scratchpads
  • Window decorations
  • Auto Start Commands
  • Multiple Layouts
  • Full compositor Support
  • Fully Featured/Configurable Bar UI
  • Hover to select windows
  • Support Extended Window Manager Hints
  • Custom Keybindings for Commands
  • Sys-Trays for bar

Installation

There is a script for Ubuntu users, all of the process is automated:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/suleyman-kaya/Ragnar/main/ubuntu_installation.sh)"

For Arch users there is also a installation script:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/cococry/Ragnar/main/install/arch_installation.sh)"

If you want to run Ragnar on your machine, clone this repo and install all dependencies with your package manager.

For configuration, there is a video guide on YouTube or go to the Ragnar wiki

Install Dependencies

  • git
  • sudo
  • make
  • cc
  • xorg
  • xorg-xinit

Clone the repo

git clone https://github.com/cococry/Ragnar

Installing the WM is as easy as

cd Ragnar/
sudo make ragnar install

Then, in your ~/.xinitrc add:

exec ragnar

If you are using a session manager you need to add ragnar to your sessions:

sudo cp ragnar.desktop /usr/share/xsessions/ragnar.desktop

IMPORTANT

In the config.h file specify your monitor setup in order for the WM to work as intended. Also, for configuration of the WM use the config.h file.

Notes

For the best experience, i suggest to use a X compositer like picom. I am using picom pijulius because i think it has very clean animation support. You can find my picom config here

If you find bugs or have any problems with Ragnar, feel free to submit an issue.

Inspiration

RagnarWM is mainly inspired by dwm. I, myself used dwm as my main window manager in the past and i really liked the minimalist style of it. But i found it really frustrating how the default dwm repository was pretty much unusable out of the box. A lot of main features are non-existend in dwm or poorly designed. That's why i was inspired to create a minimal window manager that comes with usablity out of the box. I don't think usablity and features have to suffer with minimalism. But don't get me wrong, dwm is a great window manager and i had a really nice time using it.

Usage

Configuration

Configuring Ragnar is a similar process as configuring dwm. There is a config.h file with macros you can change and lists you can change to your liking. The config is written in a way, so that people without any experience in C can read it and change it.

If you changed your configuration, just use:

sudo make clean ragnar install

And Press Super + C to shutdown the WM. Then, in the tty use startx to restart the WM.

Default Keybindings

Keybind Action
SUPER + Middle Mouse Hard-Select Window
SUPER + Enter Open terminal
SUPER + W Open Web-browser
SUPER + S Open Application Launcher
SUPER + Q Quit Application
SUPER + C Quit WM
SUPER + Space Add window to layout
SUPER + Up Arrow Move window up in layout
SUPER + Down Arrow Move window down in layout
SUPER + L Increase master size in layout
SUPER + H Decrease master size in layout
SUPER + J Increase slave size in layout
SUPER + K Decrease slave size in layout
SUPER + Plus Increase gap size of windows
SUPER + Minus Decrease gap size of windows
SUPER + F Fullscreen selected window
SUPER + Shift + T Set tiled master layout
SUPER + Shift + X Set horizontal stripes layout
SUPER + Shift + M Set vertical stripes layout
SUPER + Shift + V Set horizontal master layout
SUPER + Shift + R Set floating layout
SUPER + A Cycle desktop down
SUPER + D Cycle desktop up
SUPER + O Cycle window one desktop down
SUPER + P Cycle window one desktop down
SUPER + B Cycle bar one monitor down
SUPER + N Cycle bar one monitor up
SUPER + I Toggle bar visibility
SUPER + Tab Cycle through windows
SUPER + U Toggle window decorations
SUPER + 1 Terminal scratchpad
SUPER + 2 Vim scratchpad

ragnar's People

Contributors

cococry avatar cykrr avatar dtenebrae avatar linsyking avatar paullotz avatar sigmanificient avatar suleyman-kaya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ragnar's Issues

Keybinds don't work when NumLock is on

Describe the bug
Keybinds don't work when NumLock is on.
You can use xev to see that during NumLock it is generating a different event state which is why it's not working.

To Reproduce
Steps to reproduce the behavior:

  1. Turn on NumLock
  2. Try to use the any keybind with the modifier key
  3. Observe that nothing had happened

Expected behavior
Keybinds should work when NumLock is both off and on.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.3 on VMware Workstation 17 on Windows 11

Error during installation

Hey there I saw your post in reddit and tried to install Xranger using steps provided in md file but i am getting this error. Do i have to install libraries ?
image

Machine

OS: Fedora 37
WM: i3

xorg-dev not found

i ran the script, it gives me an error: xorg-dev package not found, at the end it says ragnar installed, but i don't have any entry in my display manager (gdm)

unable to load ft2build.h

I am trying to install this on Ubuntu 23.04, I am getting the following error when doing "sudo make clean install"

~/Ragnar$ sudo make clean install
rm -f ragnar
rm -f /usr/bin/ragnar
gcc ragnar.c -o ragnar -lX11 -lXcursor -lXft -O3 -ffast-math -Wall -Wextra
In file included from ragnar.c:4:
/usr/include/X11/Xft/Xft.h:40:10: fatal error: ft2build.h: No such file or directory
40 | #include <ft2build.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:2: install] Error 1

The libfreetype dev package is already installed yet this is unable to load it.
How can I resolve this ?

Windows do not fit screen on non-16:9 resolutions

Expected behavior:
The windows will fit the resolution. The bar is on top of the windows.

Actual Behavior:
The windows only fit 16:9 resolutions. The bar is not in the correct place.

To Reproduce:
Steps to reproduce the behavior:

  1. Start Ragnar on a display with a non-16:9 resolution or use xrandr to change the resolution to a non-16:9 one
  2. Windows will no longer fit the screen and the bar will no longer be in the right place

Screenshots:

2560x1080 21:9 Ultra-wide monitor

  • OS: Arch Linux
  • Version: 1.3

Cant start Ragnar

Describe the bug
This is probably not a bug and more incompetence on my side but I am unable to start the WM. The .xinitrc file didnt exist before I created it and added exec ragnar to it. I am using Gdm and Xorg if that helps

To Reproduce
Steps to reproduce the behavior:

  1. boot pc
  2. tried multiple ways of starting Ragnar like manually running ragnar open and exec ragnar in tty with error ragnar: Keyfile not found or the shell just closing and reprompting me for login
    Expected behavior
    A clear and concise description of what you expected to happen.
    Ragnar starts

Desktop (please complete the following information):

  • OS: ArchLinux Kernel 6.3.2-arch1-1
  • Browser Firefox
  • Version Ragnar V1.0

HELP

I wanted to install the WM on pop OS but when i logout and change the desktop i just get a black screen. Also i tried to launch it with the tty i also get a black screen could u maybe tell me where to view for logs for debugging. And some common issues that i have to look for.

FILE: $HOME/.xsession-errors

`Xsession: X session started for vino at Tue May 16 12:47:28 PM CEST 2023
dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting DISPLAY=:1
dbus-update-activation-environment: setting XAUTHORITY=/home/vino/.Xauthority
localuser:vino being added to access control list
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1`

THX :D

when i try to do sudo make clean ragnar install or make clean ragnar install this happened and i did reinstall ragnar also im on arch

❯ sudo make clean ragnar install
rm -f ragnar ragnar.o
cc -c -O3 -ffast-math -Wall -Wextra -lXft -lX11 -lXcursor -lXft -lfontconfig -lXcomposite -lXrandr -I/usr/include/freetype2 ragnar.c
ragnar.c: In function ‘handle_button_press’:
ragnar.c:650:26: error: expected ‘;’ before numeric constant
650 | for(uint32_t i = 0; i BAR_BUTTON_COUNT; i++) {
| ^
| ;
ragnar.c: In function ‘create_bar’:
ragnar.c:1719:26: error: expected ‘;’ before ‘BABUTTON_COUNT’
1719 | for(uint32_t i = 0; i BABUTTON_COUNT; i++) {
| ^~~~~~~~~~~~~~~

Ragnar on  main via C v13.2.1-gcc
❯ sudo make clean ragnar install
rm -f ragnar ragnar.o
cc -c -O3 -ffast-math -Wall -Wextra -lXft -lX11 -lXcursor -lXft -lfontconfig -lXcomposite -lXrandr -I/usr/include/freetype2 ragnar.c
ragnar.c: In function ‘handle_button_press’:
ragnar.c:650:27: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
650 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
ragnar.c: In function ‘create_bar’:
ragnar.c:1719:27: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
1719 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
ragnar.c: In function ‘hide_bar’:
ragnar.c:1747:27: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
1747 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
ragnar.c: In function ‘unhide_bar’:
ragnar.c:1757:27: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
1757 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
ragnar.c: In function ‘change_bar_monitor’:
ragnar.c:1772:27: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
1772 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
ragnar.c: In function ‘raise_bar’:
ragnar.c:2008:31: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
2008 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
ragnar.c: In function ‘draw_bar_buttons’:
ragnar.c:2055:27: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits]
2055 | for(uint32_t i = 0; i < BAR_BUTTON_COUNT; i++) {
| ^
cc -o ragnar ragnar.o -lXft -lX11 -lXcursor -lXft -lfontconfig -lXcomposite -lXrandr -I/usr/include/freetype2
cp -f ragnar /usr/bin
cp -f ragnar.desktop /usr/share/applications
cp -f ragnarstart /usr/bin
chmod 755 /usr/bin/ragnar

*and i also cant summon the terminal etc i can do basic stuff like switch workspaces

The WM glitches/bugs out

Desktop.2023.08.20.-.09.07.06.03.DVR.mp4

As you can see when i play around with the wm sometimes it bugs (more precisely when i close windows and i think even when i open them). The same happened yesterday with the ver 1.3 ( i think was even worse the state). I want to figure out if the problem is the VIrtual Machine itself or something else.
Keep in mind that this is a fresh arch installation with basically only the dependencies and xorg.

Desktop

  • OS: Arch Linux
  • Host: Virtual Box

License Precision: GPLv3 only or extended?

Hi, I am currently trying to ship Ragnar into the nixpkgs.

My proposition for a derivation as been reviewed, and within the changes requested lies a question about the license.
Nix distinguishes between gpl "only" and "plus", and we need to know in which this project is.

The ambiguous gpl3 attribute is sorta-outdated, we prefer clarifying if it's gpl3Only (without the "or (at your option) any later version" bit) or gpl3Plus (with it).

The license text expects the developer to include the GPL notice at the start of their code files. If the aforementioned line is included in these, then the license says that code may be "upgraded" to any later GPL version.

Cant start ragnar in Xephyr

Describe the bug
Cant start ragnar in Xephyr.

To Reproduce
Steps to reproduce the behavior:

  • compile ragnar
  • start the run script.

Expected behavior
Ragnar should start within the Xephyr window

Screenshots
image

Desktop (please complete the following information):

  • OS: NixOS
    To reproduce:

nix-shell -p gcc gnumake xorg.libX11 xorg.libXft xorg.libXfont xorg.libXcursor -I nixpkgs=channel:nixos-22.05

Errors during install

When i try to install Ragnar I get errors:

IMG_20230810_181128

this is from aur, but it happens even if I run the script or build the package

Issue with Keyboard Layout

I'm not sure if this is related to Ragnar, but when I start Ragnar I don't have the keyboard layout I previously used (English US), but BSPWM still uses it. I didn't see anything in the config about keyboard layouts.

WE NEED SUPPORT FOR FEDORA

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Pywal and more multiple Monitor support

Pywal

Would be great to have a pywal support since ragnarwm is a inspiration to dwm you can use the same header file that pywal generates and implement it in to ragnar.

More Multiple Monitor support

I do not know if there are any keybinds that permits to move windows between 2 monitors, but would be cool to have it.

Ex. modkey + shift + a => move the window to the right monitor
modkey + shift + d => move the window to the left monitor

scratchpad default window size

Thank you Cococry for including scratchpads in such a short period of time. It's great that an unlimited number of scratchpad counts can be defined by users in the config.h file.

On my 1920x1080 display the scratchpads open in size 964x532. I am finding this size a bit too small to display mc, btop and links browser for reading files locally.

I know I can resize the scratchpad window with a right click/drag of the mouse but would prefer it if the scratchpads opened by default in a larger size about 1600x900.

Have looked thru ragnar.c for lines to change the size of the scratchpad but have not found how to do this.

Is it possible you could add a feature in config.h where the size of the scratchpad windows can be defined.

If its too difficult to code just leave it as is I'm just delighted you've added scratchpads that can be used so easily.

Keyboard not working properly

Describe the bug
When launching into Ragnar the only way to launch alacritty is through the bar button, same with dmenu. The configuration is the default one. When it launches the terminal, the terminal cursor remains on the screen as if the window isn't selected. Sometimes I can type, sometimes I cannot, it is very inconsistent. If I launch Firefox or Chromium the same behavior appears, (minus the text cursor). Sometimes I can type, sometimes I just can´t. Also, the key binds in the default config are not working. Also, Y and Z are inverted, meaning that if I type Z I get Y on the screen and vice versa. No any other keys have this problem as far as I've seen. The only way to fix it is using setxkbmap to set my layout again, that is, if the terminal allows me to type.

To Reproduce
Launch the WM and try to use any default keybind.

Expected behavior
Keys working.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Browser: Firefox
  • Version: 1.1

Additional context
This were my first minutes in Ragnar. It may as well be that I'm doing something wrong, but I checked dependencies and the config and everything looks ok to me. Dependencies are all installed. Other WMs are working properly.

Support of XF86 Keybinds

Is your feature request related to a problem? Please describe.
I tried to use XF86 keybinds to control brightness through the keyboard, but when i included the header <X11/XF86keysym.h> in the structs.h and then added XF86XK_MonBrightnessUp/XF86XK_MonBrightnessDown with custom keybinds, it just didn't worked.

Describe the solution you'd like
Custom keybinds commands to fire when XF86 keybinds are used.

Describe alternatives you've considered
I didn't considered any alternative.

Additional context
No additional context

change arch install script

during arch installation via the premade script, I noticed that the command run to install dependencies was pacman -S instead of pacman -S --needed

the result of this is that the script will reinstall its dependencies rather than only installing the ones that it needs. This takes more time for no benefit.

Ragnar doesn't work on Linux Mint

Describe the bug
When I log in, the screen is just black and the only thing you can do is to move the cursor around.

To Reproduce
Steps to reproduce the behavior:

  1. Install Mint
  2. Install Ragnar
  3. Log on in RagnarWM

Desktop (please complete the following information):

  • Linux Mint

I don't know if Ragnar is compatible with other distros such as mint or pop os but since Mint is Ubuntu based, I thought that it would work flawlessly, but that isnt the case. Any help would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.