summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2025-03-06 21:26:04 +1300
committerBossCode45 <human.cyborg42@gmail.com>2025-03-06 21:30:38 +1300
commit74c58cdf74c4921071da93c4cbfaf22f672242a5 (patch)
tree3f53f51df1a6098b0d9600114b06fc6ae957a195
parent63005f5fc81e9b641f07eadb5f07bc7c532d40c7 (diff)
downloadYATwm-74c58cdf74c4921071da93c4cbfaf22f672242a5.tar.gz
YATwm-74c58cdf74c4921071da93c4cbfaf22f672242a5.zip
feat: Added the "S" modifier to the emacs bind mode
You can now use S as a modifier for shift when binding with emacs mode if you're unable to capatilise the key to be bound.
-rw-r--r--YATwm.nix4
-rw-r--r--compile_commands.json132
-rw-r--r--config108
-rw-r--r--nix/hm-module.nix7
-rw-r--r--src/config.cpp2
-rw-r--r--src/keybinds.cpp55
-rw-r--r--src/main.cpp1
7 files changed, 165 insertions, 144 deletions
diff --git a/YATwm.nix b/YATwm.nix
index be7cd2d..088f6eb 100644
--- a/YATwm.nix
+++ b/YATwm.nix
@@ -15,8 +15,8 @@ stdenv.mkDerivation {
src = fetchgit {
url = "https://git.tehbox.org/cgit/boss/YATwm.git/";
- rev = "v0.0.1";
- hash = "sha256-A4Yra/903rOeEbXfFia/A2HRPrFyE1b05mzHWlDImCY=";
+ rev = "0bc070e";
+ hash = "sha256-yQoyXGJE8JrSon/P5uhyN1rRwBH/kz0LCGIly3yNDhg=";
};
installPhase = ''
diff --git a/compile_commands.json b/compile_commands.json
index 3a2baf6..5d777ae 100644
--- a/compile_commands.json
+++ b/compile_commands.json
@@ -1,49 +1,49 @@
[
{
"arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
"-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
"-c",
"-o",
- "build/main.o",
- "src/main.cpp"
+ "build/keybinds.o",
+ "src/keybinds.cpp"
],
"directory": "/home/boss/Documents/Coding/WM/YATwm",
- "file": "/home/boss/Documents/Coding/WM/YATwm/src/main.cpp",
- "output": "/home/boss/Documents/Coding/WM/YATwm/build/main.o"
+ "file": "/home/boss/Documents/Coding/WM/YATwm/src/keybinds.cpp",
+ "output": "/home/boss/Documents/Coding/WM/YATwm/build/keybinds.o"
},
{
"arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
"-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
"-c",
"-o",
- "build/config.o",
- "src/config.cpp"
+ "build/main.o",
+ "src/main.cpp"
],
"directory": "/home/boss/Documents/Coding/WM/YATwm",
- "file": "/home/boss/Documents/Coding/WM/YATwm/src/config.cpp",
- "output": "/home/boss/Documents/Coding/WM/YATwm/build/config.o"
+ "file": "/home/boss/Documents/Coding/WM/YATwm/src/main.cpp",
+ "output": "/home/boss/Documents/Coding/WM/YATwm/build/main.o"
},
{
"arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
"-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
"-c",
"-o",
"build/ewmh.o",
@@ -55,31 +55,13 @@
},
{
"arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
- "-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
- "-c",
- "-o",
- "build/util.o",
- "src/util.cpp"
- ],
- "directory": "/home/boss/Documents/Coding/WM/YATwm",
- "file": "/home/boss/Documents/Coding/WM/YATwm/src/util.cpp",
- "output": "/home/boss/Documents/Coding/WM/YATwm/build/util.o"
- },
- {
- "arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
"-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
"-c",
"-o",
"build/IPC.o",
@@ -91,13 +73,13 @@
},
{
"arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
"-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
"-c",
"-o",
"build/commands.o",
@@ -109,20 +91,38 @@
},
{
"arguments": [
- "/nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++",
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
"-std=c++17",
- "-I/nix/store/drrf5w7pcc5q9h4si9i8vm2hclg0zijg-libnotify-0.8.3-dev/include",
- "-I/nix/store/a45ri2jgzpv6q36va2y6wq471y88hpnl-gdk-pixbuf-2.42.10-dev/include/gdk-pixbuf-2.0",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include",
- "-I/nix/store/s0nl17v1827bl7qyjgkkar90c2a40ykb-glib-2.78.4-dev/include/glib-2.0",
- "-I/nix/store/k1qjs35nw1lbssg1l1xpmh0082hy7wl4-glib-2.78.4/lib/glib-2.0/include",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
"-c",
"-o",
- "build/keybinds.o",
- "src/keybinds.cpp"
+ "build/util.o",
+ "src/util.cpp"
],
"directory": "/home/boss/Documents/Coding/WM/YATwm",
- "file": "/home/boss/Documents/Coding/WM/YATwm/src/keybinds.cpp",
- "output": "/home/boss/Documents/Coding/WM/YATwm/build/keybinds.o"
+ "file": "/home/boss/Documents/Coding/WM/YATwm/src/util.cpp",
+ "output": "/home/boss/Documents/Coding/WM/YATwm/build/util.o"
+ },
+ {
+ "arguments": [
+ "/nix/store/888bkaqdpfpx72dd8bdc69qsqlgbhcvf-gcc-wrapper-13.3.0/bin/g++",
+ "-std=c++17",
+ "-I/nix/store/xq34vhc04n55v53xj9hbn0h0vj2ywcv6-libnotify-0.8.3-dev/include",
+ "-I/nix/store/089kvf479gh1jnapqi296pjn2yvmyplj-gdk-pixbuf-2.42.12-dev/include/gdk-pixbuf-2.0",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include",
+ "-I/nix/store/5dd834gbg319lfmfwgv54mswcq9k4k57-glib-2.82.1-dev/include/glib-2.0",
+ "-I/nix/store/8mmkgqj0r37s2rlxjvpj8dya7k9gcg77-glib-2.82.1/lib/glib-2.0/include",
+ "-c",
+ "-o",
+ "build/config.o",
+ "src/config.cpp"
+ ],
+ "directory": "/home/boss/Documents/Coding/WM/YATwm",
+ "file": "/home/boss/Documents/Coding/WM/YATwm/src/config.cpp",
+ "output": "/home/boss/Documents/Coding/WM/YATwm/build/config.o"
}
]
diff --git a/config b/config
index 07e4bc6..5771451 100644
--- a/config
+++ b/config
@@ -1,54 +1,60 @@
-# This is a comment
+# Home manager generated config:
-# Mainly used for testing
+# Keybinds:
+bindmode emacs
+quitkey s-g
swapmods
+bind "s-0" changeWS 10
+bind "s-1" changeWS 1
+bind "s-2" changeWS 2
+bind "s-3" changeWS 3
+bind "s-4" changeWS 4
+bind "s-5" changeWS 5
+bind "s-6" changeWS 6
+bind "s-7" changeWS 7
+bind "s-8" changeWS 8
+bind "s-9" changeWS 9
+bind "s-E" exit
+bind "s-R" reload
+bind "s-RET" spawn alacritty
+bind "s-S-0" wToWS 10
+bind "s-S-1" wToWS 1
+bind "s-S-2" wToWS 2
+bind "s-S-3" wToWS 3
+bind "s-S-4" wToWS 4
+bind "s-S-5" wToWS 5
+bind "s-S-6" wToWS 6
+bind "s-S-7" wToWS 7
+bind "s-S-8" wToWS 8
+bind "s-S-9" wToWS 9
+bind "s-S-p s" wToWS 11
+bind "s-X" bashSpawn loginctl lock-session && systemctl suspend
+bind "s-d" bashSpawn rofi -i -show drun
+bind "s-f" fullscreen
+bind "s-h" focChange left
+bind "s-j" focChange down
+bind "s-k" focChange up
+bind "s-l" focChange right
+bind "s-p s" changeWS 11
+bind "s-r k" spawn kitty
+bind "s-t" toggle
+bind "s-x" spawn loginctl lock-session
+
+# Workspaces:
+addWorkspace "1: A" 1
+addWorkspace "2: B" 1
+addWorkspace "3: C" 1
+addWorkspace "4: D" 1
+addWorkspace "5: E" 1
+addWorkspace "6: F" 2 1
+addWorkspace "7: G" 2 1
+addWorkspace "8: H" 2 1
+addWorkspace "9: I" 2 1
+addWorkspace "10: J" 2 1
+addWorkspace "S" 1
+
+
+# Gaps:
+gaps 3
+outergaps 3
-quitkey mod+g
-
-bind mod+shift+e exit
-bind mod+Return spawn alacritty
-bind "mod+r k" spawn kitty
-bind mod+c spawn firefox
-bind mod+x spawn loginctl lock-session
-bind mod+shift+x bashSpawn loginctl lock-session && systemctl suspend
-bind mod+d bashSpawn "rofi -i -show drun"
-gaps 10
-outergaps 10
-
-bind mod+shift+r reload
-bind mod+q kill
-
-# Tiling
-bind mod+t toggle
-bind mod+f fullscreen
-
-# Focus
-bind mod+h focChange left
-bind mod+j focChange down
-bind mod+k focChange up
-bind mod+l focChange right
-
-# Workspaces
-addworkspace "1: A" 1
-addworkspace "2: B" 1
-addworkspace "3: C" 1
-addworkspace "4: D" 1
-addworkspace "5: E" 1
-addworkspace "6: F" 2 1
-addworkspace "7: G" 2 1
-addworkspace "8: H" 2 1
-addworkspace "9: I" 2 1
-addworkspace "10: J" 2 1
-
-bind mod+1 changeWS 1
-bind mod+2 changeWS 2
-bind mod+3 changeWS 3
-bind mod+4 changeWS 4
-bind mod+5 changeWS 5
-bind mod+6 changeWS 6
-bind mod+7 changeWS 7
-bind mod+8 changeWS 8
-bind mod+9 changeWS 9
-bind mod+0 changeWS 10
-
-spawnOnce xss-lock --transfer-sleep-lock -- i3lock -et --nofork \ No newline at end of file
diff --git a/nix/hm-module.nix b/nix/hm-module.nix
index c9f914b..0db7fd4 100644
--- a/nix/hm-module.nix
+++ b/nix/hm-module.nix
@@ -116,6 +116,13 @@ List of commands to be executed at startup.
Name for workspace.
'';
};
+# key = mkOption {
+# type = stypes.str;
+# example = "1";
+# description = ''
+# Key that will be used for switching to this monitor. mod+<key> will switch, and mod+shift+<key> will move the currently focused window.
+# '';
+# };
monitorPriorities = mkOption {
type = types.listOf types.int;
default = [1];
diff --git a/src/config.cpp b/src/config.cpp
index 925e6ea..df8a43d 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -57,7 +57,7 @@ Config::Config(CommandsModule& commandsModule)
commandsModule.addCommand("gaps", &Config::gapsCmd, 1, {NUM}, this);
commandsModule.addCommand("outergaps", &Config::outerGapsCmd, 1, {NUM}, this);
commandsModule.addCommand("logfile", &Config::logFileCmd, 1, {STR_REST}, this);
- commandsModule.addCommand("addworkspace", &Config::addWorkspaceCmd, 2, {STR, NUM_ARR_REST}, this);
+ commandsModule.addCommand("addWorkspace", &Config::addWorkspaceCmd, 2, {STR, NUM_ARR_REST}, this);
commandsModule.addCommand("swapmods", &Config::swapSuperAltCmd, 0, {}, this);
}
diff --git a/src/keybinds.cpp b/src/keybinds.cpp
index 235f8c1..1f60a75 100644
--- a/src/keybinds.cpp
+++ b/src/keybinds.cpp
@@ -168,48 +168,55 @@ const Keybind KeybindsModule::emacsBindMode(string bindString)
Keybind bind;
bind.modifiers = 0;
- const std::regex keyRegex("^(?:([CMs])-)?(?:([CMs])-)?(?:([CMs])-)?([^\\s]|(SPC|ESC|RET|))$");
+ //cout << "Adding keybind: '" << bindString << "'" << endl;
+
+ const std::regex keyRegex("^((?:[CMSs]-)*)([^\\s]|(?:SPC|ESC|RET))$");
std::smatch keyMatch;
if(std::regex_match(bindString, keyMatch, keyRegex))
{
- for (int i = 1; i < 3; i++)
+ std::ssub_match modifierMatch = keyMatch[1];
+ for(std::string modifier : split(modifierMatch, '-'))
{
- std::ssub_match modifierMatch = keyMatch[i];
- if(modifierMatch.matched)
+ if(modifier == "s")
+ {
+ //cout << "\tModifier: s" << endl;
+ bind.modifiers |= cfg.swapSuperAlt?Mod1Mask:Mod4Mask;
+ }
+ else if(modifier == "M")
+ {
+ //cout << "\tModifier: M" << endl;
+ bind.modifiers |= cfg.swapSuperAlt?Mod4Mask:Mod1Mask;
+ }
+ else if(modifier == "C")
+ {
+ //cout << "\tModifier: C" << endl;
+ bind.modifiers |= ControlMask;
+ }
+ else if(modifier == "S")
{
- std::string modifier = modifierMatch.str();
- if(modifier == "s")
- {
- bind.modifiers |= Mod4Mask >> 3 * cfg.swapSuperAlt;
- }
- else if(modifier == "M")
- {
- bind.modifiers |= Mod1Mask << 3 * cfg.swapSuperAlt;
- }
- else if(modifier == "C")
- {
- bind.modifiers |= ControlMask;
- }
+ //cout << "\tModifier: S" << endl;
+ bind.modifiers |= ShiftMask;
}
}
}
- KeySym keySym = XStringToKeysym(keyMatch[4].str().c_str());
+ KeySym keySym = XStringToKeysym(keyMatch[2].str().c_str());
+ //cout << "\tKey: " << keyMatch[2].str() << endl;
- if(isUpper(keyMatch[4].str().c_str()) && keySym != NoSymbol)
+ if(isUpper(keyMatch[2].str().c_str()) && keySym != NoSymbol)
{
bind.modifiers |= ShiftMask;
}
if(keySym == NoSymbol)
{
- if(keyMatch[4].str() == "RET")
+ if(keyMatch[2].str() == "RET")
keySym = XK_Return;
- else if(keyMatch[4].str() == "ESC")
+ else if(keyMatch[2].str() == "ESC")
keySym = XK_Escape;
- else if(keyMatch[4].str() == "SPC")
+ else if(keyMatch[2].str() == "SPC")
keySym = XK_space;
- else if(keyMatch[4].str() == "-")
+ else if(keyMatch[2].str() == "-")
keySym = XK_minus;
- else if(keyMatch[4].str() == "+")
+ else if(keyMatch[2].str() == "+")
keySym = XK_plus;
else
throw Err(CFG_ERR_KEYBIND, "Keybind '" + bindString + "' is invalid");
diff --git a/src/main.cpp b/src/main.cpp
index 291151f..45e4eba 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,6 +17,7 @@
#include <iostream>
#include <map>
#include <ostream>
+#include <regex>
#include <string>
#include <sys/poll.h>
#include <sys/select.h>