Commit Graph

574 Commits

Author SHA1 Message Date
Songmin Li 770dc86bec Ignore processes with wrong XAUTHORITY file
This commit adds a check to see if the XAUTHORITY file exists for a
given display. If it doesn't, the process environment is added to the
backup candidates and the loop continues. This is particularly useful
for tmux processes when the user re-logs in, as the XAUTHORITY may not
be updated.

Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-08-03 08:17:40 +02:00
Claus Conrad 1fe334d366 Add link to official Fedora package 2024-07-27 12:33:49 +02:00
Meissner 10db96a050 Added files to rpm spec 2024-06-13 06:36:15 +02:00
Phillip Berndt 1fe0b7eb4c Release autorandr 1.15
Relevant changes:

 * *2023-11-27* Several regex literal bug fixes
 * *2023-12-27* Fix #375: Listen to correct events in launcher
 * *2024-03-03* Fix #367: Skip profiles without outputs
2024-03-03 13:37:50 +01:00
Phillip Berndt d09dc76a76 Fix #367: Skip profiles without outputs 2024-02-27 14:52:41 +01:00
Arkadiusz Drabczyk 303d00b31a Fix const warnings
gcc and clang report warnings due to -Wwrite-strings:

    $ docker run -it --rm -v "$PWD":/workspace -w /workspace gcc sh -c 'apt-get update &&
    apt-get -y install libxcb1-dev libxcb-randr0-dev &&
    make'
    (...)
    cc -pipe -o2 -Wstrict-overflow=5 -fstack-protector-all -W -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wfloat-equal -Wformat-y2k -Winit-self -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=nfc -Wold-style-definition -Woverlength-strings -Wpacked -Wpadded -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing=2 -Wstrict-prototypes -Wundef -Wunsafe-loop-optimizations -Wvolatile-register-var -Wwrite-strings  "-DAUTORANDR_PATH=\"\"" -o autorandr-launcher autorandr_launcher.c -lxcb -lxcb-randr
    autorandr_launcher.c: In function 'ar_launch':
    <command-line>: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    autorandr_launcher.c:47:41: note: in expansion of macro 'AUTORANDR_PATH'
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                         ^~~~~~~~~~~~~~
    autorandr_launcher.c:47:57: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                                         ^~~~~~~~~~
    autorandr_launcher.c:47:69: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                                                     ^~~~~~~~~~~
    autorandr_launcher.c:47:82: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       47 |                 static char *argv[] = { AUTORANDR_PATH, "--change", "--default", "default", NULL};
          |                                                                                  ^~~~~~~~~
2023-12-28 07:32:07 +01:00
Arkadiusz Drabczyk b573c4a63f Do not check for mask in evt->response_type
Value of `evt->response_type` comes from X11 server and at least in
Xorg it's not constant but depends on number of loaded extensions
21b3dad238/mi/miinitext.c (L110)
and a number of arguments each loaded extension takes. When randr
module is loaded
d6c02ffd9c/randr/randr.c (L439)
`REventBase` is calculated.

On Debian 12 its value is 89 so the method _incidentally_ works as 89
& 1 is 1 but on my Slackware system it's value is 88 and since 88 & 1
isn't 1 the method doesn't work.

Fixes #375
2023-12-28 07:32:07 +01:00
aarondill f8f2308ce9 add compiled autorandr-launcher binary to .gitignore
Note: this is added within the contrib/autorandr_launcher module so it (hopefully) remains up-to-date
2023-12-23 23:27:03 +01:00
aarondill d80a22561a fix: remove literal backslashes in edid regex
This fixes edid detection by searching for a newline followed by two tabs, instead of the literal string '\n\t\t'
2023-12-23 23:27:03 +01:00
manuben13 ce13b0a03f Added missing r literal in OUTPUT_REGEX
Completes the fix of issue #368
2023-11-27 08:15:00 +01:00
Lukas Juhrich c0181abfba Add missing r literal to regex strings
Fixes #368
2023-11-22 21:38:50 +01:00
Emil bb98da7e73 Fix URL to Arch package 2023-07-16 21:45:38 +02:00
Anton Mosich 8d28d3c071 fish completion: fix typo in folder name 2023-07-06 15:39:06 +02:00
Phillip Berndt d0f64bf215 Bump version to 1.14 2023-06-22 16:37:12 +02:00
Matheus Horstmann 05b22a61ee Use xcb doc
Signed-off-by: Matheus Horstmann <horstmannmat@hotmail.com>
2023-06-22 16:31:50 +02:00
Matheus Horstmann d9b7d0b70f Fix makefile
Signed-off-by: Matheus Horstmann <horstmannmat@hotmail.com>
2023-06-22 16:31:50 +02:00
Matheus Horstmann 34d3aad795 Add make file and Create macro to enable local path of autorandr
Signed-off-by: Matheus Horstmann <horstmannmat@hotmail.com>
2023-06-22 16:31:50 +02:00
Epakai 2452110831 Direct --match-edid renaming of output messages to stderr
This change helps scripts that consume autorandr output to only deal with profile names. My particular concern is with the output from 'autorandr --match-edid --detected'. With this change, only the detected profiles will go to another script. Command line users can still see the relevant messages if they have concerns about which port is in use.
2023-06-22 16:29:45 +02:00
Thiago Kenji Okada 0ac2f9a0ed Fix autorandr-kde.desktop PREFIX 2023-06-22 11:35:14 +02:00
Thiago Kenji Okada 65a2b31f39 Add Wayland awareness
With this commit autorandr will check if the current environment has the
`WAYLAND_DISPLAY` environment variable set. If yes, it will exit
(in interactive mode) or skip (in batch mode), to avoid issues between
xrandr usage and Wayland environments.
2023-05-05 14:26:22 +02:00
Patrick Deubel ac8fb582ce Replaced MAKECMDGOALS with DEFAULT_TARGETS to check for systemd
when installing udev rules

