This commit is contained in:
2026-01-16 04:08:15 +09:00
parent 7603358afe
commit ff6b1d36b0
7 changed files with 27 additions and 13 deletions

View File

@@ -1,3 +1,7 @@
# 0.2.1 (2026/01/16)
* DWMでうまく表示する様に
* あたしのDWMテーマに合わせる
# 0.2.0 (2025/07/07)
* .desktopファイルがなければ、$PATHから実効してみる様に
* um.desktopファイルの追加

View File

@@ -45,12 +45,12 @@ CFLAGS += -I/usr/local/include -I/usr/local/include/X11\
CFLAGS += -I/usr/include/freetype2
.endif
LDFLAGS = -lc -lX11 -lXft
LDFLAGS = -lc -lX11 -lXft -lsys
SLIB = -lxcb
.if ${OS} == "openbsd"
SLIB += -lfontconfig -lz -lexpat -lfreetype -lXrender -lXau -lXdmcp
.elif ${OS} == "freebsd"
SLIB += -lthr -lfontconfig -lfreetype -lXrender -lXau -lXdmcp -lexpat -lz -lbz2\
SLIB += -lthr -lfontconfig -lintl -lfreetype -lXrender -lXau -lXdmcp -lexpat -lz -lbz2\
-lpng16 -lbrotlidec -lm -lbrotlicommon
.elif ${OS} == "netbsd"
SLIB += -lfontconfig -lfreetype -lXau -lXdmcp -lgcc -lexpat -lz -lbz2 -lXrandr\

16
main.c
View File

@@ -1,6 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xatom.h>
#include "src/control.h"
#include "src/program.h"
#include "src/display.h"
@@ -14,7 +16,7 @@ XftFont *font;
Visual *visual;
const char *sofname = "um";
const char *version = "0.2.0";
const char *version = "0.2.1";
int main() {
Display *display;
@@ -44,11 +46,17 @@ int main() {
int window_y = (screen_height - window_height) / 2;
window = XCreateSimpleWindow(display, RootWindow(display, screen),
window_x, window_y, window_width, window_height, 1, BLACK, BLACK);
window_x, window_y, window_width, window_height, 1, FGCOL, FGCOL);
if (!window) {
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
}
Atom net_wm_window_type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
Atom dialog = XInternAtom(display, "_NET_WM_WINDOW_TYPE_DIALOG", False);
XChangeProperty(display, window, net_wm_window_type, XA_ATOM, 32,
PropModeReplace, (unsigned char *)&dialog, 1);
XSetWindowBackground(display, window, BGCOL);
XSelectInput(display, window,
@@ -84,12 +92,12 @@ int main() {
exit(1);
}
if (!XftColorAllocName(display, visual, colormap, "white", &color)) {
if (!XftColorAllocName(display, visual, colormap, "#ee4030", &color)) {
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
fprintf(stderr, "色の役割に失敗。\n");
}
if (!XftColorAllocName(display, visual, colormap, "black", &selcolor)) {
if (!XftColorAllocName(display, visual, colormap, "#120f12", &selcolor)) {
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
fprintf(stderr, "選択色の役割に失敗。\n");
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 KiB

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View File

@@ -6,16 +6,17 @@ int topidx = 0;
void drawtext(
Display *display, Window window, GC gc, int x, int y, const char *text, int sel) {
XftColor *fgCol = (sel) ? &selcolor : &color;
if (sel) {
XSetForeground(display, gc, BLACK);
XSetForeground(display, gc, BGSEL);
XFillRectangle(
display, window, gc, 0, y - item_height + 5, window_width, item_height);
XSetForeground(display, gc, BLACK);
XSetForeground(display, gc, BGCOL);
} else {
XSetForeground(display, gc, WHITE);
XSetForeground(display, gc, FGSEL);
}
XftDrawStringUtf8(draw, &color, font, x, y, (const FcChar8 *)text, strlen(text));
XftDrawStringUtf8(draw, fgCol, font, x, y, (const FcChar8 *)text, strlen(text));
}
void filterdisplay(

View File

@@ -8,9 +8,10 @@
#define MAX_NAME_LEN 256
#define MAX_LINE_LENGTH 256
#define WHITE 0xfcfcfc
#define BLACK 0x120f12
#define BGCOL 0x550f75
#define FGCOL 0xb61729
#define FGSEL 0x120f12
#define BGSEL 0xf35869
#define BGCOL 0x232023
typedef struct {
char name[MAX_NAME_LEN];