From 8570a04356f4198666462db9c32907628a8e181f Mon Sep 17 00:00:00 2001 From: Cam Date: Thu, 23 Mar 2023 06:07:47 -0400 Subject: [PATCH 1/3] Add files via upload --- README.md | 7 --- install.sh | 38 +++++------------ keyMap.txt | 22 ++++++---- src/naga.service | 9 ++-- src/nagaKillroot.sh | 34 ++++++--------- src/nagaX11.cpp | 101 +++++++++++++++----------------------------- 6 files changed, 76 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index f7acd5a..c11e43a 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,6 @@ Now with app auto profiles ! Or run sh install.sh from the directory to install. -## UBUNTU FLAVORS : -Please add the corresponding repos for xdotool and his dependency : - https://packages.ubuntu.com/search?keywords=xdotool - https://packages.ubuntu.com/search?keywords=libxdo3&searchon=names - (Click on your version and add the line to /etc/apt/sources.list, then you can run the script.) - You can also install libnotify-bin to get notifications if they are not there : `sudo apt install libnotify-bin` - ## COMMANDS : diff --git a/install.sh b/install.sh index 31adb1f..0708339 100755 --- a/install.sh +++ b/install.sh @@ -59,47 +59,31 @@ sudo chmod 755 /usr/local/bin/Naga_Linux/nagaKillroot.sh sudo cp -f ./src/nagaUninstall.sh /usr/local/bin/Naga_Linux/ sudo chmod 755 /usr/local/bin/Naga_Linux/nagaUninstall.sh -_dir="/home/razerInput/.naga" -sudo mkdir -p "$_dir" +_dir="/home/$USER/.naga" +mkdir -p "$_dir" sudo cp -r -n -v "keyMap.txt" "$_dir" -sudo chown -R "root:root" "$_dir" -printf "%s\n%s" "$USER" "$(id -u "$USER")" | sudo tee /home/razerInput/.naga/user.txt >/dev/null +sudo chown -R "root:root" "$_dir"/keyMap.txt sudo groupadd -f razerInputGroup -sudo bash -c "useradd razerInput > /dev/null 2>&1" -sudo usermod -a -G razerInputGroup razerInput >/dev/null -xhost +SI:localuser:razerInput -sudo setfacl -R -m g:razerInputGroup:rwx ~ >/dev/null -sudo setfacl -d -m g:razerInputGroup:rwx ~ >/dev/null -sudo setfacl -R -m g:razerInputGroup:rwx /run/user/$UID >/dev/null -sudo setfacl -d -m g:razerInputGroup:rwx /run/user/$UID >/dev/null +printf 'KERNEL=="event[0-9]*",SUBSYSTEM=="input",GROUP="razerInputGroup",MODE="640"' | sudo tee /etc/udev/rules.d/80-naga.rules > /dev/null -env | sudo tee /home/razerInput/.naga/envSetup >/dev/null - -echo 'KERNEL=="event[0-9]*",SUBSYSTEM=="input",GROUP="razerInputGroup",MODE="640"' >/tmp/80-naga.rules +sudo cp -f src/naga.service /etc/systemd/system/ -sudo mv /tmp/80-naga.rules /etc/udev/rules.d/80-naga.rules +env | tee ~/.naga/envSetup >/dev/null +grep -qF 'env | tee ~/.naga/envSetup' ~/.profile || printf '\n%s\n' 'env | tee ~/.naga/envSetup > /dev/null' | tee -a ~/.profile > /dev/null +grep -qF 'sudo systemctl start naga' ~/.profile || printf '\n%s\n' 'sudo systemctl start naga > /dev/null' | tee -a ~/.profile > /dev/null -sudo cp -f src/naga.service /etc/systemd/system/ -sudo mkdir -p /etc/systemd/system/naga.service.d -sudo cp -f src/naga.conf /etc/systemd/system/naga.service.d/ -printf "%s\n" "$DISPLAY" | sudo tee -a /etc/systemd/system/naga.service.d/naga.conf >/dev/null -printf "WorkingDirectory=/home/%s/\n" "$USER" | sudo tee -a /etc/systemd/system/naga.service.d/naga.conf >/dev/null +printf "Environment=DISPLAY=%s\n" "$DISPLAY" | sudo tee -a /etc/systemd/system/naga.service >/dev/null +printf "User=%s\n" "$USER" | sudo tee -a /etc/systemd/system/naga.service >/dev/null +printf "EnvironmentFile=/home/%s/.naga/envSetup\n" "$USER" | sudo tee -a /etc/systemd/system/naga.service >/dev/null sudo udevadm control --reload-rules && sudo udevadm trigger sleep 0.5 -sudo cat /etc/sudoers | grep -qxF "razerInput ALL=($USER) NOPASSWD:ALL" || printf "\nrazerInput ALL=(%s) NOPASSWD:ALL\n" "$USER" | sudo EDITOR='tee -a' visudo >/dev/null sudo cat /etc/sudoers | grep -qxF "$USER ALL=(ALL) NOPASSWD:/bin/systemctl start naga" || printf "\n%s ALL=(ALL) NOPASSWD:/bin/systemctl start naga\n" "$USER" | sudo EDITOR='tee -a' visudo >/dev/null -sudo cat /etc/sudoers | grep -qxF "$USER ALL=(ALL) NOPASSWD:/usr/bin/tee /home/razerInput/.naga/envSetup" || printf "\n%s ALL=(ALL) NOPASSWD:/usr/bin/tee /home/razerInput/.naga/envSetup\n" "$USER" | sudo EDITOR='tee -a' visudo >/dev/null - -grep -qF 'xhost +SI:localuser:razerInput' ~/.profile || printf '\n%s\n' 'xhost +SI:localuser:razerInput > /dev/null' | tee -a ~/.profile -grep -qF 'sudo systemctl start naga' ~/.profile || printf '\n%s\n' 'sudo systemctl start naga > /dev/null' | tee -a ~/.profile -grep -qF 'env | sudo tee /home/razerInput/.naga/envSetup' ~/.profile || printf '\n%s\n' 'env | sudo tee /home/razerInput/.naga/envSetup > /dev/null' | tee -a ~/.profile -sudo chown -R razerInput:razerInputGroup /home/razerInput sudo systemctl enable naga sudo systemctl start naga diff --git a/keyMap.txt b/keyMap.txt index 9e493bc..285f9a2 100644 --- a/keyMap.txt +++ b/keyMap.txt @@ -1,9 +1,9 @@ config=defaultConfig 1 - keyClick=XF86AudioMute -2 - run=firefox +2 - specialKey=; 3 - string=hello@hotmail.com 4 - run=if [ $(pgrep -c spotify) -eq 0 ]; then spotify; fi -5 - run=x-terminal-emulator +5 - run=gnome-terminal 6 - specialPressOnPress=È 6 - specialReleaseOnRelease=È 7 - key=XF86AudioLowerVolume @@ -19,23 +19,29 @@ configEnd config=defaultConfig2 1 - key=XF86AudioMute -3 - run=x-terminal-emulator +3 - run=gnome-terminal 3 - sleep=1000 -3 - run=x-terminal-emulator +3 - run=gnome-terminal +4 - run=gnome-terminal +4 - sleep=1000 +4 - run=gnome-terminal +5 - runRelease=gnome-terminal +5 - sleeprelease=1000 +5 - runRelease=gnome-terminal 7 - key=XF86AudioLowerVolume 8 - key=XF86AudioPlay 9 - key=XF86AudioRaiseVolume 10 - keyClick=XF86AudioPrev 11 - chmap=defaultConfig 12 - keyClick=XF86AudioNext -13 - run=x-terminal-emulator -14 - run=x-terminal-emulator +13 - run=gnome-terminal +14 - run=gnome-terminal configEnd configWindow=Spotify 1 - key=XF86AudioMute 3 - string=spotify@music.com -5 - runRelease=x-terminal-emulator +5 - runRelease=gnome-terminal 7 - key=XF86AudioLowerVolume 8 - key=XF86AudioPlay 9 - key=XF86AudioRaiseVolume @@ -50,7 +56,7 @@ configWindow=Gnome-terminal 1 - key=XF86AudioMute 3 - string=gnome@terminal.com 4 - run=if [ $(pgrep -c spotify) -eq 0 ]; then spotify; fi -5 - run=x-terminal-emulator +5 - run=gnome-terminal 6 - specialPressOnPress=È 6 - specialReleaseOnRelease=È 7 - key=XF86AudioLowerVolume diff --git a/src/naga.service b/src/naga.service index d9ff3a5..61b2a11 100644 --- a/src/naga.service +++ b/src/naga.service @@ -2,12 +2,11 @@ Description=Custom key bindings for the side panel of razer mouses. After=default.target +[Install] +WantedBy=default.target + [Service] Type=simple -EnvironmentFile=/home/razerInput/.naga/envSetup ExecStart=/usr/local/bin/naga serviceHelper TimeoutStartSec=20 -User=razerInput - -[Install] -WantedBy=default.target \ No newline at end of file +Group=razerInputGroup diff --git a/src/nagaKillroot.sh b/src/nagaKillroot.sh index 2811cc3..82250ef 100644 --- a/src/nagaKillroot.sh +++ b/src/nagaKillroot.sh @@ -1,36 +1,28 @@ #!/bin/sh # shellcheck disable=SC2046 # shellcheck disable=SC2009 - if [ "$(id -u)" -ne 0 ];then if [ $# -eq 0 ]; then - kill $(pgrep -f "naga start" -G "$USER") > /dev/null 2>&1 - if [ "$(pgrep -f "naga start" -G 0 -c)" -ne 0 ]; then - pkexec --user root kill $(pgrep -f "naga start" -G 0) + kill $(pgrep -f "naga serviceHelper") > /dev/null 2>&1 + if [ "$(pgrep -f "naga serviceHelper" -G 0 -c)" -ne 0 ]; then + pkexec --user root kill $(pgrep -f "naga serviceHelper" -G 0) fi - if [ "$(pgrep -f "naga service" -c)" -ne 0 ]; then - pkexec --user root systemctl stop naga - fi - else - kill $(pgrep -f "naga start" -G "$USER" | grep -v "$1") > /dev/null 2>&1 - if [ "$(pgrep -f "naga start" -G 0 | grep -v "$1" -c)" -ne 0 ]; then - pkexec --user root kill $(pgrep -f "naga start" -G 0 | grep -v "$1") - fi - if [ "$(pgrep -f "naga service" | grep -v "$1" -c)" -ne 0 ]; then - pkexec --user root systemctl stop naga + else + kill $(pgrep -f "naga serviceHelper" | grep -v "$1") > /dev/null 2>&1 + if [ "$(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1" -c)" -ne 0 ]; then + pkexec --user root kill $(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1") fi fi else - systemctl stop naga if [ $# -eq 0 ]; then - kill $(ps aux | grep "naga start" | grep -v root | grep -v grep | awk '{print $2}') > /dev/null 2>&1 - if [ "$(pgrep -f "naga start" -G 0 -c)" -ne 0 ]; then - kill $(pgrep -f "naga start" -G 0) + kill $(ps aux | grep "naga serviceHelper" | grep -v root | grep -v grep | awk '{print $2}') > /dev/null 2>&1 + if [ "$(pgrep -f "naga serviceHelper" -G 0 -c)" -ne 0 ]; then + kill $(pgrep -f "naga serviceHelper" -G 0) fi else - kill $(ps aux | grep "naga start" | grep -v root | grep -v "$1" | grep -v grep | awk '{print $2}') > /dev/null 2>&1 - if [ "$(pgrep -f "naga start" -G 0 | grep -v "$1" -c)" -ne 0 ]; then - kill $(pgrep -f "naga start" -G 0 | grep -v "$1") + kill $(ps aux | grep "naga serviceHelper" | grep -v root | grep -v "$1" | grep -v grep | awk '{print $2}') > /dev/null 2>&1 + if [ "$(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1" -c)" -ne 0 ]; then + kill $(pgrep -f "naga serviceHelper" -G 0 | grep -v "$1") fi fi fi diff --git a/src/nagaX11.cpp b/src/nagaX11.cpp index b3bf3fc..492c2da 100644 --- a/src/nagaX11.cpp +++ b/src/nagaX11.cpp @@ -15,47 +15,15 @@ #include #include #include -#include #include using namespace std; typedef pair CharAndChar; static mutex fakeKeyFollowUpsMutex, configSwitcherMutex; static map *const fakeKeyFollowUps = new map(); +const string conf_file = string(getenv("HOME")) + "/.naga/keyMap.txt"; static int fakeKeyFollowCount = 0; map notifySendMap; -string userString = "", userID = ""; -char **envp; - -const string *applyUserString(string c) -{ - return new string("sudo -EHu " + userString + " bash -c '" + c + "'"); -} - -const void fetchUserString() -{ - ifstream file("/home/razerInput/.naga/user.txt"); - string line; - if (getline(file, line)) - { - line.erase(std::remove_if(line.begin(), line.end(), [](unsigned char c) - { return std::isspace(c); }), - line.end()); // nuke all whitespaces - userString = line; - if (getline(file, line)) - { - line.erase(std::remove_if(line.begin(), line.end(), [](unsigned char c) - { return std::isspace(c); }), - line.end()); // nuke all whitespaces - userID = line; - } - else - exit(1); - } - else - exit(1); - file.close(); -} class configKey { @@ -91,8 +59,6 @@ class MacroEvent } }; -typedef vector MacroEventVector; - class configSwitchScheduler { private: @@ -148,22 +114,25 @@ static configSwitchScheduler *const configSwitcher = new configSwitchScheduler() class NagaDaemon { private: - const string conf_file = "/home/razerInput/.naga/keyMap.txt"; - map configKeysMap; - map>> macroEventsKeyMaps; + map>>> macroEventsKeyMaps; string currentConfigName; struct input_event ev1[64]; - const int size = sizeof(struct input_event) * 64; + const int size = sizeof(ev1); vector devices; bool areSideBtnEnabled = true, areExtraBtnEnabled = true; - map> *currentConfigPtr; + map>> *currentConfigPtr; + + const string *applyBashCommand(string c) + { + return new string("bash -c '" + c + "'"); + } void initConf() { string commandContent; - map> *iteratedConfig; + map>> *iteratedConfig; bool isIteratingConfig = false; ifstream in(conf_file.c_str(), ios::in); @@ -209,19 +178,19 @@ class NagaDaemon exit(1); } - map *iteratedButtonConfig = &(*iteratedConfig)[buttonNumberInt]; + map> *iteratedButtonConfig = &(*iteratedConfig)[buttonNumberInt]; if (configKeysMap.contains(commandType)) { // filter out bad types + + if (commandType == "run" || commandType == "run2") // This makes you able to run complete bash inside run + commandContent = *applyBashCommand(commandContent); if (!configKeysMap[commandType]->Prefix()->empty()) commandContent = *configKeysMap[commandType]->Prefix() + commandContent; if (!configKeysMap[commandType]->Suffix()->empty()) commandContent = commandContent + *configKeysMap[commandType]->Suffix(); - if (configKeysMap[commandType]->InternalFunction() == executeNow) - (*iteratedButtonConfig)[configKeysMap[commandType]->IsOnKeyPressed()].emplace_back(new MacroEvent(configKeysMap[commandType], applyUserString(commandContent))); - else - (*iteratedButtonConfig)[configKeysMap[commandType]->IsOnKeyPressed()].emplace_back(new MacroEvent(configKeysMap[commandType], &commandContent)); + (*iteratedButtonConfig)[configKeysMap[commandType]->IsOnKeyPressed()].emplace_back(new MacroEvent(configKeysMap[commandType], &commandContent)); // Encode and store mapping v3 } else if (commandType == "key") @@ -232,8 +201,8 @@ class NagaDaemon } string *commandContent2 = new string(*configKeysMap["keyreleaseonrelease"]->Prefix() + commandContent + *configKeysMap["keyreleaseonrelease"]->Suffix()); commandContent = *configKeysMap["keypressonpress"]->Prefix() + commandContent + *configKeysMap["keypressonpress"]->Suffix(); - (*iteratedButtonConfig)[true].emplace_back(new MacroEvent(configKeysMap["keypressonpress"], applyUserString(commandContent))); - (*iteratedButtonConfig)[false].emplace_back(new MacroEvent(configKeysMap["keyreleaseonrelease"], applyUserString(*commandContent2))); + (*iteratedButtonConfig)[true].emplace_back(new MacroEvent(configKeysMap["keypressonpress"], &commandContent)); + (*iteratedButtonConfig)[false].emplace_back(new MacroEvent(configKeysMap["keyreleaseonrelease"], commandContent2)); } else if (commandType == "specialkey") { @@ -252,14 +221,14 @@ class NagaDaemon commandContent.erase(0, 13); iteratedConfig = ¯oEventsKeyMaps[commandContent]; configSwitcher->configWindowsNamesVector.emplace_back(new string(commandContent)); - notifySendMap.emplace(commandContent, new string(*applyUserString("notify-send \"Profile : " + commandContent + "\""))); + notifySendMap.emplace(commandContent, new string("notify-send \"Profile : " + commandContent + "\"")); } else if (commandContent.substr(0, 7) == "config=") { isIteratingConfig = true; commandContent.erase(0, 7); iteratedConfig = ¯oEventsKeyMaps[commandContent]; - notifySendMap.emplace(commandContent, new string(*applyUserString("notify-send \"Profile : " + commandContent + "\""))); + notifySendMap.emplace(commandContent, new string("notify-send \"Profile : " + commandContent + "\"")); } } in.close(); @@ -343,7 +312,8 @@ class NagaDaemon if (areSideBtnEnabled && FD_ISSET(side_btn_fd, &readset)) // Side buttons { - if (ev1[0].value == ' '){ + if (ev1[0].value == ' ') + { writeStringNow(new string("A SPACE DETECTED")); } @@ -445,7 +415,7 @@ class NagaDaemon } // end of configKeys functions - static void runActions(MacroEventVector *const relativeMacroEventsPointer) + static void runActions(vector *const relativeMacroEventsPointer) { for (MacroEvent *const macroEventPointer : *relativeMacroEventsPointer) { // run all the events at Key @@ -475,7 +445,7 @@ class NagaDaemon devices.emplace_back("/dev/input/by-id/usb-Razer_Razer_Naga_Left_Handed_Edition-if02-event-kbd", "/dev/input/by-id/usb-Razer_Razer_Naga_Left_Handed_Edition-event-mouse"); // NAGA Left Handed devices.emplace_back("/dev/input/by-id/usb-Razer_Razer_Naga_Pro_000000000000-if02-event-kbd", "/dev/input/by-id/usb-Razer_Razer_Naga_Pro_000000000000-event-mouse"); // NAGA PRO WIRELESS devices.emplace_back("/dev/input/by-id/usb-1532_Razer_Naga_Pro_000000000000-if02-event-kbd", "/dev/input/by-id/usb-1532_Razer_Naga_Pro_000000000000-event-mouse"); // NAGA PRO - // devices.emplace_back("/dev/input/by-id/YOUR_DEVICE_FILE", "/dev/input/by-id/YOUR_DEVICE_FILE#2"); // DUMMY EXAMPLE ~ ONE CAN BE EMPTY LIKE SUCH : "" (for devices with no extra buttons) + // devices.emplace_back("/dev/input/by-id/YOUR_DEVICE_FILE", "/dev/input/by-id/YOUR_DEVICE_FILE#2"); // DUMMY EXAMPLE, ONE CAN BE EMPTY LIKE SUCH : "" (for devices with no extra buttons) for (CharAndChar &device : devices) { // Setup check @@ -505,7 +475,6 @@ class NagaDaemon } // modulable options list to manage internals inside runActions method arg1:COMMAND, arg2:onKeyPressed?, arg3:function to send prefix+config content. - fetchUserString(); #define ONKEYPRESSED true #define ONKEYRELEASED false @@ -515,23 +484,23 @@ class NagaDaemon emplaceConfigKey("sleep", ONKEYPRESSED, sleepNow); emplaceConfigKey("sleeprelease", ONKEYRELEASED, sleepNow); - emplaceConfigKey("run", ONKEYPRESSED, executeNow, "", "&"); + emplaceConfigKey("run", ONKEYPRESSED, executeNow, "setsid ", "&"); emplaceConfigKey("run2", ONKEYPRESSED, executeNow); - emplaceConfigKey("runrelease", ONKEYRELEASED, executeNow, "", "&"); + emplaceConfigKey("runrelease", ONKEYRELEASED, executeNow, "setsid ", "&"); emplaceConfigKey("runrelease2", ONKEYRELEASED, executeNow); - emplaceConfigKey("launch", ONKEYRELEASED, executeNow, "gtk-launch ", "&"); + emplaceConfigKey("launch", ONKEYRELEASED, executeNow, "setsid gtk-launch ", "&"); emplaceConfigKey("launch2", ONKEYRELEASED, executeNow, "gtk-launch "); - emplaceConfigKey("keypressonpress", ONKEYPRESSED, executeNow, "xdotool keydown --window getactivewindow ", "&"); - emplaceConfigKey("keypressonrelease", ONKEYRELEASED, executeNow, "xdotool keydown --window getactivewindow ", "&"); + emplaceConfigKey("keypressonpress", ONKEYPRESSED, executeNow, "setsid xdotool keydown --window getactivewindow ", "&"); + emplaceConfigKey("keypressonrelease", ONKEYRELEASED, executeNow, "setsid xdotool keydown --window getactivewindow ", "&"); - emplaceConfigKey("keyreleaseonpress", ONKEYPRESSED, executeNow, "xdotool keyup --window getactivewindow ", "&"); - emplaceConfigKey("keyreleaseonrelease", ONKEYRELEASED, executeNow, "xdotool keyup --window getactivewindow ", "&"); + emplaceConfigKey("keyreleaseonpress", ONKEYPRESSED, executeNow, "setsid xdotool keyup --window getactivewindow ", "&"); + emplaceConfigKey("keyreleaseonrelease", ONKEYRELEASED, executeNow, "setsid xdotool keyup --window getactivewindow ", "&"); - emplaceConfigKey("keyclick", ONKEYPRESSED, executeNow, "xdotool key --window getactivewindow ", "&"); - emplaceConfigKey("keyclickrelease", ONKEYRELEASED, executeNow, "xdotool key --window getactivewindow ", "&"); + emplaceConfigKey("keyclick", ONKEYPRESSED, executeNow, "setsid xdotool key --window getactivewindow ", "&"); + emplaceConfigKey("keyclickrelease", ONKEYRELEASED, executeNow, "setsid xdotool key --window getactivewindow ", "&"); emplaceConfigKey("string", ONKEYPRESSED, writeStringNow); emplaceConfigKey("stringrelease", ONKEYRELEASED, writeStringNow); @@ -558,13 +527,12 @@ void stopD() }; // arguments manage -int main(const int argc, const char *const argv[], char **envpI) +int main(const int argc, const char *const argv[]) { if (argc > 1) { if (strstr(argv[1], "serviceHelper") != NULL) { - envp = envpI; (void)!(system("/usr/local/bin/Naga_Linux/nagaXinputStart.sh")); if (argc > 2) NagaDaemon(string(argv[2]).c_str()); @@ -602,7 +570,6 @@ int main(const int argc, const char *const argv[], char **envpI) clog << "Starting naga debug, logs :" << endl; usleep(100000); (void)!(system("/usr/local/bin/Naga_Linux/nagaXinputStart.sh")); - envp = envpI; NagaDaemon(); } else @@ -622,7 +589,7 @@ int main(const int argc, const char *const argv[], char **envpI) } else if (strstr(argv[1], "edit") != NULL) { - (void)!(system("sudo bash -c \"nano /home/razerInput/.naga/keyMap.txt && systemctl restart naga\"")); + (void)!(system(("sudo bash -c \"nano " + conf_file + " && systemctl restart naga\"").c_str())); } else if (strstr(argv[1], "uninstall") != NULL) { From 3f61f81c54c2cdc87c0204e8ddfd805557189c5c Mon Sep 17 00:00:00 2001 From: Cam Date: Thu, 23 Mar 2023 06:08:03 -0400 Subject: [PATCH 2/3] Delete naga.conf --- src/naga.conf | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 src/naga.conf diff --git a/src/naga.conf b/src/naga.conf deleted file mode 100644 index 5f0efc7..0000000 --- a/src/naga.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Environment=DISPLAY= \ No newline at end of file From 2805a34e1dc2d5e635dd1489d6c1ebe8d5597d49 Mon Sep 17 00:00:00 2001 From: Cam Date: Thu, 23 Mar 2023 06:10:29 -0400 Subject: [PATCH 3/3] Add files via upload --- README.md | 7 +++++++ keyMap.txt | 22 ++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c11e43a..f7acd5a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,13 @@ Now with app auto profiles ! Or run sh install.sh from the directory to install. +## UBUNTU FLAVORS : +Please add the corresponding repos for xdotool and his dependency : + https://packages.ubuntu.com/search?keywords=xdotool + https://packages.ubuntu.com/search?keywords=libxdo3&searchon=names + (Click on your version and add the line to /etc/apt/sources.list, then you can run the script.) + You can also install libnotify-bin to get notifications if they are not there : `sudo apt install libnotify-bin` + ## COMMANDS : diff --git a/keyMap.txt b/keyMap.txt index 285f9a2..9e493bc 100644 --- a/keyMap.txt +++ b/keyMap.txt @@ -1,9 +1,9 @@ config=defaultConfig 1 - keyClick=XF86AudioMute -2 - specialKey=; +2 - run=firefox 3 - string=hello@hotmail.com 4 - run=if [ $(pgrep -c spotify) -eq 0 ]; then spotify; fi -5 - run=gnome-terminal +5 - run=x-terminal-emulator 6 - specialPressOnPress=È 6 - specialReleaseOnRelease=È 7 - key=XF86AudioLowerVolume @@ -19,29 +19,23 @@ configEnd config=defaultConfig2 1 - key=XF86AudioMute -3 - run=gnome-terminal +3 - run=x-terminal-emulator 3 - sleep=1000 -3 - run=gnome-terminal -4 - run=gnome-terminal -4 - sleep=1000 -4 - run=gnome-terminal -5 - runRelease=gnome-terminal -5 - sleeprelease=1000 -5 - runRelease=gnome-terminal +3 - run=x-terminal-emulator 7 - key=XF86AudioLowerVolume 8 - key=XF86AudioPlay 9 - key=XF86AudioRaiseVolume 10 - keyClick=XF86AudioPrev 11 - chmap=defaultConfig 12 - keyClick=XF86AudioNext -13 - run=gnome-terminal -14 - run=gnome-terminal +13 - run=x-terminal-emulator +14 - run=x-terminal-emulator configEnd configWindow=Spotify 1 - key=XF86AudioMute 3 - string=spotify@music.com -5 - runRelease=gnome-terminal +5 - runRelease=x-terminal-emulator 7 - key=XF86AudioLowerVolume 8 - key=XF86AudioPlay 9 - key=XF86AudioRaiseVolume @@ -56,7 +50,7 @@ configWindow=Gnome-terminal 1 - key=XF86AudioMute 3 - string=gnome@terminal.com 4 - run=if [ $(pgrep -c spotify) -eq 0 ]; then spotify; fi -5 - run=gnome-terminal +5 - run=x-terminal-emulator 6 - specialPressOnPress=È 6 - specialReleaseOnRelease=È 7 - key=XF86AudioLowerVolume