commit ff8556664e12fc8effdbe2ea74afe478574f01e5
Author: Stephanos Pavlou <steph@stephanospavlou.info>
Date: Fri, 22 Mar 2024 12:17:07 -0600
initial commit
Diffstat:
9 files changed, 345 insertions(+), 0 deletions(-)
diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml
@@ -0,0 +1,40 @@
+live_config_reload = true
+
+[window.dimensions]
+columns = 80
+lines = 20
+
+[font]
+size = 9.0
+
+# Default colors
+[colors.primary]
+background = '#ffffff'
+foreground = '#1b1f24'
+
+# Cursor colors
+[colors.cursor]
+text = '#ffffff'
+cursor = '#24292f'
+
+# Normal colors
+[colors.normal]
+black = '#24292f'
+red = '#cf222e'
+green = '#0550ae'
+yellow = '#4d2d00'
+blue = '#0969da'
+magenta = '#8250df'
+cyan = '#1b7c83'
+white = '#6e7781'
+
+# Bright colors
+[colors.bright]
+black = '#57606a'
+red = '#a40e26'
+green = '#0969da'
+yellow = '#633c01'
+blue = '#218bff'
+magenta = '#8250df'
+cyan = '#1b7c83'
+white = '#6e7781'
diff --git a/ctwm/.ctwmrc b/ctwm/.ctwmrc
@@ -0,0 +1,119 @@
+#
+# Stephanos Pavlou's CTWM config
+# Last modifed: Thu, Mar 21 2024
+#
+
+Workspaces
+{
+ "ws1"
+ "ws2"
+ "ws3"
+ "ws4"
+}
+
+Cursors
+{
+ Frame "left_ptr"
+ Title "left_ptr"
+ Icon "hand"
+ Move "fleur"
+ Menu "sb_left_arrow"
+ Button "hand"
+}
+
+TitleFont "-dec-terminal-medium-r-normal-*-14-*-*-*-*-*-*-*"
+ResizeFont "-dec-terminal-medium-r-normal-*-14-*-*-*-*-*-*-*"
+MenuFont "-dec-terminal-medium-r-normal-*-14-*-*-*-*-*-*-*"
+IconFont "-dec-terminal-medium-r-normal-*-14-*-*-*-*-*-*-*"
+IconManagerFont "-dec-terminal-medium-r-normal-*-14-*-*-*-*-*-*-*"
+
+BorderWidth 1
+
+Color
+{
+ MenuBackground "white"
+ MenuForeground "black"
+
+ BorderColor "grey"
+
+ TitleForeground "black"
+ TitleBackground "white"
+}
+
+NoDefaults
+
+RightTitleButton "~/.ctwmresources/minimize.xbm" = f.iconify
+RightTitleButton "~/.ctwmresources/maximize.xbm" = f.fullzoom
+RightTitleButton "~/.ctwmresources/close.xbm" = f.delete
+
+TitleButtonBorderWidth 0
+
+Button1 = : root : f.menu "Main"
+Button1 = : title : f.function "move-or-raise"
+Button1 = : icon : f.function "move-or-iconify"
+Button3 = : root : f.menu "Workspace menu"
+Button3 = m : window | icon : f.resize
+
+MoveDelta 3
+Function "move-or-raise" {f.move f.deltastop f.raise}
+Function "move-or-iconify" {f.move f.deltastop f.iconify}
+
+"p" = m : all : f.exec "dmenu_run &"
+"Return" = m | s : all : f.exec "alacritty &"
+
+"1" = m : all : f.gotoworkspace "ws1"
+"2" = m : all : f.gotoworkspace "ws2"
+"3" = m : all : f.gotoworkspace "ws3"
+"4" = m : all : f.gotoworkspace "ws4"
+
+"c" = m | s : window : f.delete
+"q" = m | s : all : f.quit
+
+Menu "Main"
+{
+ "CTWM" f.title
+ "Applications" f.title
+ "Internet" f.menu "Internet"
+ "Terminal emulators" f.menu "Terminal emulators"
+ "Text editors" f.menu "Text editors"
+ "Miscellaneous" f.menu "Miscellaneous"
+ "System" f.title
+ "Restart CTWM" ("red" : "white") f.restart
+ "Quit CTWM" ("red" : "white") f.quit
+}
+
+Menu "Internet"
+{
+ "Firefox" f.exec "firefox &"
+ "Qutebrowser" f.exec "qutebrowser &"
+}
+
+Menu "Terminal emulators"
+{
+ "Alacritty" f.exec "alacritty &"
+ "Kitty" f.exec "kitty &"
+ "Terminator" f.exec "terminator &"
+ "Xterm" f.exec "xterm &"
+}
+
+Menu "Text editors"
+{
+ "Code (Open Source Visual Studio Code)" f.exec "code &"
+}
+
+Menu "Miscellaneous"
+{
+ "Xclock" f.exec "xclock &"
+ "Xeyes" f.exec "xeyes &"
+}
+
+Menu "Workspace menu"
+{
+ "Workspace menu" f.title
+ "Workspace 1" f.gotoworkspace "ws1"
+ "Workspace 2" f.gotoworkspace "ws2"
+ "Workspace 3" f.gotoworkspace "ws3"
+ "Workspace 4" f.gotoworkspace "ws4"
+ "Next workspace" f.nextworkspace
+ "Prev workspace" f.prevworkspace
+}
+\ No newline at end of file
diff --git a/ctwm/.ctwmresources/.twmrc b/ctwm/.ctwmresources/.twmrc
@@ -0,0 +1,77 @@
+# steph's .twmrc
+# Last updated: Oct 24 2021
+
+#-------------------------------------------------------------#
+# Cursors #
+#-------------------------------------------------------------#
+Cursors
+{
+ Frame "left_ptr"
+ Title "left_ptr"
+ Icon "left_ptr"
+ Menu "left_ptr"
+ Button "hand"
+}
+
+#-------------------------------------------------------------#
+# Actions #
+#-------------------------------------------------------------#
+MoveDelta 3
+Function "move-or-lower" { f.move f.deltastop f.lower }
+Function "move-or-raise" { f.move f.deltastop f.raise }
+Function "move-or-iconify" { f.move f.deltastop f.iconify }
+
+Button1 = : root : f.menu "main"
+Button1 = m : window|icon : f.function "move-or-lower"
+Button1 = : title : f.function "move-or-raise"
+Button1 = : icon : f.function "move-or-iconify"
+
+#-------------------------------------------------------------#
+# Menus settings #
+#-------------------------------------------------------------#
+menu "main"
+{
+ "twm" f.title
+ "Web browsers" f.menu "browsers"
+ "Terminals" f.menu "terminals"
+ "Applications" f.menu "applications"
+ "" f.nop
+ "Restart twm" f.restart
+ "Quit twm" f.quit
+ "" f.nop
+ "Reboot" f.exec "sudo reboot"
+ "Shutdown" f.exec "sudo shutdown now"
+}
+
+menu "browsers"
+{
+ "firefox" f.exec "firefox &"
+ "brave" f.exec "brave &"
+}
+
+menu "terminals"
+{
+ "xterm" f.exec "xterm &"
+ "alacritty" f.exec "alacritty &"
+}
+
+menu "applications"
+{
+ "xclock" f.exec "xclock -digital -brief -update 1 -twelve &"
+}
+
+#-------------------------------------------------------------#
+# Title bar buttons #
+#-------------------------------------------------------------#
+NoDefaults
+
+RightTitleButton "/home/drake/.twmresources/maximize.xbm" = f.fullzoom
+RightTitleButton "/home/drake/.twmresources/minimize.xbm" = f.iconify
+RightTitleButton "/home/drake/.twmresources/close.xbm" = f.delete
+
+TitleButtonBorderWidth 0
+
+#-------------------------------------------------------------#
+# Colors, fonts and styles #
+#-------------------------------------------------------------#
+
diff --git a/ctwm/.ctwmresources/close.xbm b/ctwm/.ctwmresources/close.xbm
@@ -0,0 +1,6 @@
+#define close_width 16
+#define close_height 16
+static char close_bits[] = {
+ 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x18, 0xC6, 0x38, 0xC7,
+ 0xF0, 0xC3, 0xE0, 0xC1, 0xE0, 0xC1, 0xF0, 0xC3, 0x38, 0xC7, 0x18, 0xC6,
+ 0x00, 0xC0, 0x00, 0xC0, 0xFF, 0xFF, 0x10, 0x10, };
diff --git a/ctwm/.ctwmresources/maximize.xbm b/ctwm/.ctwmresources/maximize.xbm
@@ -0,0 +1,6 @@
+#define maximize_width 16
+#define maximize_height 16
+static char maximize_bits[] = {
+ 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0xFC, 0xCF, 0xFC, 0xCF, 0xFC, 0xCF,
+ 0x04, 0xC8, 0x04, 0xC8, 0x04, 0xC8, 0x04, 0xC8, 0x04, 0xC8, 0x04, 0xC8,
+ 0xFC, 0xCF, 0x00, 0xC0, 0xFF, 0xFF, 0x00, 0x00, };
diff --git a/ctwm/.ctwmresources/minimize.xbm b/ctwm/.ctwmresources/minimize.xbm
@@ -0,0 +1,6 @@
+#define minimize_width 16
+#define minimize_height 16
+static char minimize_bits[] = {
+ 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0,
+ 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0xF8, 0xCF,
+ 0xF8, 0xCF, 0x00, 0xC0, 0xFF, 0xFF, 0xF0, 0x0F, };
diff --git a/ctwm/patch b/ctwm/patch
@@ -0,0 +1,25 @@
+=== modified file 'add_window.c'
+--- old/add_window.c 2023-01-28 01:02:55 +0000
++++ new/add_window.c 2024-03-22 17:55:58 +0000
+@@ -114,6 +114,7 @@
+ {
+ TwmWindow *tmp_win; /* new twm window structure */
+ bool ask_user; /* don't know where to put the window */
++ bool always_ask_user = true; /* optionally always ask user where to put window */
+ int gravx, gravy; /* gravity signs for positioning */
+ int namelen;
+ int bw2;
+@@ -775,10 +776,10 @@
+ * functions, for extra readability...
+ */
+ if(HandlingEvents && ask_user && !restoredFromPrevSession) {
+- if((Scr->RandomPlacement == RP_ALL) ||
++ if(!always_ask_user && ((Scr->RandomPlacement == RP_ALL) ||
+ ((Scr->RandomPlacement == RP_UNMAPPED) &&
+ ((tmp_win->wmhints->initial_state == IconicState) ||
+- (! visible(tmp_win))))) {
++ (! visible(tmp_win)))))) {
+ /* just stick it somewhere */
+
+ #ifdef DEBUG
+
diff --git a/dmenu/patch b/dmenu/patch
@@ -0,0 +1,21 @@
+diff --git a/config.def.h b/config.def.h
+index 1edb647..12d6527 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -4,13 +4,13 @@
+ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
+ /* -fn option overrides fonts[0]; default X11 font or font set */
+ static const char *fonts[] = {
+- "monospace:size=10"
++ "xft:foundry=dec:family=terminal"
+ };
+ static const char *prompt = NULL; /* -p option; prompt to the left of input field */
+ static const char *colors[SchemeLast][2] = {
+ /* fg bg */
+- [SchemeNorm] = { "#bbbbbb", "#222222" },
+- [SchemeSel] = { "#eeeeee", "#005577" },
++ [SchemeNorm] = { "#222222", "#ffffff" },
++ [SchemeSel] = { "#ffffff", "#222222" },
+ [SchemeOut] = { "#000000", "#00ffff" },
+ };
+ /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
diff --git a/dwm/patch b/dwm/patch
@@ -0,0 +1,44 @@
+diff --git a/config.def.h b/config.def.h
+index 9efa774..ccec556 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -7,11 +7,11 @@ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
+ static const char *fonts[] = { "monospace:size=10" };
+ static const char dmenufont[] = "monospace:size=10";
+-static const char col_gray1[] = "#222222";
+-static const char col_gray2[] = "#444444";
+-static const char col_gray3[] = "#bbbbbb";
+-static const char col_gray4[] = "#eeeeee";
+-static const char col_cyan[] = "#005577";
++static const char col_gray1[] = "#ffffff";
++static const char col_gray2[] = "#222222";
++static const char col_gray3[] = "#222222";
++static const char col_gray4[] = "#ffffff";
++static const char col_cyan[] = "#222222";
+ static const char *colors[][3] = {
+ /* fg bg border */
+ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+@@ -58,7 +58,7 @@ static const Layout layouts[] = {
+ /* commands */
+ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+-static const char *termcmd[] = { "st", NULL };
++static const char *termcmd[] = { "alacritty", NULL };
+
+ static const Key keys[] = {
+ /* modifier key function argument */
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..054abe2 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -1732,6 +1732,9 @@ togglefloating(const Arg *arg)
+ if (selmon->sel->isfloating)
+ resize(selmon->sel, selmon->sel->x, selmon->sel->y,
+ selmon->sel->w, selmon->sel->h, 0);
++
++ selmon->sel->x = 300;
++ selmon->sel->y = 300;
+ arrange(selmon);
+ }
+