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) # 0.2.0 (2025/07/07)
* .desktopファイルがなければ、$PATHから実効してみる様に * .desktopファイルがなければ、$PATHから実効してみる様に
* um.desktopファイルの追加 * um.desktopファイルの追加

View File

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

16
main.c
View File

@@ -1,6 +1,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <X11/Xatom.h>
#include "src/control.h" #include "src/control.h"
#include "src/program.h" #include "src/program.h"
#include "src/display.h" #include "src/display.h"
@@ -14,7 +16,7 @@ XftFont *font;
Visual *visual; Visual *visual;
const char *sofname = "um"; const char *sofname = "um";
const char *version = "0.2.0"; const char *version = "0.2.1";
int main() { int main() {
Display *display; Display *display;
@@ -44,11 +46,17 @@ int main() {
int window_y = (screen_height - window_height) / 2; int window_y = (screen_height - window_height) / 2;
window = XCreateSimpleWindow(display, RootWindow(display, screen), 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) { if (!window) {
cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); 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); XSetWindowBackground(display, window, BGCOL);
XSelectInput(display, window, XSelectInput(display, window,
@@ -84,12 +92,12 @@ int main() {
exit(1); 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); cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
fprintf(stderr, "色の役割に失敗。\n"); 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); cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
fprintf(stderr, "選択色の役割に失敗。\n"); 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( void drawtext(
Display *display, Window window, GC gc, int x, int y, const char *text, int sel) { Display *display, Window window, GC gc, int x, int y, const char *text, int sel) {
XftColor *fgCol = (sel) ? &selcolor : &color;
if (sel) { if (sel) {
XSetForeground(display, gc, BLACK); XSetForeground(display, gc, BGSEL);
XFillRectangle( XFillRectangle(
display, window, gc, 0, y - item_height + 5, window_width, item_height); display, window, gc, 0, y - item_height + 5, window_width, item_height);
XSetForeground(display, gc, BLACK); XSetForeground(display, gc, BGCOL);
} else { } 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( void filterdisplay(

View File

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