Skip to content

Commit

Permalink
2.0 is pretty much ready
Browse files Browse the repository at this point in the history
  • Loading branch information
Cococry committed Aug 17, 2024
1 parent 4784732 commit 5283fe3
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ragnar
ragnar.o
ragnarstart
*.patch
.cache/
bin/
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = cc
CFLAGS = -O3 -ffast-math -Wall -Wextra -pedantic
LIBS = -lxcb -lxcb-keysyms -lxcb-icccm -lxcb-cursor -lxcb-randr -lxcb-composite -lxcb-ewmh -lX11 -lX11-xcb -lGL -lleif -lclipboard -lm -lconfig
LIBS = -lxcb -lxcb-keysyms -lxcb-icccm -lxcb-cursor -lxcb-randr -lxcb-composite -lxcb-ewmh -lX11 -lX11-xcb -lGL -lm -lconfig
SRC = ./src/*.c ./src/ipc/*.c
BIN = ragnar

Expand All @@ -23,18 +23,14 @@ config:

install:
sudo cp -f bin/${BIN} /usr/bin
sudo cp -f ragnar.desktop /usr/share/applications
sudo cp -f ragnar.desktop /usr/share/xsessions/
sudo cp -f ragnarstart /usr/bin
sudo mkdir -p /usr/share/ragnarwm
sudo cp -r ./fonts/ /usr/share/ragnarwm
sudo cp -r ./icons/ /usr/share/ragnarwm
sudo chmod 755 /usr/bin/ragnar

clean:
rm -f bin/*

uninstall:
sudo rm -f /usr/bin/ragnar
sudo rm -f /usr/share/applications/ragnar.desktop
sudo rm -f /usr/share/xsessions/ragnar.desktop
sudo rm -f /usr/bin/ragnarstart
sudo rm -r /usr/share/ragnarwm
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ arch=('x86_64')
url="https://github.com/cococry/Ragnar"
license=('GPL')
groups=()
depends=()
depends=('xcb' 'xcb-util' '')
makedepends=('git' 'make' 'gcc')
provides=('ragnarwm')
source=("${_pkgname}::git+https://github.com/cococry/${_pkgname}.git")
Expand Down
20 changes: 4 additions & 16 deletions cfg/ragnar.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
# ----------------------
# NOTE: For all key options, see:
# https://github.com/cococry/ragnar/blob/main/src/structs.h#L89
#
# NOTE: For all function options, see:
# https://github.com/cococry/ragnar/blob/main/src/structs.h#L18
# ----------------------
#

Expand Down Expand Up @@ -68,7 +71,7 @@ resize_button = "RightMouse";
initial_desktop = 0;
# Specfies the maximum number of allocated virtual
# desktops
max_desktops = 9;
num_desktops = 9;
# Specifies the name of every virtual desktop
# in order.
desktop_names = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
Expand Down Expand Up @@ -162,11 +165,6 @@ max_struts = 8;
# use Vsync
gl_vsync = false;

# Specifies the file where to log messages to.
# (Ignored if 'log_messages' or 'should_log_to_file'
# are disabled.)
log_file = "/home/cococry/ragnarwm.log";

# Specifies the cursor image to use for the root window
cursor_image = "arrow";

Expand Down Expand Up @@ -197,11 +195,6 @@ keybinds = (
key = "KeyTab";
do = "cyclefocusdown";
},
{
mod = "%mod_key | Shift";
key = "KeyTab";
do = "cyclefocusup";
},
{
mod = "%mod_key";
key = "KeyQ";
Expand Down Expand Up @@ -425,11 +418,6 @@ keybinds = (
key = "KeyJ";
do = "cycledownlayout";
},
{
mod = "%mod_key";
key = "KeyK";
do = "cycleuplayout";
},
{
mod = "%mod_key | Shift";
key = "KeyJ";
Expand Down
Binary file removed fonts/LilexNerdFont-Bold.ttf
Binary file not shown.
Binary file removed fonts/LilexNerdFont-Medium.ttf
Binary file not shown.
Binary file removed fonts/VictorMono-BoldItalic.ttf
Binary file not shown.
Binary file removed icons/close.png
Binary file not shown.
Binary file removed icons/layout.png
Binary file not shown.
7 changes: 7 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd api
make && sudo make install
cd ..
make config
make && sudo make install

echo "Successfully installed ragnarwm."
7 changes: 6 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,12 @@ readconfig(state_t* s, config_data_t* data) {

success = cfgreadstr(s, (const char**)&data->cursorimage, "cursor_image");

success = cfgreadstr(s, (const char**)&data->logfile, "log_file");
const char* home = getenv("HOME");
const char* relpath = "/.ragnarwm.log";
char* logpath = malloc(strlen(home) + strlen(relpath) + 2);
sprintf(logpath, "%s%s", home, relpath);
data->logfile = logpath;

success = cfgreadbool(s, &data->logmessages, "log_messages");
success = cfgreadbool(s, &data->shouldlogtofile, "should_log_to_file");

Expand Down
15 changes: 2 additions & 13 deletions src/ragnar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ setwintype(state_t* s, client_t* cl) {
hidetitlebar(s, cl);
}
if(wintype == s->ewmh_atoms[EWMHwindowTypeDialog]) {
removefromlayout(s, cl);
cl->floating = true;
}
}

Expand Down Expand Up @@ -1949,15 +1949,6 @@ setuptitlebar(state_t* s, client_t* cl) {
} else {
logmsg(s, LogLevelError, "GLX_EXT_swap_control not supported.");
}
if(!s->ui.init) {
s->ui = lf_init_x11(cl->area.pos.x, s->config.titlebarheight);
lf_free_font(&s->ui.theme.font);
s->ui.theme.font = lf_load_font(s->config.fontpath, 24);
s->ui.theme.text_props.text_color = lf_color_from_hex(s->config.fontcolor);

logmsg(s, LogLevelTrace, "created OpenGL context with version %s.", glGetString(GL_VERSION));
logmsg(s, LogLevelTrace, "initialized leif UI context and textures.");
}
rendertitlebar(s, cl);

if(!s->showtitlebars) {
Expand All @@ -1984,9 +1975,7 @@ rendertitlebar(state_t* s, client_t* cl) {

// Clear background
{
LfColor color = lf_color_from_hex(s->config.titlebarcolor);
vec4s zto = lf_color_to_zto(color);
glClearColor(zto.r, zto.g, zto.b, zto.a);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
}
glClear(GL_COLOR_BUFFER_BIT);

Expand Down
9 changes: 4 additions & 5 deletions src/structs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <leif/leif.h>
#include <stdint.h>
#include <stdbool.h>

#include <xcb/xcb.h>
#include <xcb/xcb_keysyms.h>
Expand Down Expand Up @@ -340,8 +341,8 @@ struct client_t {
bool urgent, ignoreunmap, ignoreexpose;
bool titlebar_render_additional;

vec2s minsize;
vec2s maxsize;
v2_t minsize;
v2_t maxsize;

float layoutsizeadd;

Expand Down Expand Up @@ -446,8 +447,6 @@ struct state_t {

bool showtitlebars;

LfState ui;
LfTexture closeicon, layouticon;

client_t* clients;
client_t* focus;
Expand Down

0 comments on commit 5283fe3

Please sign in to comment.