suwako / UnixMenu アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

0.2.1

諏訪子 <suwako@076.moe>、2026-01-16 04:08
コミット ff6b1d36b0e3575943e8747ea06f58d185995231 ・親 7603358 ・ファイルを見る

7個のファイル、+27 -13

変更 CHANGELOG.md
@@ -1,3 +1,7 @@
1+# 0.2.1 (2026/01/16)
2+* DWMでうまく表示する様に
3+* あたしのDWMテーマに合わせる
4+
15 # 0.2.0 (2025/07/07)
26 * .desktopファイルがなければ、$PATHから実効してみる様に
37 * um.desktopファイルの追加
変更 Makefile
@@ -45,12 +45,12 @@
4545 CFLAGS += -I/usr/include/freetype2
4646 .endif
4747
48-LDFLAGS = -lc -lX11 -lXft
48+LDFLAGS = -lc -lX11 -lXft -lsys
4949 SLIB = -lxcb
5050 .if ${OS} == "openbsd"
5151 SLIB += -lfontconfig -lz -lexpat -lfreetype -lXrender -lXau -lXdmcp
5252 .elif ${OS} == "freebsd"
53-SLIB += -lthr -lfontconfig -lfreetype -lXrender -lXau -lXdmcp -lexpat -lz -lbz2\
53+SLIB += -lthr -lfontconfig -lintl -lfreetype -lXrender -lXau -lXdmcp -lexpat -lz -lbz2\
5454 -lpng16 -lbrotlidec -lm -lbrotlicommon
5555 .elif ${OS} == "netbsd"
5656 SLIB += -lfontconfig -lfreetype -lXau -lXdmcp -lgcc -lexpat -lz -lbz2 -lXrandr\
変更 main.c
@@ -1,6 +1,8 @@
11 #include <stdio.h>
22 #include <stdlib.h>
33
4+#include <X11/Xatom.h>
5+
46 #include "src/control.h"
57 #include "src/program.h"
68 #include "src/display.h"
@@ -14,7 +16,7 @@
1416 Visual *visual;
1517
1618 const char *sofname = "um";
17-const char *version = "0.2.0";
19+const char *version = "0.2.1";
1820
1921 int main() {
2022 Display *display;
@@ -44,11 +46,17 @@
4446 int window_y = (screen_height - window_height) / 2;
4547
4648 window = XCreateSimpleWindow(display, RootWindow(display, screen),
47- window_x, window_y, window_width, window_height, 1, BLACK, BLACK);
49+ window_x, window_y, window_width, window_height, 1, FGCOL, FGCOL);
4850 if (!window) {
4951 cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
5052 }
5153
54+ Atom net_wm_window_type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
55+ Atom dialog = XInternAtom(display, "_NET_WM_WINDOW_TYPE_DIALOG", False);
56+
57+ XChangeProperty(display, window, net_wm_window_type, XA_ATOM, 32,
58+ PropModeReplace, (unsigned char *)&dialog, 1);
59+
5260 XSetWindowBackground(display, window, BGCOL);
5361
5462 XSelectInput(display, window,
@@ -84,12 +92,12 @@
8492 exit(1);
8593 }
8694
87- if (!XftColorAllocName(display, visual, colormap, "white", &color)) {
95+ if (!XftColorAllocName(display, visual, colormap, "#ee4030", &color)) {
8896 cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
8997 fprintf(stderr, "色の役割に失敗。\n");
9098 }
9199
92- if (!XftColorAllocName(display, visual, colormap, "black", &selcolor)) {
100+ if (!XftColorAllocName(display, visual, colormap, "#120f12", &selcolor)) {
93101 cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual);
94102 fprintf(stderr, "選択色の役割に失敗。\n");
95103 }
変更 scrot1.png

バイナリファイル

変更 scrot2.png

バイナリファイル

変更 src/display.c
@@ -6,16 +6,17 @@
66
77 void drawtext(
88 Display *display, Window window, GC gc, int x, int y, const char *text, int sel) {
9+ XftColor *fgCol = (sel) ? &selcolor : &color;
910 if (sel) {
10- XSetForeground(display, gc, BLACK);
11+ XSetForeground(display, gc, BGSEL);
1112 XFillRectangle(
1213 display, window, gc, 0, y - item_height + 5, window_width, item_height);
13- XSetForeground(display, gc, BLACK);
14+ XSetForeground(display, gc, BGCOL);
1415 } else {
15- XSetForeground(display, gc, WHITE);
16+ XSetForeground(display, gc, FGSEL);
1617 }
1718
18- XftDrawStringUtf8(draw, &color, font, x, y, (const FcChar8 *)text, strlen(text));
19+ XftDrawStringUtf8(draw, fgCol, font, x, y, (const FcChar8 *)text, strlen(text));
1920 }
2021
2122 void filterdisplay(
変更 src/program.h
@@ -8,9 +8,10 @@
88 #define MAX_NAME_LEN 256
99 #define MAX_LINE_LENGTH 256
1010
11-#define WHITE 0xfcfcfc
12-#define BLACK 0x120f12
13-#define BGCOL 0x550f75
11+#define FGCOL 0xb61729
12+#define FGSEL 0x120f12
13+#define BGSEL 0xf35869
14+#define BGCOL 0x232023
1415
1516 typedef struct {
1617 char name[MAX_NAME_LEN];