Skip to content

Commit b08c98f

Browse files
committed
add changes from pr #245 commit: 3cd0d1757d21a4a5dda52a2b0ce88f068d3a801c && docs changes
1 parent 7717d8a commit b08c98f

File tree

10 files changed

+51
-36
lines changed

10 files changed

+51
-36
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Bug report
33
about: swhkd bugs
44
title: ""
55
labels: bug
6-
assignees: angelofallars, Shinyzenith, EdenQwQ
6+
assignees: id3v1669
77
---
88

99
**Version Information:**

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = [
33
"swhkd",
44
"swhks"
55
]
6+
resolver = "2"
67

78
[profile.release]
89
lto = true # Enable Link Time Optimization

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We have packaged `swhkd-git`. `swhkd-bin` has been packaged separately by a user
77
Basic installation and autorun on NixOS
88
```nix
99
# Add inputs to your flake
10-
inputs.swhkd.url = "github:waycrate/swhkd";
10+
inputs.swhkd.url = "github:id3v1669/swhkd";
1111
inputs.swhkd.inputs.nixpkgs.follows = "nixpkgs";
1212
...
1313
# Add package to your configuration
@@ -62,7 +62,7 @@ After that add 'swhks &' to autorun of your desktop enviroment or window manager
6262

6363
# Compiling:
6464

65-
- `git clone https://github.com/waycrate/swhkd;cd swhkd`
65+
- `git clone https://github.com/id3v1669/swhkd;cd swhkd`
6666
- `make setup`
6767
- `make clean`
6868
- `make`

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<p align=center>
2-
<img src="https://git.sr.ht/~shinyzenith/swhkd/blob/main/assets/swhkd.png" alt=SWHKD width=60%>
2+
<img src="https://github.com/id3v1669/id3v1669/assets/swhkd.png" alt=SWHKD width=60%>
33

44
<p align="center">A next-generation hotkey daemon for Wayland/X11 written in <a href="https://www.rust-lang.org/">Rust</a>.</p>
55

66
<p align="center">
7-
<a href="./LICENSE.md"><img src="https://img.shields.io/github/license/waycrate/swhkd?style=flat-square&logo=appveyor"></a>
7+
<a href="./LICENSE.md"><img src="https://img.shields.io/github/license/id3v1669/swhkd?style=flat-square&logo=appveyor"></a>
88
<img src="https://img.shields.io/badge/cargo-v1.2.1-green?style=flat-square&logo=appveyor">
9-
<img src="https://img.shields.io/github/issues/waycrate/swhkd?style=flat-square&logo=appveyor">
10-
<img src="https://img.shields.io/github/forks/waycrate/swhkd?style=flat-square&logo=appveyor">
11-
<img src="https://img.shields.io/github/stars/waycrate/swhkd?style=flat-square&logo=appveyor">
9+
<img src="https://img.shields.io/github/issues/id3v1669/swhkd?style=flat-square&logo=appveyor">
10+
<img src="https://img.shields.io/github/forks/id3v1669/swhkd?style=flat-square&logo=appveyor">
11+
<img src="https://img.shields.io/github/stars/id3v1669/swhkd?style=flat-square&logo=appveyor">
1212
</p>
1313
</p>
1414

@@ -65,10 +65,10 @@ All supported key and modifier names are listed in `man 5 swhkd-keys`.
6565
### To autostart `swhkd` you can do one of two things
6666