MAKECMDGOALS does not containg "systemd" although systemd is used
on the system. Thus, an incorrect udev rule is created. DEFAULT_TARGETS
however does contain "systemd", because of a check earlier in the
Makefile (lines 83-85).
2023-04-25 18:21:44 +02:00
VuiMuich 5981c84bca add fish completions to rpm 2023-04-15 20:57:02 +02:00
VuiMuich 803b243135 add completions for fish shell 2023-04-15 20:57:02 +02:00
VuiMuich 06b341adf3 Minor "off by one" mistake in manpage 2023-04-10 10:40:28 +02:00
Julian Stiller f2f5505e8c contrib/autorandr_nitrogen_wallpaper
Make commands independent of location on system
It helps running autorandr_nitrogen_wallpaper on systems without
/bin/bash, /usr/bin/unlink, /bin/cp and /bin/mv. E.g. NixOS, which
doesn't have /bin/bash.
2023-04-08 15:41:07 +02:00
Sam Coulter de70940eee Adding my name to contributors list since PR 303 was merged 2023-03-13 18:57:29 +01:00
Kian-Meng Ang 05bc32c134 Fix typos
Found via `codespell -L nd`
2023-02-24 07:00:47 +01:00
Phillip Berndt 9ebe3716c1 Release 1.13.3 2023-01-24 12:55:48 +01:00
Phillip Berndt b08336a3b9 Revert "Use add or remove instead of change"
This reverts commit 14f5a94521.
The revert fixes #324
2023-01-24 12:52:53 +01:00
Phillip Berndt d5847f7288 Release bug fixes as 1.13.2 2023-01-23 11:26:32 +01:00
Phillip Berndt cd20b703ca Document #320 in README 2023-01-23 11:23:27 +01:00
Matt Alexander cbae7c8eff Added autostart that works in KDE 2023-01-23 11:22:50 +01:00
Phillip Berndt d10cbb5eb1 Document #321 in README 2023-01-23 11:21:53 +01:00
DawidJanczak 14f5a94521 Use add or remove instead of change
Change gets triggered by probably unrelated things like starting a
browser. This should fix
https://github.com/phillipberndt/autorandr/issues/310
2023-01-23 11:21:05 +01:00
Phillip Berndt 9aa18d7bd9 Do a final xrandr call to reset the fb size
Fixes #319
2023-01-23 11:18:47 +01:00
Phillip Berndt 4fcc1c277f Fix matching EDIDs with wildcards
Fixes #322
2023-01-23 11:17:09 +01:00
Phillip Berndt 0ca5ca9d0a Release 1.13.1 2023-01-16 09:56:15 +01:00
Phillip Berndt d285fd5fd4 Add missing comparisons on version 2023-01-16 09:55:17 +01:00
Markus Lehtonen 3ba0a2c5ef Add ge method to custom Version type
Fixes crash with xrandr version comparison.
2023-01-16 09:52:50 +01:00
Phillip Berndt 4bb03ef208 Release 1.13 2023-01-15 15:23:50 +01:00
Phillip Berndt 5c2bd23f35 Use custom Version class
Fixes #304
2023-01-15 15:20:20 +01:00
Olli Raula b8eb298a22 Print error when user script fails 2023-01-15 15:08:07 +01:00
Magks 1d896af332 fixing horizontal-reverse profile which was doing the same thing as vertical-reverse 2023-01-15 15:06:28 +01:00
Max Alexander Villa 237f339f13 Add reverse versions of horizontal/vertical virtual profiles
Add "vertical-reverse" and "horizontal-reverse" to virtual profiles dictionary and use reversed() iter of configuration dictionary if user selects these.
2023-01-15 15:06:28 +01:00
Frank Dana de2a1fb3c3 RPM spec: Add conditional Recommends 2022-12-23 08:38:01 +01:00
Franz Berger 9ab39c001c execute scripts in directories in a fixed order (by file name) 2022-12-01 08:44:21 +01:00
Phillip Berndt a8dfbda0d4 Quote arguments in failed command output
See #297 and #299
2022-12-01 08:41:15 +01:00
Phillip Berndt 0dc563f5ab Fix typo: The parameter is called --skip-options 2022-12-01 08:37:27 +01:00
Phillip Berndt dbd2f7b0d1 Consider skip-options in post-apply-check
Otherwise autorandr complains that the profile was not applied
correctly.
2022-12-01 08:33:46 +01:00
Phillip Berndt 5a6ded231f Support to skip properties using --skip-option set
See bug #297 and bug #299.
2022-12-01 08:33:46 +01:00