GithubHelp home page GithubHelp logo

keyofblues / xfce4-display-profile-chooser Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 2.0 163 KB

With this bash script you can, via command line, list and set already configured display profiles in xfce4-display-settings. This is usefull if you want e.g. to automate stuff by setting profiles with a script or to use a keyboard shortcut.

Shell 100.00%
bash command-line command-line-tool display edid graphical-user-interface gui gui-application linux profile screen script shell toggling-displays utility xfce xfce4 xrandr xubuntu yad

xfce4-display-profile-chooser's People

Contributors

keyofblues avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xfce4-display-profile-chooser's Issues

Save settings next time GUI is opened

Version: 0.4.2

Hi! Is it possible to add a tick option to save the configurations set on the GUI window?
I open the GUI via a shortcut to the .sh script directly and always have to set it; for example, the Skip checks on inactive outputs.

Thank you!

Not working on ubstream xubuntu 20.04

$ xfce4-display-profile-chooser.sh -s list -k
Select the profile you want to set:
0) Exit
1) id: 00e01c59a3e26956e8406566d446619db82d2c27, name: right&center
2) id: 0b0761505df198cb6d85592748a1134abfe1b17a, name: right+center
3) id: 2d8f98d91c740983b8ad03f18d8b578d32d0a8ac, name: all 3, state: set; not active
4) id: 305047e96ec089021660ee5965f893ac80268731, name: center
5) id: 356a192b7913b04c54574d18c28d46e6395428ab, name: 1
6) id: 77de68daecd823babbb58edb1c8e14d7106e83bb, name: 3
7) id: 85c274929bc0e28eafd3734f2c25046c3b95b36b, name: middle
8) id: AutoEnableProfiles, name: true
9) id: Notify, name: true
10) id: Schemas, name: 2d8f98d91c740983b8ad03f18d8b578d32d0a8ac
11) id: ced82d6ccf96442f473200ee3a6c1465363bff88, name: center+right
12) id: d87c448044defb778f33158d8ccf94a20531d600, name: all
make your choice: 3
Display connected to DP-2 do not support this profile (3840x2160 59.996625Hz).
Display connected to DisplayPort-1-0 do not support this profile (3840x2160 30.000000Hz).
Display connected to HDMI-A-1-0 do not support this profile (3840x2160 30.000000Hz).
Cannot set profile 2d8f98d91c740983b8ad03f18d8b578d32d0a8ac - all 3.

Cannot set any profile, claiming the monitors do not support the resolution, even if that profile is already active and working. Note that my computer randomly "looses" profiles, i.e. only two of the 12 (but really 10) profiles listed in the dump above are actually available in display settings. Also note that the "all 3" profile is active, in spite of the flag saying otherwise.

Versions:

$ dpkg-query -l xf* | grep -i '^ii' --color=no
ii  xfburn                        0.6.2-1                 amd64        CD-burner application for Xfce Desktop Environment
ii  xfce4-appfinder               4.14.0-1                amd64        Application finder for the Xfce4 desktop environment
ii  xfce4-cpugraph-plugin         1.1.0-1                 amd64        CPU load graph plugin for the Xfce4 panel
ii  xfce4-dict                    0.8.3-1                 amd64        Dictionary plugin for Xfce4 panel
ii  xfce4-indicator-plugin        2.3.4-0ubuntu2          amd64        plugin to display information from applications in the Xfce4 panel
ii  xfce4-mailwatch-plugin        1.2.0-3                 amd64        mail watcher plugin for the Xfce4 panel
ii  xfce4-netload-plugin          1.3.2-1                 amd64        network load monitor plugin for the Xfce4 panel
ii  xfce4-notes                   1.8.1-3                 amd64        Notes application for the Xfce4 desktop
ii  xfce4-notes-plugin            1.8.1-3                 amd64        Notes plugin for the Xfce4 desktop
ii  xfce4-notifyd                 0.4.4-1                 amd64        simple, visually-appealing notification daemon for Xfce
ii  xfce4-panel                   4.14.3-1                amd64        panel for Xfce4 desktop environment
ii  xfce4-panel-profiles          1.0.10-0ubuntu1         all          layout manager for the Xfce panel
ii  xfce4-places-plugin           1.8.1-1                 amd64        quick access to folders, documents and removable media
ii  xfce4-power-manager           1.6.6-1                 amd64        power manager for Xfce desktop
ii  xfce4-power-manager-data      1.6.6-1                 all          power manager for Xfce desktop, arch-indep files
ii  xfce4-power-manager-plugins   1.6.6-1                 amd64        power manager plugins for Xfce panel
ii  xfce4-pulseaudio-plugin:amd64 0.4.3-0ubuntu1          amd64        Xfce4 panel plugin to control pulseaudio
ii  xfce4-screensaver             0.1.10-0ubuntu1         amd64        screen saver and locker that is integrated with the xfce4 desktop
ii  xfce4-screenshooter           1.9.7-1                 amd64        screenshots utility for Xfce
ii  xfce4-session                 4.14.2-0ubuntu1         amd64        Xfce4 Session Manager
ii  xfce4-settings                4.14.3-0ubuntu1         amd64        graphical application for managing Xfce settings
ii  xfce4-statusnotifier-plugin   0.2.2-1                 amd64        plugin to display status notifiers in the Xfce4 panel
ii  xfce4-systemload-plugin       1:1.2.3-1ubuntu1        amd64        system load monitor plugin for the Xfce4 panel
ii  xfce4-taskmanager             1.2.3-0ubuntu1          amd64        process manager for the Xfce4 Desktop Environment
ii  xfce4-terminal                0.8.9.1-1               amd64        Xfce terminal emulator
ii  xfce4-verve-plugin            2.0.0-1                 amd64        Verve (command line) plugin for Xfce panel
ii  xfce4-weather-plugin          0.10.2-0ubuntu0.20.04.1 amd64        weather information plugin for the Xfce4 panel
ii  xfce4-whiskermenu-plugin      2.4.3-1                 amd64        Alternate menu plugin for the Xfce desktop environment
ii  xfce4-xkb-plugin              1:0.8.1-2               amd64        xkb layout switch plugin for the Xfce4 panel
ii  xfconf                        4.14.1-1                amd64        utilities for managing settings in Xfce
ii  xfdesktop4                    4.14.2-1                amd64        Xfce desktop background, icons and root menu manager
ii  xfdesktop4-data               4.14.2-1                all          Xfce desktop background, icons and root menu (common files)
ii  xfig                          1:3.2.7b-2              amd64        Facility for Interactive Generation of figures under X11
ii  xfig-doc                      1:3.2.7b-2              all          XFig on-line documentation and examples
ii  xfig-libs                     1:3.2.7b-2              all          XFig image libraries and examples
ii  xfonts-75dpi                  1:1.0.4+nmu1            all          75 dpi fonts for X
ii  xfonts-base                   1:1.0.5                 all          standard fonts for X
ii  xfonts-encodings              1:1.0.5-0ubuntu1        all          Encodings for X.Org fonts
ii  xfonts-scalable               1:1.0.3-1.1             all          scalable fonts for X
ii  xfonts-utils                  1:7.7+6                 amd64        X Window System font utility programs
ii  xfpanel-switch                1.0.10-0ubuntu1         all          transitional package
ii  xfsprogs                      5.3.0-1ubuntu2          amd64        Utilities for managing the XFS filesystem
ii  xfwm4                         4.14.1-0ubuntu1         amd64        window manager of the Xfce project

