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 | + | |
| 1 | 5 | # 0.2.0 (2025/07/07) |
| 2 | 6 | * .desktopファイルがなければ、$PATHから実効してみる様に |
| 3 | 7 | * um.desktopファイルの追加 |
変更
Makefile
| @@ -45,12 +45,12 @@ | ||
| 45 | 45 | CFLAGS += -I/usr/include/freetype2 |
| 46 | 46 | .endif |
| 47 | 47 | |
| 48 | -LDFLAGS = -lc -lX11 -lXft | |
| 48 | +LDFLAGS = -lc -lX11 -lXft -lsys | |
| 49 | 49 | SLIB = -lxcb |
| 50 | 50 | .if ${OS} == "openbsd" |
| 51 | 51 | SLIB += -lfontconfig -lz -lexpat -lfreetype -lXrender -lXau -lXdmcp |
| 52 | 52 | .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\ | |
| 54 | 54 | -lpng16 -lbrotlidec -lm -lbrotlicommon |
| 55 | 55 | .elif ${OS} == "netbsd" |
| 56 | 56 | SLIB += -lfontconfig -lfreetype -lXau -lXdmcp -lgcc -lexpat -lz -lbz2 -lXrandr\ |
変更
main.c
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | #include <stdio.h> |
| 2 | 2 | #include <stdlib.h> |
| 3 | 3 | |
| 4 | +#include <X11/Xatom.h> | |
| 5 | + | |
| 4 | 6 | #include "src/control.h" |
| 5 | 7 | #include "src/program.h" |
| 6 | 8 | #include "src/display.h" |
| @@ -14,7 +16,7 @@ | ||
| 14 | 16 | Visual *visual; |
| 15 | 17 | |
| 16 | 18 | const char *sofname = "um"; |
| 17 | -const char *version = "0.2.0"; | |
| 19 | +const char *version = "0.2.1"; | |
| 18 | 20 | |
| 19 | 21 | int main() { |
| 20 | 22 | Display *display; |
| @@ -44,11 +46,17 @@ | ||
| 44 | 46 | int window_y = (screen_height - window_height) / 2; |
| 45 | 47 | |
| 46 | 48 | 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); | |
| 48 | 50 | if (!window) { |
| 49 | 51 | cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); |
| 50 | 52 | } |
| 51 | 53 | |
| 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 | + | |
| 52 | 60 | XSetWindowBackground(display, window, BGCOL); |
| 53 | 61 | |
| 54 | 62 | XSelectInput(display, window, |
| @@ -84,12 +92,12 @@ | ||
| 84 | 92 | exit(1); |
| 85 | 93 | } |
| 86 | 94 | |
| 87 | - if (!XftColorAllocName(display, visual, colormap, "white", &color)) { | |
| 95 | + if (!XftColorAllocName(display, visual, colormap, "#ee4030", &color)) { | |
| 88 | 96 | cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); |
| 89 | 97 | fprintf(stderr, "色の役割に失敗。\n"); |
| 90 | 98 | } |
| 91 | 99 | |
| 92 | - if (!XftColorAllocName(display, visual, colormap, "black", &selcolor)) { | |
| 100 | + if (!XftColorAllocName(display, visual, colormap, "#120f12", &selcolor)) { | |
| 93 | 101 | cleanup(display, window, gc, &color, &selcolor, draw, font, colormap, visual); |
| 94 | 102 | fprintf(stderr, "選択色の役割に失敗。\n"); |
| 95 | 103 | } |
変更
scrot1.png
バイナリファイル
変更
scrot2.png
バイナリファイル
| @@ -6,16 +6,17 @@ | ||
| 6 | 6 | |
| 7 | 7 | void drawtext( |
| 8 | 8 | Display *display, Window window, GC gc, int x, int y, const char *text, int sel) { |
| 9 | + XftColor *fgCol = (sel) ? &selcolor : &color; | |
| 9 | 10 | if (sel) { |
| 10 | - XSetForeground(display, gc, BLACK); | |
| 11 | + XSetForeground(display, gc, BGSEL); | |
| 11 | 12 | XFillRectangle( |
| 12 | 13 | display, window, gc, 0, y - item_height + 5, window_width, item_height); |
| 13 | - XSetForeground(display, gc, BLACK); | |
| 14 | + XSetForeground(display, gc, BGCOL); | |
| 14 | 15 | } else { |
| 15 | - XSetForeground(display, gc, WHITE); | |
| 16 | + XSetForeground(display, gc, FGSEL); | |
| 16 | 17 | } |
| 17 | 18 | |
| 18 | - XftDrawStringUtf8(draw, &color, font, x, y, (const FcChar8 *)text, strlen(text)); | |
| 19 | + XftDrawStringUtf8(draw, fgCol, font, x, y, (const FcChar8 *)text, strlen(text)); | |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | void filterdisplay( |
| @@ -8,9 +8,10 @@ | ||
| 8 | 8 | #define MAX_NAME_LEN 256 |
| 9 | 9 | #define MAX_LINE_LENGTH 256 |
| 10 | 10 | |
| 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 | |
| 14 | 15 | |
| 15 | 16 | typedef struct { |
| 16 | 17 | char name[MAX_NAME_LEN]; |