config.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /* See LICENSE file for copyright and license details. */
  2. /* appearance */
  3. // the age of terminus is over
  4. //static const char dmenufont[] = "Terminus:pixelsize=28:style=Bold";
  5. static const char dmenufont[] = "Ubuntu Mono:size=18";
  6. static const char dmenuheight[] = "42";
  7. static const char *fonts[] = {
  8. "Ubuntu Mono:size=18",
  9. "FontAwesome:size=18",
  10. "M+ 2p medium:size=18",
  11. };
  12. /* ignore these (except borders), handled below */
  13. // use colors[0][0]/colors[0][2]/colors[0][1] instead
  14. //static const char normbordercolor[] = "#444444";
  15. //static const char normbgcolor[] = "#222222";
  16. //static const char normfgcolor[] = "#bbbbbb";
  17. // use colors[1][0]/colors[1][2]/colors[1][1] instead
  18. //static const char selbordercolor[] = "#005577";
  19. //static const char selbgcolor[] = "#005577";
  20. //static const char selfgcolor[] = "#eeeeee";
  21. /* settings */
  22. static const unsigned int borderpx = 6; /* border pixel of windows */
  23. static const unsigned int gappx = 18; /* gap pixel between windows */
  24. static const unsigned int barsize = 18; /* height of bar */
  25. static const unsigned int snap = 16; /* snap pixel */
  26. static const int showbar = 1; /* 0 means no bar */
  27. static const int topbar = 0; /* 0 means bottom bar */
  28. /* color handling */
  29. #define NUMCOLORS 6
  30. #define MAXC 3
  31. // colors[NUMCOLORS][MAXCOLORS][8]
  32. static const char colors[NUMCOLORS][MAXC][8] = {
  33. // border foreground background
  34. //{ "#000033", "#dddddd", "#000033" }, // normal
  35. //{ "#000044", "#ffffff", "#000044" }, // selected
  36. //{ "#ff0000", "#000000", "#ffff00" }, // urgent/warning (black on yellow)
  37. //{ "#ff0000", "#ffffff", "#ff0000" }, // error (white on red)
  38. // solid style
  39. /*
  40. { "#300020", "#dddddd", "#300020" }, // normal
  41. { "#600040", "#ffffff", "#600040" }, // selected
  42. { "#ff0000", "#000000", "#ffff00" }, // urgent/warning (black on yellow)
  43. { "#ff0000", "#ffffff", "#ff0000" }, // error (white on red)
  44. { "#ff0000", "#80005d", "#300015" }, // song
  45. { "#ff0000", "#ffffff", "#300015" }, // user
  46. */
  47. // old colors
  48. /*
  49. { "#300426", "#dddddd", "#300426" }, // normal
  50. { "#b0008d", "#ff00aa", "#300426" }, // selected
  51. { "#ff0000", "#dddddd", "#bb0040" }, // urgent/warning
  52. { "#ff0000", "#dddddd", "#90006d" }, // error
  53. { "#ff0000", "#dddddd", "#90006d" }, // song
  54. { "#ff0000", "#dddddd", "#006466" }, // user
  55. */
  56. // flat style
  57. { "#300426", "#dddddd", "#081620" }, // normal
  58. { "#4793cc", "#4793cc", "#081620" }, // selected
  59. { "#ff0000", "#dddddd", "#bb0040" }, // urgent/warning
  60. { "#ff0000", "#dddddd", "#184457" }, // error
  61. { "#ff0000", "#dddddd", "#184457" }, // song
  62. { "#ff0000", "#dddddd", "#4793cc" }, // user
  63. // add more here
  64. };
  65. /* tagging */
  66. //static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  67. static const char *tags[] = { "一","二", "三", "四", "五", "六", "七", "八", "九" };
  68. static const Rule rules[] = {
  69. /* xprop(1):
  70. * WM_CLASS(STRING) = instance, class
  71. * WM_NAME(STRING) = title
  72. */
  73. // TUI
  74. /* class instance title tags mask isfloating monitor */
  75. { "st-256color", "st-256color", "todoi", 0, 1, 0 },
  76. { "remind-st", "remind-st", NULL, 0, 1, 0 },
  77. { "cal-st", "cal-st", NULL, 0, 1, 0 },
  78. { "cmus-st", "cmus-st", NULL, 1 << 8, 0, -1 },
  79. // GUI
  80. /* class instance title tags mask isfloating monitor */
  81. { "Firefox", NULL, NULL, 0, 0, -1 },
  82. { "Xfe", NULL, NULL, 0, 1, -1 },
  83. { "mpv", NULL, "mpv", 0, 1, -1 },
  84. { "feh", NULL, NULL, 0, 1, -1 },
  85. { "ksnip", NULL, NULL, 0, 1, -1 },
  86. { "Steam", NULL, NULL, 0, 1, -1 },
  87. { "Virt-manager", "virt-manager", "Virtual Machine Manager", 1 << 7, 0, 0 },
  88. { "Virt-manager", "virt-manager", "almalinux9 on QEMU/KVM", 1 << 2, 0, 1 },
  89. { "qtfm", "qtfm", NULL, 0, 1, -1 },
  90. { "Pcmanfm", "pcmanfm", NULL, 0, 1, -1 },
  91. { "dolphin", "dolphin", NULL, 0, 1, -1 },
  92. { "Sxiv", "sxiv", NULL, 0, 1, -1 },
  93. { "cmus-rg", "cmus-rg", NULL, 0, 1, 0 },
  94. { "Rt", "rt", NULL, 0, 1, -1 },
  95. { "ffplay", "ffplay", NULL, 0, 1, -1 },
  96. { "Vivado", "Vivado", NULL, 0, 0, 0 },
  97. { "quartus", "quartus", NULL, 0, 0, 0 },
  98. { "qutebrowser", "qutebrowser", NULL, 1 << 0, 0, 1 },
  99. { "Gimp", NULL, NULL, 1 << 2, 1, -1 },
  100. { "krita", "krita", NULL, 1 << 2, 0, 1 },
  101. { "jetbrains-idea-ce", NULL, NULL, 1 << 2, 0, -1 },
  102. { "Tor Browser", NULL, NULL, 1 << 2, 1, -1 },
  103. { "qBittorrent", "qbittorrent", NULL, 1 << 6, 0, 0 },
  104. { "Mumble", "mumble", NULL, 1 << 7, 0, 0 },
  105. { "Chromium", "chromium", NULL, 1 << 7, 0, -1 },
  106. { "Wire", "wire", NULL, 1 << 8, 0, 0 },
  107. { "Element", "element", NULL, 1 << 8, 0, 0 },
  108. { "TelegramDesktop", "telegram-desktop", NULL, 1 << 8, 0, 0 },
  109. { "Thunderbird", "Mail", NULL, 1 << 8, 0, 0 },
  110. { "Code - OSS", "code - oss", NULL, 1 << 2, 0, -1 },
  111. // game
  112. /* class instance title tags mask isfloating monitor */
  113. { "Wine", NULL, "Adobe Flash Player 32", 0, 1, -1 },
  114. { "osu!", NULL, "osu!lazer", 0, 1, -1 },
  115. { "touhou-thing", "touhou-thing", NULL, 0, 1, -1 },
  116. { "Civ6Sub", "Civ6Sub", NULL, 0, 1, -1 },
  117. { "steam_proton", "steam_proton", NULL, 0, 1, -1 },
  118. { "Wine", "th123.exe", NULL, 0, 1, -1 },
  119. { "Lutris", "lutris", NULL, 1 << 7, 0, 0 },
  120. { "幻想人形演舞-ユメノカケラ-.exe", "幻想人形演舞-ユメノカケラ-.exe", NULL, 0, 1, -1 },
  121. { "Vsim", "vsim", NULL, 1 << 1, 0, 0 },
  122. };
  123. /* layout(s) */
  124. static const float mfact = 0.6; /* factor of master area size [0.05..0.95] */
  125. static const int nmaster = 1; /* number of clients in master area */
  126. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  127. static const Layout layouts[] = {
  128. /* symbol arrange function */
  129. { "||=", tile }, /* first entry is default */
  130. { "[[]", NULL }, /* no layout function means floating behavior */
  131. { "[M]", monocle },
  132. };
  133. /* key definitions */
  134. #define MODKEY Mod1Mask
  135. #define WINKEY Mod4Mask
  136. #define TAGKEYS(KEY,TAG) \
  137. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  138. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  139. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  140. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  141. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  142. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  143. /* commands */
  144. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  145. //static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  146. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-h", dmenuheight, "-nb", colors[0][2], "-nf", colors[0][1], "-sb", colors[1][2], "-sf", colors[1][1], NULL };
  147. static const char *roficmd[] = { "rofi", "-show", "run", NULL };
  148. static const char *roficmdalt[] = { "rofi", "-show", "drun", NULL };
  149. static const char *termcmd[] = { "st", NULL };
  150. static const char *lockercmd[] = { "slock", NULL };
  151. static const char *webbrowsercmd[] = { "qutebrowser", "strlst.myogaya.jp", NULL };
  152. static const char *filebrowsercmd[] = { "dolphin", NULL };
  153. static const char *termfilebrowsercmd[] = { "st", "rover", NULL };
  154. static const char *musicplayercmd[] = { "st", "-c", "cmus-st", "-n", "cmus-st", "cmus", NULL };
  155. static const char *calcmd[] = { "st", "-c", "cal-st", "-n", "cal-st", "-g", "=20x9+1680-64", "cali", NULL };
  156. static const char *taskmgrcmd[] = { "st", "htop", NULL };
  157. static const char *remindcmd[] = { "remind", NULL };
  158. static const char *musicartcmd[] = { "cmus-rg", NULL };
  159. #include "movestack.c"
  160. static Key keys[] = {
  161. /* modifier key function argument */
  162. //{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
  163. { MODKEY, XK_p, spawn, {.v = roficmd } },
  164. { MODKEY|ShiftMask, XK_p, spawn, {.v = roficmdalt } },
  165. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  166. { MODKEY|ShiftMask, XK_t, spawn, {.v = termcmd } },
  167. /* windows shortcuts LMAO */
  168. { WINKEY, XK_t, spawn, {.v = termcmd } },
  169. //{ MODKEY|ShiftMask, XK_s, spawn, {.v = webbrowsercmd } },
  170. //{ WINKEY, XK_s, spawn, {.v = webbrowsercmd } },
  171. { MODKEY|ShiftMask, XK_e, spawn, {.v = filebrowsercmd } },
  172. { WINKEY, XK_e, spawn, {.v = filebrowsercmd } },
  173. { MODKEY|ShiftMask, XK_r, spawn, {.v = remindcmd } },
  174. { WINKEY, XK_r, spawn, {.v = remindcmd } },
  175. { MODKEY|ShiftMask, XK_l, spawn, {.v = lockercmd } },
  176. { WINKEY, XK_l, spawn, {.v = lockercmd } },
  177. { MODKEY|ShiftMask, XK_y, spawn, {.v = musicplayercmd } },
  178. { WINKEY, XK_y, spawn, {.v = musicplayercmd } },
  179. { MODKEY|ShiftMask, XK_u, spawn, {.v = musicartcmd } },
  180. { WINKEY, XK_u, spawn, {.v = musicartcmd } },
  181. { MODKEY|ShiftMask, XK_i, spawn, {.v = calcmd } },
  182. { ControlMask|ShiftMask, XK_Escape, spawn, {.v = taskmgrcmd } },
  183. { MODKEY, XK_b, togglebar, {0} },
  184. { MODKEY, XK_j, focusstack, {.i = +1 } },
  185. { MODKEY, XK_k, focusstack, {.i = -1 } },
  186. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  187. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  188. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  189. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  190. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  191. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  192. { MODKEY, XK_Return, zoom, {0} },
  193. { MODKEY, XK_Tab, view, {0} },
  194. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  195. { MODKEY|ShiftMask, XK_x, killunsel, {0} },
  196. { MODKEY|ShiftMask, XK_x, killunsel, {0} },
  197. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  198. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  199. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  200. { MODKEY, XK_space, setlayout, {0} },
  201. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  202. { MODKEY, XK_s, togglesticky, {0} },
  203. { MODKEY, XK_0, view, {.ui = ~0 } },
  204. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  205. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  206. { MODKEY, XK_period, focusmon, {.i = +1 } },
  207. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  208. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  209. { MODKEY|ShiftMask, XK_minus, setgaps, {.i = -8 } },
  210. { MODKEY|ShiftMask, XK_plus, setgaps, {.i = +8 } },
  211. TAGKEYS( XK_1, 0)
  212. TAGKEYS( XK_2, 1)
  213. TAGKEYS( XK_3, 2)
  214. TAGKEYS( XK_4, 3)
  215. TAGKEYS( XK_5, 4)
  216. TAGKEYS( XK_6, 5)
  217. TAGKEYS( XK_7, 6)
  218. TAGKEYS( XK_8, 7)
  219. TAGKEYS( XK_9, 8)
  220. { MODKEY|ShiftMask, XK_q, quit, {0} },
  221. };
  222. /* button definitions */
  223. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  224. static Button buttons[] = {
  225. /* click event mask button function argument */
  226. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  227. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  228. { ClkWinTitle, 0, Button2, zoom, {0} },
  229. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  230. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  231. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  232. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  233. { ClkTagBar, 0, Button1, view, {0} },
  234. { ClkTagBar, 0, Button3, toggleview, {0} },
  235. { ClkTagBar, MODKEY, Button1, tag, {0} },
  236. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  237. };