Check for connected displays

Applying a profile that contains one or more displays that are not connected can lead to a misconfiguration.
From what I see in xfconf, the only value I could use in order to match configured displays with connected displays should be EDID value.
We need a way, in bash, to retrieve that value in the same format, as it isn't the same of what we can get with e.g. xrandr --prop.

example:
We want to e.g. set profile d6c313ffc53db7cfeee6fa40538985c5eefb24cc. This profile has two configured EDID:

$ xfconf-query -v -l -c displays -p /d6c313ffc53db7cfeee6fa40538985c5eefb24cc | grep '/EDID '
/d6c313ffc53db7cfeee6fa40538985c5eefb24cc/DVI-I-1/EDID        d57a084978bbd241c62509aea3ab64a427ffc73e
/d6c313ffc53db7cfeee6fa40538985c5eefb24cc/HDMI-0/EDID         471766147bfc30d2842655fadc76e95ca11d595b

Now we want to be sure those two EDIDs to be connected before set the profile.
So the question is, how?
With xrandr --prop we can get the connected EDIDs:

...
DVI-I-1 connected
...
	EDID: 
		00ffffffffffff0041622101b12a3000
		0314010380341d78eaeed5a555489b26
		125054b30c00714f8180810095000101
		010101010101023a801871382d40582c
		450009252100001e000000fc00566973
		656f2032343044580a20000000fd0038
		4c1f5312000a202020202020000000ff
		004432343043303032343030310a00e4
...
HDMI-0 connected
...
	EDID: 
		00ffffffffffff001e6d010001010101
		011e010380a05a780aee91a3544c9926
		0f5054a1080031404540614071408180
		d1c00101010108e80030f2705a80b058
		8a0040846300001e662150b051001b30
		4070360040846300001e000000fd0018
		781e873c000a202020202020000000fc
		004c4720545620535343520a202001e4
		02034ff15a6160101f66650413051403
		021220212215015d5e5f6263643f4029
		0957071507505507006e030c001000b8
		3c2400800102030468d85dc401788003
		02e200cfe305c000e3060d01e20f3356
		5e00a0a0a02950302035004084630000
		1e000000000000000000000000000000
		000000000000000000000000000000f3
...

but they are not in the same format as those seen in xfconf-query, so we need:
CONNECTED_EDIDS="$(some command to get current connected displays EDID the same way as seen in xconf-query)"

I've been pointed to https://gitlab.xfce.org/xfce/xfce4-settings/-/blob/master/common/edid-parse.c

Any help is greatly appreciated.

IN ANY CASE a part from EDID, various checks are performed to assure a profile can be applied in first place, so this script could be considered reliable, especially if your displays are always the same.

Error in perl execution

Running the script results in several errors of the form

syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.

which seem to be the result of the execution of perl code in the script. It looks to me, like there is some problem with the quotation marks in the perl commands.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.