diff --git a/CHANGELOG.md b/CHANGELOG.md index f4c247e..de9eec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.1 (2026/01/16) +* DWMでうまく表示する様に +* あたしのDWMテーマに合わせる + # 0.2.0 (2025/07/07) * .desktopファイルがなければ、$PATHから実効してみる様に * um.desktopファイルの追加 diff --git a/Makefile b/Makefile index e07d659..6c3731f 100644 --- a/Makefile +++ b/Makefile @@ -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\ diff --git a/main.c b/main.c index 8d8e734..a6d768e 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,8 @@ #include #include +#include + #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"); } diff --git a/scrot1.png b/scrot1.png index 337b71d..9aac1b8 100755 Binary files a/scrot1.png and b/scrot1.png differ diff --git a/scrot2.png b/scrot2.png index f6e0d9c..3a6b21f 100755 Binary files a/scrot2.png and b/scrot2.png differ diff --git a/src/display.c b/src/display.c index bee591b..5946a68 100644 --- a/src/display.c +++ b/src/display.c @@ -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( diff --git a/src/program.h b/src/program.h index 185a777..d257e89 100644 --- a/src/program.h +++ b/src/program.h @@ -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];