Exhaustive list of SPDX (Software Package Data Exchange) licenses: https://spdx.org/licenses/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function convertMS(ms) { | |
| var d, h, m, s; | |
| s = Math.floor(ms / 1000); | |
| m = Math.floor(s / 60); | |
| s = s % 60; | |
| h = Math.floor(m / 60); | |
| m = m % 60; | |
| d = Math.floor(h / 24); | |
| h = h % 24; | |
| return { d: d, h: h, m: m, s: s }; |
A small setup for Hyprland to disable a monitor (e.g. the laptop buildin screen) using hyprctl when a second screen is connected, and to re-enable the screen when all external displays have been disconnected.
- Create the file
switcher.shin your preferred directory (e.g./home/yourusername/scripts/). - Create the file
hypr-display-switcher.servicein/etc/systemd/user/. - Create the file
hyprland-display-switcher.rulesin/etc/udev/rules.d/. - (optional) Make sure that on every login the environment value
HYPR_BUILDIN_MONis set to your preferred settings. - Add
exec-once = /path/to/switcher.shto your hyprland config, so it get's set up when you log in. - Reload the systemd daemon with
systemctl daemon-reload. - Test the setup by (un)plugging a display to your computer.