Angelo Fallaria
cffd1694d1
style: format config.rs using rust-analyzer
2 years ago
Angelo Fallaria
b47904b3f3
test: add test for command with blank space
2 years ago
Angelo Fallaria
c61e92a3a2
style: add comment in ParseError to explain u32 field
2 years ago
Angelo Fallaria
60c2539413
feat: add public load config function
2 years ago
Angelo Fallaria
d26c4666ee
test: edit tests to accomodate the edited functions
2 years ago
Angelo Fallaria
9b6d67f45e
refactor: make parse_contents accept string, not PathBuf
2 years ago
Angelo Fallaria
0a76516178
test: rewrite basic hotkey tests
2 years ago
Angelo Fallaria
d5a95a26ef
refactor: refactor file loading into own function
2 years ago
Angelo Fallaria
0266ab2718
refactor: rename key_presses field in Hotkey to keysyms
2 years ago
Angelo Fallaria
abe8987d79
refactor: rename Keybind to Hotkey
2 years ago
Angelo Fallaria
17d0f02baa
test: add blank tests to fill in later
2 years ago
Angelo Fallaria
d153526037
test: improve test for nonexistent file
2 years ago
Angelo Fallaria
fd9524eaf5
style: remove some newlines in start of parse_config
2 years ago
Angelo Fallaria
ebd9db0689
fix: remove unneeded PartialEq derive in enum
2 years ago
Angelo Fallaria
7103537e31
fix: return actual line number in error
...
Because arrays, vectors, and list-style structures in Rust are
zero-index, we need to increment the line number returned by errors
by one so that it represents their actual line numbers.
2 years ago
Angelo Fallaria
8918b03f6e
feat: add handling of empty command
2 years ago
Angelo Fallaria
5763be0a7b
style: improve styling and comments of config parse func
2 years ago
Angelo Fallaria
503f174672
feat: add more error situations in the config parser
2 years ago
Angelo Fallaria
c2c1a0285d
feat(config): return error if keybind at last line
2 years ago
Angelo Fallaria
3f5c46cc48
style: remove unecessary TODO: comments
2 years ago
Angelo Fallaria
a444e3eff1
style: compress the evdev keys vector
2 years ago
Angelo Fallaria
2d97b2dea3
feat(config): add all alphanumeric numbers
2 years ago
Angelo Fallaria
1a1ba9ffbd
test(config): add 9 more unit tests
2 years ago
Angelo Fallaria
252ce9f2e4
feat: add basic config parser
...
A basic config parser has been implemented in `config.rs`. It is still
incomplete, but one letter key press bindings in QWERTYUIOP should work
now, along with a command on the next line.
Example `swhkdrc` file that should work:
```
r
alacritty
w
kitty
t
/bin/firefox
```
**TODO:**
- Add more supported key presses (alphabetical, numerical, insert,
home, delete, end, etc)
- Add chained keybindings (`super + g`, `super + 3`)
- Add error handling for parsing the contents of the file
Note: `server.rs` has been modified to add `mod config` at the start of
the file, but it was necessary to do testing for the config parser.
2 years ago
Shinyzenith
54234ac9e8
[refactor] Warn on failure to remove sock file
2 years ago
Shinyzenith
f0d212b9b0
[Refactor] permission_check(), exit on fail.
2 years ago
Shinyzenith
021291c6a3
[refactor] Warn on no perms.
2 years ago
Shinyzenith
5da3789981
[refactor] Remove redundant return statement
2 years ago
Shinyzenith
faecfcf617
[refactor] Refuse to run swhkd as user with input group
2 years ago
Shinyzenith
096b610edc
[update] Remove redundant comments.
2 years ago
Shinyzenith
1e01014a14
[update] Remove physical path logging
2 years ago
Shinyzenith
65e9649f87
[update] Cargo fmt.
2 years ago
Shinyzenith
eab71d680d
[refactor] Remove redundant Result<(), Box<dyn Error>>
2 years ago
Shinyzenith
a9e66360a9
[refactor] Do not hardcode executable path, use std::env::current_exe() instead
2 years ago
Shinyzenith
f77fb6049b
[update] Remove clap from server.rs
2 years ago
Shinyzenith
97b8af219f
[update] log on removal of socket file.
2 years ago
Shinyzenith
ab914f5b9c
[refactor] Add temporary to hotedit the shell command for development testing.
2 years ago
Shinyzenith
5d92de385a
[feature] Implement UNIX domain socket IPC between swhks ( server ) & swhkd ( daemon )
2 years ago
Shinyzenith
c15b5b153e
[refactor] Setup build instructions for client to recieve shell commands.
2 years ago
Shinyzenith
ac6c5d5fc6
[refactor] Remove preceeding "Note:" from root warning.
2 years ago
Shinyzenith
620782f1ba
[refactor] Default to /etc/swhkd/swhkdrc instead of /home/USER/.config/swhkd/swhkdrc.
2 years ago
Shinyzenith
ced2ea3c95
[refactor] flag creation function, xdg checker function, allow swhkd to run as root
2 years ago
Shinyzenith
f2a1e5b862
[refactor] Append valid devices to a vector and check for 0 devices
2 years ago
Shinyzenith
c8dcd0dd0c
[refactor] Replace glob with evdev::enumerate.
2 years ago
Shinyzenith
6ccce2792c
[refactor] concise import
2 years ago
Shinyzenith
824d36a7f9
[refactor] concise format
2 years ago
Shinyzenith
a9d6966ad5
[refactor] Utilize cargo pkg authors
2 years ago
Shinyzenith
df2f110208
[refactor] use Path::new PathBuf instead of pushstr
3 years ago
Shinyzenith
dbad34c65f
[refactor] turn permission checks into a function main.rs
3 years ago
Shinyzenith
fc70c44684
[feature] config file path detection with xdg base directory variables
3 years ago