2
0
Fork
You've already forked resolution-hooks
0
Custom hooks when monitor resolution changes.
  • Shell 100%
2024年10月22日 13:14:40 -06:00
resolution-hooks.d Upload resolution-{hooks,monitor}, update README and provide example hook 2023年01月17日 22:27:35 -06:00
LICENSE Initial commit 2023年01月17日 11:40:48 -06:00
README.md Update README 2024年10月22日 13:14:40 -06:00
resolution-hooks Upload resolution-{hooks,monitor}, update README and provide example hook 2023年01月17日 22:27:35 -06:00
resolution-hooks.desktop Add an desktop autostart entry for resolution-hooks 2023年01月21日 13:46:46 -06:00
resolution-monitor Upload resolution-{hooks,monitor}, update README and provide example hook 2023年01月17日 22:27:35 -06:00
resolution-monitor.desktop Upload resolution-{hooks,monitor}, update README and provide example hook 2023年01月17日 22:27:35 -06:00

resolution-hooks

Run custom scripts when screen resolution changes.

Get it on Codeberg

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.

Notes

  • 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.

Installation

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.

TO-DO

[ ] Allow enable/disable hooks without removing them.