Commit Graph

113 Commits

Author SHA1 Message Date
29bc56fc36 fixed memory access out of bound errors 2021-02-09 19:34:23 +01:00
fb130ed809 better errors
- corrected some errors not showing strerror()
- fatal errors are wrapper inside a wrap_error() macro that shows in which
function the error was launched
2021-02-06 16:40:09 +01:00
82b25f1e50 bug fixes
- fixed aliases not being deleted correctly
- added end of file check in parser skip line
2021-01-28 18:27:24 +01:00
1b00896fc7 version 0.5
new features:
- hkd now uses mmap internally for loading config files, this allows for better
	handling of large files and simplifies the code
- using aliases no longer requires '<' in the config file, instead the alias
	name can be used anywhere in the following commands to be replaced
- aliases are now correctly replaced
- some minor fixes in the man page
2021-01-27 13:39:04 +01:00
dfa7976f18 added command aliases 2020-11-25 10:56:38 +01:00
6904aff298 add todo 2020-11-23 21:36:35 +01:00
8edf0d1ce9 bump to 0.4
Changes since last version
Fixes:
- Fixed compile error on arm due to different char size
- Fixed child processes becoming zombies
- Fixed infinite loop on config files bigger than 512B
- Fixed memory allocation bug upon reloading config file
- Fixed crash upon suspending and resuming computer
- Fixed bug where last hotkey would be ignored
- Fixed crash with small parse block sizes

Additions:
- Added -h flag
- Added -d flag
- Added some keys aliases
- Added button events
- Parsed keys are now case-insensitive

Others:
- Better code readability
- Added license in source file
- Keys are now stored in keys.h
- Better errors regarding invalid config files
- Makefile respects system's $CC
2020-10-10 20:11:24 +02:00
45ea29a760 fixed infinite loop
config files bigger than 512B would cause an infinite loop for
a missing else statement, oops.
2020-10-08 19:54:38 +02:00
3bd678d48e case EOF is now checked only on x86 arches
This check causes problems on architectures where char is unsigned, thus
EOF which is a signed int has a value less of the minimum permitted by the type.
To be honest this check could just be avoided alltogether, maybe in the future.
2020-10-04 23:21:03 +02:00
04bfca1932 make respects system compiler setting 2020-10-04 23:13:11 +02:00
d3f5e888e3 parse keys as case-insensitive 2020-09-28 22:47:59 +02:00
79bbbcf8a9 fix memory allocation bug
when receiving SIGUSR1 hkd would try to allocate the new hotkey list in the old
space which could lead to errors
2020-09-22 23:45:46 +02:00
d6b8e129d7 live reload config file with SIGUSR1 2020-09-22 12:43:48 +02:00
8ad875b311 added -h flag 2020-09-22 12:20:44 +02:00
213db3cee5 fixed crash for small block sizes in parsing 2020-09-16 00:11:00 +02:00
5308b31abe fixed bug in parse_config_file
there was a bug where parsing would ignore the very last valid hotkey in the
config file
2020-09-15 20:43:36 +02:00
684127c6fe changed debug build options to include -O0 2020-09-15 20:42:55 +02:00
699ddd057c added the dump option
useful for debugging, if the dump option is set hkd prints the hotkey list
2020-09-15 18:12:50 +02:00
122ba9b44b fix crash when the computer is suspended 2020-09-12 14:38:42 +02:00
9918331491 added license in source file 2020-09-10 16:51:23 +02:00
6bad3614d7 die() is now a function 2020-09-06 15:25:43 +02:00
4a4eaf93e6 code beautify
- removed trailing whitespaces
- moved variables to the top of functions
- changed a couple of paths from const to define
2020-09-06 15:04:16 +02:00
38a72338ed check if hkd is already running before start
use a lock file to determine if another instance of hkd is already running
2020-09-06 14:39:40 +02:00
633604cefa added missing check 2020-08-31 23:50:51 +02:00
0486872d78 better error messages for wrong config 2020-08-31 22:26:10 +02:00
9871f375ed bump to version 0.3
bug fixes, check commits for details
implemented new parser, altough it adds some lines it lowers the comlexity and
it should be faster especially for bigger config files
2020-08-31 17:53:20 +02:00
0507be14b6 testing new parser 2020-08-30 23:08:52 +02:00
5d6ee6dd83 more readable gitignore 2020-08-30 23:07:35 +02:00
6a3e033b68 fixed
skip zero or 1 allocations and uninitialized conditional jump
in hotkey_list_add()

now the whole output of die() is coloured
2020-08-29 20:52:44 +02:00
689e6005ac shitty hack to fix out of bounds with -v 2020-08-28 13:53:44 +02:00
1ba688f975 bump to version 0.2
- better recognition of invalid config files
- general polish of error messages
- hkd follows the rule of silence
- when using -v the correct key names are shown
- commands in config files can be multiline (using \\n)
2020-08-01 14:48:22 +02:00
344887c925 fixed: wrong key names after 'z' when using -v 2020-08-01 12:22:52 +02:00
1b7af99723 fix : parser no longer allows blank lines for keys or command 2020-07-29 22:07:53 +02:00
d110948129 closing : made the program silent
turned off the "error" messages by default and using the -v flag to turn
them back on as they are not useful for normal use, also now those messages
are printed to stdout
2020-07-29 20:37:59 +02:00
e14049d5b6 fixed invalid free() and missing break; 2020-07-29 16:57:53 +02:00
de6db78896 removed unnecessary memmove(s) in parse_config_file() 2020-07-29 12:27:08 +02:00
e1e239430c licensed under the MIT license 2020-07-29 12:04:02 +02:00
904a10cdf8 fix typo 2020-07-28 20:35:24 +02:00
36ea0ccc6d modified readme
fixed typos and updated some info
2020-07-28 20:32:19 +02:00
472daace31 added -c option
-c is used to override the default config files and instead use the speocified
one
2020-07-28 20:19:52 +02:00
5db72c0b43 fix comment bug
comments not at the beginning of the line are no longer ignored
2020-07-28 13:33:12 +02:00
514407015e install, uninstall and version
modified makefile to be abled to install and uninstall, also installing puts
the correct version in the man page.
All credits go to suckless :^)
2020-07-28 13:30:20 +02:00
c011888c5f added man page for hkd 2020-07-28 13:05:02 +02:00
a4fcd4de31 entering version 0.1
the program is finally in a usable status, many things were added in
this commit:
	- config file parsing from tests
	- config multiple config file locations
	- more I can't grasp
anyways have fun.
2020-07-28 01:14:37 +02:00
6613bd0707 modified parser to suit new config format 2020-07-25 17:51:00 +02:00
cc15646a15 changed makefile
Tests now compile with just -Wall in order to allow for placeholder variables.
Also tests are now compiled in c99
2020-07-25 17:43:21 +02:00
67a36f71e3 finally decided the config style
read the template.conf file for examples and the spec.
2020-07-19 16:35:21 +02:00
21e833143c changed key names
key names now don't include the "KEY_" part before the actual name
2020-07-19 16:34:20 +02:00
6a5367ac00 verbose option displays key names instead of values
very crude implementation, works for standard keys but breaks
for media/special keys, good enough for now
2020-07-19 11:54:29 +02:00
ea6f548399 added -v argument
verbose option: now hkd doesn't default to printing pressed keys basically
acting as a keylogger but now requires -v to do so.
2020-07-18 23:42:27 +02:00