X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=contrib%2Fpackaging%2Frpm%2Fautorandr.spec;fp=contrib%2Fpackaging%2Frpm%2Fautorandr.spec;h=1e7746b6dec6cfea94a4c0f5f052b78418bd377f;hb=7b7c05316eee79294fe34feaf0d1693553b41c45;hp=9bd576dbf07807a575e15fd0157e2ff5281e31a3;hpb=cc731e35efff9af92c9f958fdb01ff9d30c0bfac;p=deb_pkgs%2Fautorandr.git diff --git a/contrib/packaging/rpm/autorandr.spec b/contrib/packaging/rpm/autorandr.spec index 9bd576d..1e7746b 100644 --- a/contrib/packaging/rpm/autorandr.spec +++ b/contrib/packaging/rpm/autorandr.spec @@ -239,17 +239,30 @@ it has a unique name. If you switch back from `docked` to `mobile`, `~/.config/autorandr/postswitch` is executed instead of the `docked` specific `postswitch`. -In these scripts, some of autorandr's state is exposed as environment variables +If you experience issues with xrandr being executed too early after connecting +a new monitor, then you can use a `predetect` script to delay the execution. +Write e.g. `sleep 1` into that file to make autorandr wait a second before +running `xrandr`. + +#### Variables + +Some of autorandr's state is exposed as environment variables prefixed with `AUTORANDR_`, such as: - `AUTORANDR_CURRENT_PROFILE` - `AUTORANDR_CURRENT_PROFILES` - `AUTORANDR_PROFILE_FOLDER` - `AUTORANDR_MONITORS` -If you experience issues with xrandr being executed too early after connecting -a new monitor, then you can use a `predetect` script to delay the execution. -Write e.g. `sleep 1` into that file to make autorandr wait a second before -running `xrandr`. +with the intention that they can be used within the hook scripts. + +For instance, you might display which profile has just been activated by +including the following in a `postswitch` script: +```sh +notify-send -i display "Display profile" "$AUTORANDR_CURRENT_PROFILE" +``` + +The one kink is that during `preswitch`, `AUTORANDR_CURRENT_PROFILE` is +reporting the *upcoming* profile rather than the *current* one. ### Wildcard EDID matching