From e801610774ab3d2e5f5921f4bc6b882d970a1938 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Fri, 31 Jan 2020 00:52:02 -0600 Subject: [PATCH] - Increased buffer size for larger json configs and added additional config options for future use --- kintox11/src/kinto.json | 88 +++++++++++++++++++++++++++++++++++++++++ kintox11/src/kintox11.c | 4 +- 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/kintox11/src/kinto.json b/kintox11/src/kinto.json index 0188da6..a5b29b8 100644 --- a/kintox11/src/kinto.json +++ b/kintox11/src/kinto.json @@ -1,16 +1,104 @@ {"config":[{ "name":"gui", "run":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY", + "de":[3], "appnames":[ "" ] }, { "name":"term", "run":"setxkbmap -option", + "de":[2], "appnames":[ "Gnome-terminal","konsole","terminator","sakura","guake","tilda","xterm","eterm" ] }, { "name":"eosterm", "run":"setxkbmap -option", + "de":"", "appnames":[ "io.elementary.terminal" ] + }], + "init": [1], + "defaults":[{ + "name":"Windows", + "active": false, + "description":"Standard Windows 104 Keyboards", + "gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY", + "term":"setxkbmap -option;setxkbmap -option altwin:swap_alt_win" + }, + { + "name":"Mac - hid driver", + "active": false, + "description":"Standard Mac Keyboards with Apple driver", + "gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY", + "term":"setxkbmap -option", + "hack": "echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all" + }, + { + "name":"Mac Only", + "active": true, + "description":"Standard Mac Keyboards", + "gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY", + "term":"setxkbmap -option;setxkbmap -option altwin:swap_alt_win" + }, + { + "name":"Chromebook", + "active": false, + "description":"Standard Chromebook Keyboards", + "gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY", + "term":"setxkbmap -option;setxkbmap -option altwin:swap_alt_win" + }, + { + "name":"Chromebook - Windows", + "active": false, + "description":"Chromebook with Windows 104 Keyboard", + "gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY; setxkbmap -device $usbid -option altwin:ctrl_alt_win", + "term":"setxkbmap -option;setxkbmap -option altwin:swap_alt_win", + "fallbackgui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY" + }, + { + "name":"Chromebook - Mac", + "active": false, + "description":"Chromebook with Mac Keyboard", + "gui":"setxkbmap -option;setxkbmap -option ctrl:swap_lwin_lctl; xkbcomp -w0 -i $internalid -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY", + "term":"setxkbmap -option;setxkbmap -device $internalid -option 'altwin:swap_alt_win'" + }], + "defaultapps":[{ + "name":"term", + "appnames": [ "Gnome-terminal","konsole","terminator","sakura","guake","tilda","xterm","eterm" ] + }, + { + "name":"eosterm", + "appnames": [ "io.elementary.terminal" ] + }], + "de":[{ + "id": 1, + "type": "gnome3", + "active": true, + "name":"gnome-init", + "description":"Gnome - Remove Superkey Overlay keybinding to Activities Overview", + "run":"gsettings set org.gnome.mutter overlay-key ''" + }, + { + "id": 2, + "type": "gnome3", + "active": true, + "name":"gnome-term", + "description":"Gnome - Terminal - Superkey+Space opens Activities Overview", + "run":"gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['Space']\"" + }, + { + "id": 3, + "type": "gnome3", + "active": true, + "name":"gnome-gui", + "description":"Gnome - GUI - Ctrl+Space opens Activities Overview", + "run":"gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['Space']\"" + }, + { + "id": 4, + "type": "kde5", + "active": false, + "name":"kde-init", + "description":"KDE Plasma 5 - Removes Superkey Overlay from the Launcher Menu", + "run":"gsettings set org.gnome.mutter overlay-key '';kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta \"\";qdbus org.kde.KWin /KWin reconfigure" }] } \ No newline at end of file diff --git a/kintox11/src/kintox11.c b/kintox11/src/kintox11.c index 9a44305..955f662 100644 --- a/kintox11/src/kintox11.c +++ b/kintox11/src/kintox11.c @@ -98,7 +98,7 @@ const char * str_window_class(Display* d, Window w, char *prior_app ){ int main(void){ FILE *fp; - char buffer[1024]; + char buffer[10240]; struct json_object *parsed_json, *config, *config_obj, *config_obj_name, *config_obj_run, *config_obj_appnames, *appnames_obj; int arraylen; int appnames_len; @@ -107,7 +107,7 @@ int main(void){ size_t i,n; fp = fopen("kinto.json","r"); - fread(buffer, 1024, 1, fp); + fread(buffer, 10240, 1, fp); fclose(fp); parsed_json = json_tokener_parse(buffer);