Skip to content

Commit

Permalink
feat(whkd): add whkdrc check + exit early if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Feb 15, 2023
1 parent c69178c commit 1ee7cc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "whkd"
version = "0.1.0"
version = "0.1.1"
authors = ["Jade Iqbal <[email protected]>"]
description = "A simple hotkey daemon for Windows"
categories = ["hotkey-daemon", "windows"]
Expand Down
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ impl TryFrom<&HotkeyBinding> for HkmData {
fn main() -> Result<()> {
color_eyre::install()?;

let mut whkdrc_check = dirs::home_dir().expect("no home directory found");
whkdrc_check.push(".config");
whkdrc_check.push("whkdrc");

if !whkdrc_check.exists() {
println!("No whkdrc file detected. Please place a configuration file at ~/.config/whkdrc and try again.");
return Ok(());
}

let shell_binary = WHKDRC.shell.to_string();

match WHKDRC.shell {
Expand Down

0 comments on commit 1ee7cc1

Please sign in to comment.