Run custom scripts when screen resolution changes.
The source code is mainly hosted on Codeberg with a mirror available on GitHub. Issues and pull requests should be made in Codeberg.
It uses two scripts: resolution-hooks
and resolution-monitor
. The first one groups all detected hooks and runs them one per one, while the second one calls xeventbind.
resolution-hooks
supports two types of hooks: user-level and system-level. To create user-level hooks, put them in ~/.local/share/resolution-hooks.d/
and make them executable. System-level hooks should be included as part of certain packages, like Betterlockscreen. Default directory for system-level hooks is /usr/share/resolution-hooks.d/
, if you want to modify them, put them at /etc/resolution-hooks.d/
as the first path will be overwritten with updates.
- All hooks are run using
/bin/sh -c
. - At this moment, if the same hook is in both user-level and system-level paths, it will run twice. Please avoid doing this.
- The
resolution-hooks.d
included in this repository is intended only as a demonstration. Hooks will included as part of other packages, or packaged apart.
For XBPS distributions, resolution-hooks
is available in cereus-extra repository. If using Cereus Linux LXQt, it is already included in the live image. To install it manually, run:
# xbps-install -S resolution-hooks
For other distributions, you will need to build xeventbind and add it to your PATH. Next, you must place your hooks in the correspondant directories. Finally, you should add resolution-monitor
to your autostart. There is a desktop file in this repository which helps you on that.
[ ] Allow enable/disable hooks without removing them.