6767
1. Add the commands from the ["Running"
68-
section](https://github.com/waycrate/swhkd#running) to your window managers
68+
section](https://github.com/id3v1669/swhkd#running) to your window managers
6969
configuration file.
7070
1. Enable the [service
71-
file](https://github.com/waycrate/swhkd/tree/main/contrib/init) for your
71+
file](https://github.com/id3v1669/swhkd/tree/master/contrib/init) for your
7272
respective init system. Currently, only systemd and OpenRC service files
7373
exist and more will be added soon including Runit.
7474

@@ -92,10 +92,7 @@ So yes, you're safe!
9292

9393
## Contributors
9494

95-
<a href="https://github.com/Shinyzenith/swhkd/graphs/contributors">
96-
<img src="https://contrib.rocks/image?repo=waycrate/swhkd" />
95+
<a href="https://github.com/id3v1669/swhkd/graphs/contributors">
96+
<img src="https://contrib.rocks/image?repo=id3v1669/swhkd" />
9797
</a>
9898

99-
## Supporters:
100-
101-
1. [@CluelessTechnologist](https://github.com/CluelessTechnologist)

contrib/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pkgname="${_pkgname}-git"
77
pkgver=1.2.1.r17.g022466e
88
pkgrel=1
99
arch=("x86_64")
10-
url="https://github.com/waycrate/swhkd"
10+
url="https://github.com/id3v1669/swhkd"
1111
pkgdesc="A display server independent hotkey daemon inspired by sxhkd."
1212
license=("BSD")
1313
depends=("polkit")

docs/swhkd-keys.5.scd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
swhkd(5) "github.com/waycrate/swhkd" "File Formats Manual"
1+
swhkd(5) "github.com/id3v1669/swhkd" "File Formats Manual"
22

33
# NAME
44

@@ -166,8 +166,9 @@ swhkd - Hotkey daemon inspired by sxhkd written in Rust
166166

167167
# AUTHORS
168168

169-
Maintained by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
170-
For more information about development, see <https://github.com/waycrate/swhkd>.
169+
Created by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
170+
Maintained by id3v1669 <id3v1669@gmail.com> as original repo looks unmaintained for now.
171+
For more information about development, see <https://github.com/id3v1669/swhkd>.
171172

172173
# SEE ALSO
173174

docs/swhkd.1.scd

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
swhkd(1) "github.com/shinyzenith/swhkd" "General Commands Manual"
1+
swhkd(1) "github.com/id3v1669/swhkd" "General Commands Manual"
22

33
# NAME
44

@@ -38,9 +38,12 @@ More about the config file syntax in `swhkd(5)`
3838
*-d*, *--debug*
3939
Enable debug mode.
4040

41-
*-D, --device* <DEVICE_NAME>
41+
*-D, --device* <DEVICE_NAMES>
4242
Manually set the keyboard devices to use. Can occur multiple times.
4343

44+
*-I, --ignoredevice* <DEVICE_NAMES>
45+
Manually set the keyboard devices to ignore. Can occur multiple times.
46+
4447
# SIGNALS
4548

4649
- Reload config file: `sudo pkill -HUP swhkd`
@@ -49,8 +52,9 @@ More about the config file syntax in `swhkd(5)`
4952

5053
# AUTHORS
5154

52-
Maintained by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
53-
For more information about development, see <https://github.com/waycrate/swhkd>.
55+
Created by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
56+
Maintained by id3v1669 <id3v1669@gmail.com> as original repo looks unmaintained for now.
57+
For more information about development, see <https://github.com/id3v1669/swhkd>.
5458

5559
# SEE ALSO
5660

docs/swhkd.5.scd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
swhkd(5) "github.com/waycrate/swhkd" "File Formats Manual"
1+
swhkd(5) "github.com/id3v1669/swhkd" "File Formats Manual"
22

33
# NAME
44

@@ -106,8 +106,9 @@ endmode
106106
```
107107
# AUTHORS
108108

109-
Maintained by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
110-
For more information about development, see <https://github.com/waycrate/swhkd>.
109+
Created by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
110+
Maintained by id3v1669 <id3v1669@gmail.com> as original repo looks unmaintained for now.
111+
For more information about development, see <https://github.com/id3v1669/swhkd>.
111112

112113
# SEE ALSO
113114

docs/swhks.1.scd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
swhks(1) "github.com/shinyzenith/swhkd" "General Commands Manual"
1+
swhks(1) "github.com/id3v1669/swhkd" "General Commands Manual"
22

33
# NAME
44

@@ -27,8 +27,9 @@ swhks - Server for swhkd, used to run user level commands over IPC.
2727

2828
# AUTHORS
2929

30-
Maintained by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
31-
For more information about development, see <https://github.com/waycrate/swhks>.
30+
Created by Shinyzenith <aakashsensharma@gmail.com>, EdenQwQ <lsahlm1eden@gmail.com>, and Angelo Fallaria <ba.fallaria@gmail.com>.
31+
Maintained by id3v1669 <id3v1669@gmail.com> as original repo looks unmaintained for now.
32+
For more information about development, see <https://github.com/id3v1669/swhks>.
3233

3334
# SEE ALSO
3435

swhkd/src/daemon.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ struct Args {
6464
/// Take a list of devices from the user
6565
#[arg(short = 'D', long, num_args = 0.., value_delimiter = ' ')]
6666
device: Vec<String>,
67+
68+
/// Take a list of devices to ignore from the user
69+
#[arg(short = 'I', long, num_args = 0.., value_delimiter = ' ')]
70+
ignoredevice: Vec<String>,
6771
}
6872

6973
#[tokio::main]
@@ -118,16 +122,22 @@ async fn main() -> Result<(), Box<dyn Error>> {
118122

119123
let mut modes = load_config();
120124
let mut mode_stack: Vec<usize> = vec![0];
121-
let arg_devices: Vec<String> = args.device;
125+
let arg_add_devices = args.device;
126+
let arg_ignore_devices = args.ignoredevice;
127+
128+
let to_add =
129+
|dev: &Device| arg_add_devices.contains(&dev.name().unwrap_or("[unknown]").to_string());
130+
let to_ignore =
131+
|dev: &Device| arg_ignore_devices.contains(&dev.name().unwrap_or("[unknown]").to_string());
122132

123133
let keyboard_devices: Vec<_> = {
124-
if arg_devices.is_empty() {
134+
if arg_add_devices.is_empty() {
125135
log::trace!("Attempting to find all keyboard file descriptors.");
126-
evdev::enumerate().filter(|(_, dev)| check_device_is_keyboard(dev)).collect()
127-
} else {
128136
evdev::enumerate()
129-
.filter(|(_, dev)| arg_devices.contains(&dev.name().unwrap_or("").to_string()))
137+
.filter(|(_, dev)| !to_ignore(dev) && check_device_is_keyboard(dev))
130138
.collect()
139+
} else {
140+
evdev::enumerate().filter(|(_, dev)| !to_ignore(dev) && to_add(dev)).collect()
131141
}
132142
};
133143

@@ -279,8 +289,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
279289
},
280290
Ok(device) => device
281291
};
282-
let name = device.name().unwrap_or("[unknown]").to_string();
283-
if arg_devices.contains(&name) || check_device_is_keyboard(&device) {
292+
if !to_ignore(&device) && (to_add(&device) || check_device_is_keyboard(&device)) {
293+
let name = device.name().unwrap_or("[unknown]");
284294
log::info!("Device '{}' at '{}' added.", name, node);
285295
let _ = device.grab();
286296
keyboard_states.insert(node.to_string(), KeyboardState::new());

0 commit comments

Comments
 (0)