Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coffebar/hyprland-monitor-attached
Run the user's script when you attach the monitor on Hyprland
https://github.com/coffebar/hyprland-monitor-attached
Last synced: 11 days ago
JSON representation
Run the user's script when you attach the monitor on Hyprland
- Host: GitHub
- URL: https://github.com/coffebar/hyprland-monitor-attached
- Owner: coffebar
- License: mit
- Created: 2023-04-03T19:19:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-15T09:43:24.000Z (8 months ago)
- Last Synced: 2024-03-15T10:50:57.230Z (8 months ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-hyprland - monitor-attached
README
# Hyprland monitor attached
Run the user's script when you attach the monitor. When you detach your laptop from the monitor, and then attach it again, you no longer need to manually move your workspaces to the monitor if you make a simple script like in [example](https://github.com/coffebar/hyprland-monitor-attached/blob/main/added.sh) and setup it up with this program.
## How to use
Install this software and run with a path to the bash script as an argument.
It will listen to Hyprland's `monitoradded` and `monitorremoved` events and run your scripts.
The monitor's ID will be passed to the script as argument `$1`.
Your bash script may do any tasks you want, for example, move workspaces to the attached monitor, set wallpapers, or change bar configuration. See the example script [added.sh](https://github.com/coffebar/hyprland-monitor-attached/blob/main/added.sh) and [wiki](https://wiki.hyprland.org/Configuring/Dispatchers/).
**Note: Don't forget to set execute permission for your scripts:** `chmod u+x added.sh`
## Install **hyprland-monitor-attached** from [AUR](https://aur.archlinux.org/packages/hyprland-monitor-attached)
```bash
# e.g.
yay -Sy && yay -S hyprland-monitor-attached
```and
Add this line to your hyprland.conf
```
exec-once = /usr/bin/hyprland-monitor-attached PATH_TO_ATTACHED_SHCRIPT.sh [PATH_TO_DETACHED_SHCRIPT.sh]
```-----
## Install from cargo crates
```bash
cargo install hyprland-monitor-attached
```Add this line to your hyprland.conf
```
exec-once = ~/.cargo/bin/hyprland-monitor-attached PATH_TO_ATTACHED_SHCRIPT.sh [PATH_TO_DETACHED_SHCRIPT.sh]
```## Install from source
Install from source with **rustup**:
```bash
git clone https://github.com/coffebar/hyprland-monitor-attached.git
cd hyprland-monitor-attachedrustup override set stable
rustup update stablecargo build --release
mkdir -p ~/.local/bin/
cp target/release/hyprland-monitor-attached ~/.local/bin/```
Add this line to your hyprland.conf```
exec-once = ~/.local/bin/hyprland-monitor-attached PATH_TO_ATTACHED_SHCRIPT.sh [PATH_TO_DETACHED_SHCRIPT.sh]
```-----
## Contribution
Bug reports and PR are welcome. Thank you for your interest!
-----
Tested on Hyprland v0.39.