Crates.io | hyprland-monitor-attached |
lib.rs | hyprland-monitor-attached |
version | 0.1.6 |
source | src |
created_at | 2023-04-03 19:33:40.310954 |
updated_at | 2024-04-29 12:35:10.097467 |
description | Listen monAdd event from the Hyprland wayland compositor |
homepage | |
repository | https://github.com/coffebar/hyprland-monitor-attached |
max_upload_size | |
id | 829412 |
size | 17,081 |
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 and setup it up with this program.
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 and wiki.
Note: Don't forget to set execute permission for your scripts: chmod u+x added.sh
# 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]
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 with rustup:
git clone https://github.com/coffebar/hyprland-monitor-attached.git
cd hyprland-monitor-attached
rustup override set stable
rustup update stable
cargo 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]
Bug reports and PR are welcome. Thank you for your interest!
Tested on Hyprland v0.39.