aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2017-09-23 22:48:42 +0200
committerkoekeishiya <aasvi93@hotmail.com>2017-09-23 22:48:42 +0200
commitffaff1f68d6b8cda37980bfe50a452d5d62c3d30 (patch)
tree3237767a26527aadf2cb735d1d984a2861c3daaf /src
parente13c87bb3d37ce19b8444cdfc0193c0b094350c9 (diff)
downloadskhd-ffaff1f68d6b8cda37980bfe50a452d5d62c3d30.tar.gz
skhd-ffaff1f68d6b8cda37980bfe50a452d5d62c3d30.zip
code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/hotkey.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/hotkey.c b/src/hotkey.c
index 168d24b..5e0190e 100644
--- a/src/hotkey.c
+++ b/src/hotkey.c
@@ -8,26 +8,6 @@
#define internal static
#define local_persist static
-internal bool
-fork_and_exec(char *command)
-{
- local_persist char arg[] = "-c";
- local_persist char *shell = NULL;
- if(!shell) {
- char *env_shell = getenv("SHELL");
- shell = env_shell ? env_shell : "/bin/bash";
- }
-
- int cpid = fork();
- if(cpid == 0) {
- char *exec[] = { shell, arg, command, NULL};
- int status_code = execvp(exec[0], exec);
- exit(status_code);
- }
-
- return true;
-}
-
#define LRMOD_ALT 0
#define LRMOD_CMD 6
#define LRMOD_CTRL 9
@@ -85,6 +65,26 @@ unsigned long hash_hotkey(struct hotkey *a)
return a->key;
}
+internal bool
+fork_and_exec(char *command)
+{
+ local_persist char arg[] = "-c";
+ local_persist char *shell = NULL;
+ if(!shell) {
+ char *env_shell = getenv("SHELL");
+ shell = env_shell ? env_shell : "/bin/bash";
+ }
+
+ int cpid = fork();
+ if(cpid == 0) {
+ char *exec[] = { shell, arg, command, NULL};
+ int status_code = execvp(exec[0], exec);
+ exit(status_code);
+ }
+
+ return true;
+}
+
bool find_and_exec_hotkey(struct hotkey *eventkey, struct table *hotkey_map)
{
bool result = false;