From a34c161a6643f184348f42235bcda46352b68da0 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sun, 18 Sep 2022 14:38:41 +1200 Subject: Starting work on multiple monitors --- config.h | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 72be653..d5d7ba5 100644 --- a/config.h +++ b/config.h @@ -5,16 +5,19 @@ #include //Startup -std::string startup[] = {"picom -fD 3", "feh --bg-scale /usr/share/backgrounds/vapor_trails_blue.png", "~/.config/polybar/launch.sh", "emacs --daemon"}; +const std::string startup[] = {"picom -fD 3", "feh --bg-scale /usr/share/backgrounds/vapor_trails_blue.png", "~/.config/polybar/launch.sh", "emacs --daemon"}; //Main config -int gaps = 3; -int outerGaps = 3; -std::string logFile = "/tmp/yatlog"; +const int gaps = 3; +const int outerGaps = 3; +const std::string logFile = "/tmp/yatlog.txt"; //WS config const int numWS = 10; -std::string workspaceNames[] = {"1: ", "2: 拾", "3: ", "4: ", "5: ", "6: ", "7: 拾", "8: ", "9: ", "10: "}; +const std::string workspaceNames[] = {"1: ", "2: 拾", "3: ", "4: ", "5: ", "6: ", "7: 拾", "8: ", "9: ", "10: "}; +//If you have more then 2 monitors change the number below +const int maxMonitors = 2; +const int screenPreferences[][maxMonitors] = {{0}, {0}, {0}, {0}, {0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}}; //Keys //The types and perhaps functions likely to be moved to seperate header file later @@ -35,8 +38,8 @@ typedef union struct Key { - unsigned int modifiers; - KeySym keysym; + const unsigned int modifiers; + const KeySym keysym; void (*function)(const KeyArg arg); const KeyArg arg; }; @@ -52,25 +55,28 @@ KEYCOM(changeWS); KEYCOM(wToWS); KEYCOM(focChange); KEYCOM(wMove); +KEYCOM(bashSpawn); +KEYCOM(screenTest); +//Super key mod +#define MOD Mod4Mask +//Alt key mod +//#define MOD Mod1Mask +#define SHIFT ShiftMask const char* alacritty[] = {"alacritty", NULL}; const char* rofi[] = {"rofi", "-i", "-show", "drun", NULL}; const char* qutebrowser[] = {"qutebrowser", NULL}; - const char* i3lock[] = {"i3lock", "-eti", "/usr/share/backgrounds/lockscreen.png", NULL}; const char* suspend[] = {"systemctl", "suspend", NULL}; -//Super key mod -//#define MOD Mod4Mask -//Alt key mod -#define MOD Mod1Mask -#define SHIFT ShiftMask +const char* monConfig[] = {"~/.i3_commands/monitor-config.sh"}; + #define WSKEY(K, X) \ {MOD, K, changeWS, {.num = X}}, \ {MOD|SHIFT, K, wToWS, {.num = X}} -static Key keyBinds[] = { +const Key keyBinds[] = { //Modifiers //Key //Func //Args //General {MOD, XK_e, exit, {NULL}}, @@ -82,6 +88,8 @@ static Key keyBinds[] = { {MOD, XK_x, spawn, {.str = i3lock}}, {MOD|SHIFT, XK_x, spawn, {.str = i3lock}}, {MOD|SHIFT, XK_x, spawn, {.str = suspend}}, + {MOD, XK_m, bashSpawn, {.str = monConfig}}, + {MOD|SHIFT, XK_t, screenTest, {NULL}}, //Focus {MOD, XK_h, focChange, {.dir = Left}}, {MOD, XK_j, focChange, {.dir = Down}}, -- cgit v1.2.3 From bcf9e480629d3bca64fc356e82560848aacfdd13 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Mon, 17 Oct 2022 14:51:58 +1300 Subject: Ready to test multi monitor workspace switch --- config.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index d5d7ba5..4b140ac 100644 --- a/config.h +++ b/config.h @@ -8,8 +8,15 @@ const std::string startup[] = {"picom -fD 3", "feh --bg-scale /usr/share/backgrounds/vapor_trails_blue.png", "~/.config/polybar/launch.sh", "emacs --daemon"}; //Main config +// Sensible gaps const int gaps = 3; const int outerGaps = 3; +// Huge gaps +/* +const int gaps = 20; +const int outerGaps = 30; +*/ + const std::string logFile = "/tmp/yatlog.txt"; //WS config @@ -58,18 +65,22 @@ KEYCOM(wMove); KEYCOM(bashSpawn); KEYCOM(screenTest); -//Super key mod +// Super key mod #define MOD Mod4Mask -//Alt key mod +// Alt key mod //#define MOD Mod1Mask #define SHIFT ShiftMask + +// Programs to run for keybinds const char* alacritty[] = {"alacritty", NULL}; const char* rofi[] = {"rofi", "-i", "-show", "drun", NULL}; const char* qutebrowser[] = {"qutebrowser", NULL}; const char* i3lock[] = {"i3lock", "-eti", "/usr/share/backgrounds/lockscreen.png", NULL}; const char* suspend[] = {"systemctl", "suspend", NULL}; -const char* monConfig[] = {"~/.i3_commands/monitor-config.sh"}; +// Script to run for keybinds +// Script I made to run an xrandr command +const char* monConfig[] = {"~/.yat_commands/monitor-config.sh"}; #define WSKEY(K, X) \ @@ -77,8 +88,8 @@ const char* monConfig[] = {"~/.i3_commands/monitor-config.sh"}; {MOD|SHIFT, K, wToWS, {.num = X}} const Key keyBinds[] = { - //Modifiers //Key //Func //Args - //General + // Modifiers //Key //Func //Args + // General {MOD, XK_e, exit, {NULL}}, {MOD, XK_Return, spawn, {.str = alacritty}}, {MOD, XK_d, spawn, {.str = rofi}}, @@ -90,17 +101,17 @@ const Key keyBinds[] = { {MOD|SHIFT, XK_x, spawn, {.str = suspend}}, {MOD, XK_m, bashSpawn, {.str = monConfig}}, {MOD|SHIFT, XK_t, screenTest, {NULL}}, - //Focus + // Focus {MOD, XK_h, focChange, {.dir = Left}}, {MOD, XK_j, focChange, {.dir = Down}}, {MOD, XK_k, focChange, {.dir = Up}}, {MOD, XK_l, focChange, {.dir = Right}}, - //Window moving + // Window moving {MOD|SHIFT, XK_h, wMove, {.dir = Left}}, {MOD|SHIFT, XK_j, wMove, {.dir = Down}}, {MOD|SHIFT, XK_k, wMove, {.dir = Up}}, {MOD|SHIFT, XK_l, wMove, {.dir = Right}}, - //Workspaces + // Workspaces WSKEY(XK_1, 1), WSKEY(XK_2, 2), WSKEY(XK_3, 3), -- cgit v1.2.3 From 599664b8c9d7754d5a073fe2e4e129535f5fbd73 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Tue, 18 Oct 2022 17:57:38 +1300 Subject: Progress... I hope --- config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 4b140ac..c848778 100644 --- a/config.h +++ b/config.h @@ -63,7 +63,7 @@ KEYCOM(wToWS); KEYCOM(focChange); KEYCOM(wMove); KEYCOM(bashSpawn); -KEYCOM(screenTest); +KEYCOM(reload); // Super key mod #define MOD Mod4Mask @@ -100,7 +100,7 @@ const Key keyBinds[] = { {MOD|SHIFT, XK_x, spawn, {.str = i3lock}}, {MOD|SHIFT, XK_x, spawn, {.str = suspend}}, {MOD, XK_m, bashSpawn, {.str = monConfig}}, - {MOD|SHIFT, XK_t, screenTest, {NULL}}, + {MOD|SHIFT, XK_r, reload, {NULL}}, // Focus {MOD, XK_h, focChange, {.dir = Left}}, {MOD, XK_j, focChange, {.dir = Down}}, -- cgit v1.2.3 From 6ea2604001ccfa597ae729681f37b3d7bbef3a1a Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Wed, 14 Dec 2022 17:46:48 +1300 Subject: Multiple monitors kinda working --- config.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index c848778..34b5704 100644 --- a/config.h +++ b/config.h @@ -5,7 +5,12 @@ #include //Startup -const std::string startup[] = {"picom -fD 3", "feh --bg-scale /usr/share/backgrounds/vapor_trails_blue.png", "~/.config/polybar/launch.sh", "emacs --daemon"}; +const std::string startup[] = { + //"picom -fD 3", + "feh --bg-scale /usr/share/backgrounds/vapor_trails_blue.png", + //"~/.config/polybar/launch.sh", + //"emacs --daemon" +}; //Main config // Sensible gaps @@ -64,11 +69,14 @@ KEYCOM(focChange); KEYCOM(wMove); KEYCOM(bashSpawn); KEYCOM(reload); +KEYCOM(wsDump); +KEYCOM(nextMonitor); // Super key mod #define MOD Mod4Mask +#define ALT Mod1Mask // Alt key mod -//#define MOD Mod1Mask +// #define MOD Mod1Mask #define SHIFT ShiftMask // Programs to run for keybinds @@ -78,7 +86,7 @@ const char* qutebrowser[] = {"qutebrowser", NULL}; const char* i3lock[] = {"i3lock", "-eti", "/usr/share/backgrounds/lockscreen.png", NULL}; const char* suspend[] = {"systemctl", "suspend", NULL}; -// Script to run for keybinds +// Scripts to run for keybinds // Script I made to run an xrandr command const char* monConfig[] = {"~/.yat_commands/monitor-config.sh"}; @@ -101,11 +109,14 @@ const Key keyBinds[] = { {MOD|SHIFT, XK_x, spawn, {.str = suspend}}, {MOD, XK_m, bashSpawn, {.str = monConfig}}, {MOD|SHIFT, XK_r, reload, {NULL}}, + // Testing + {MOD, XK_p, wsDump, {NULL}}, // Focus {MOD, XK_h, focChange, {.dir = Left}}, {MOD, XK_j, focChange, {.dir = Down}}, {MOD, XK_k, focChange, {.dir = Up}}, {MOD, XK_l, focChange, {.dir = Right}}, + {ALT, XK_Tab, nextMonitor, {NULL}}, // Window moving {MOD|SHIFT, XK_h, wMove, {.dir = Left}}, {MOD|SHIFT, XK_j, wMove, {.dir = Down}}, -- cgit v1.2.3