Skip to content

Instantly share code, notes, and snippets.

View shellixa's full-sized avatar

Shellixa shellixa

View GitHub Profile
@aron-hoogeveen
aron-hoogeveen / README.md
Last active November 29, 2025 16:54
Hyprland disable/enable display on HDMI connect/disconnect

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.

  1. Create the file switcher.sh in your preferred directory (e.g. /home/yourusername/scripts/).
  2. Create the file hypr-display-switcher.service in /etc/systemd/user/.
  3. Create the file hyprland-display-switcher.rules in /etc/udev/rules.d/.
  4. (optional) Make sure that on every login the environment value HYPR_BUILDIN_MON is set to your preferred settings.
  5. Add exec-once = /path/to/switcher.sh to your hyprland config, so it get's set up when you log in.
  6. Reload the systemd daemon with systemctl daemon-reload.
  7. Test the setup by (un)plugging a display to your computer.
@nicolasdao
nicolasdao / open_source_licenses.md
Last active November 27, 2025 22:24
What you need to know to choose an open source license.
@remino
remino / msconvert.js
Created January 5, 2012 05:37
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
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 };