Skip to content

Commit

Permalink
Revert "[chore] Update Man Pages and README.md (#273)"
Browse files Browse the repository at this point in the history
This reverts commit 75bcd8d.
  • Loading branch information
Shinyzenith authored Jan 4, 2025
1 parent 75bcd8d commit f1b9dc3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ After opening `swhkd`, you can control the program through signals:

`swhkd` closely follows `sxhkd` syntax, so most existing `sxhkd` configs should
be functional with `swhkd`.
More information about the sxhkd syntax can be found in the official man pages from the [arch wiki](https://man.archlinux.org/man/sxhkd.1).

The default configuration file is in `~/.config/swhkd/swhkdrc` with a fallback to `etc/swhkd/swhkdrc`.

Expand All @@ -59,16 +58,6 @@ vim-plug with `Plug 'waycrate/swhkd-vim'`.

All supported key and modifier names are listed in `man 5 swhkd-keys`.

## Environment Variables

The environment variables are now sourced using the SWHKS binary, running in the background which are then supplemented
to the command that is to be run, thus emulating the environment variables in the default shell.

The commands are executed via *SHELL -c 'command'*, hence the environment is sourced from the default shell.
If the user wants to use a different set of environment variables, they can set the environment variables
in the default shell or export the environment variables within a logged in instance of their shell before
running the SWHKS binary.

## Autostart

### To autostart `swhkd` you can do one of two things
Expand All @@ -90,7 +79,7 @@ environment variables and sending them to the daemon. The daemon
uses these environment variables while running the shell commands.
The daemon only runs shell commands that have been parsed from the config file and there is no way to
run arbitrary shell commands. The server is responsible for only sending the environment variables to the daemon and nothing else.
This separation of responsibilities ensures security.
This seperation of responsibilities ensures security.

So yes, you're safe!

Expand Down
21 changes: 3 additions & 18 deletions docs/swhkd.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,12 @@ swhkd - Hotkey daemon inspired by sxhkd written in Rust

# CONFIG FILE

- A global config can be defined in *~/.config/swhkd/swhkdrc*, with a
fallback to */etc/swhkd/swhkdrc*. Swhkd attempts to look in your *$XDG_CONFIG_HOME*, failing which it defaults to *~/.config*.
- A local config overrides the global one. Local configs should be placed in the root of the project.
- The config file can also be specified with the *-c* flag.

# ENVIRONMENT

- The environment variables are now sourced using the SWHKS binary, running in the background.
- The environment variables are then supplemented to the command that is to be run, thus emulating the
environment variables in the default shell.
- The commands are executed via *SHELL -c 'command'*, hence the environment is sourced from the default shell.
- If the user wants to use a different set of environment variables, they can set the environment variables
in the default shell or export the environment variables within a logged in instance of their shell before
running the SWHKS binary.
- A global config can be defined in *~/.config/swhkd/swhkdrc*, with a
fallback to */etc/swhkd/swhkdrc*. Swhkd attempts to look in your *$XDG_CONFIG_HOME*, failing which it defaults to *~/.config*.
- A local config overrides the global one. Local configs should be placed in the root of the project.

# SYNTAX

The syntax of the configuration file is identical to sxhkd and builds upon it.
More information about the syntax can be found from the official sxhkd documentation:
https://man.archlinux.org/man/sxhkd.1, however a brief summary of it is provided below.

Each line of the configuration file is interpreted as so:
- If it is empty or starts with #, it is ignored.
- If it starts with a space, it is read as a command.
Expand Down
2 changes: 1 addition & 1 deletion docs/swhks.1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ swhks(1) "github.com/shinyzenith/swhkd" "General Commands Manual"

# NAME

swhks - Server for swhkd, used to source environment variables from the default shell to supply to swhkd.
swhks - Server for swhkd, used to run user level commands over IPC.

# SYNOPSIS

Expand Down

0 comments on commit f1b9dc3

Please sign in to comment.