You are not logged in.

#1 2010-02-27 09:05:12

jib2
Member
From: Paris, France
Registered: 2009-08-13
Posts: 93

PKGBUILD: user's screen resolution

Hi,
I want to install a gnome theme with different background images for wide screens/normal screens. Both images are installed but the default configuration file should point to the right image (wide or normal). Then i need to find the user's screen resolution.
Would including these lines in the PKGBUILD be a correct solution? Or is it bad policy?

build() {
...
    # find if we have a wide screen
    local _WIDE_SCR=(1024x600,1280x800,1366x768,1440x900,1680x1050,1920x1200,1920x1080,2560x1600)
    local _res="ZZ"
    [ -f /usr/bin/xdpyinfo ] && _res=`xdpyinfo | awk '/dimensions/ {print $2}'`
    if [[ $_WIDE_SCR =~ $_res ]] ; then
        echo "BackgroundImage=/usr/share/pixmaps/backgrounds/gnome/other/AquaDreams-wide.jpg" >>index.theme
    else 
        echo "BackgroundImage=/usr/share/pixmaps/backgrounds/gnome/other/AquaDreams.jpg" >>index.theme
    fi
...
}

Thanks for your help.

Offline

#2 2010-02-27 09:47:34

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: PKGBUILD: user's screen resolution

Just use an install message imo. Users should carry out their own package configuration after install.

Offline

#3 2010-02-27 13:57:21

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: PKGBUILD: user's screen resolution

tomk wrote:

Just use an install message imo. Users should carry out their own package configuration after install.

Quoted for truth. It IS possible using xrandr  and grep though. If you're really interested, go try it out. You really should leave it to the user though.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2010-02-27 15:03:39

jib2
Member
From: Paris, France
Registered: 2009-08-13
Posts: 93

Re: PKGBUILD: user's screen resolution

Thanks for your answers.
I agree users should take care of package configuration.
But in this case, it's not about the user's choice: some background images really don't fit a wide screen; and the author specifically included one background for regular screens and another for wide screens.
So my question is: would it be bad|dangerous|ugly|forbidden..., according to Arch rules?

@ngoonee: is using xrandr better than xdpyinfo?

Offline

#5 2010-02-27 15:25:16

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: PKGBUILD: user's screen resolution

Just issue a warning during package install, it's not like Arch is meant to pacman -Syu (or pacman -U or makepkg -i) and ignore everything else.

Besides using xrandr is not completely foolproof, the user may usually use something else than the resolution used during install or dual screen setups or something exotic.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2010-02-27 16:04:42

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: PKGBUILD: user's screen resolution

It's not possible to do cleanly. There is no guarantee that a package is built on the system that will install it. Just put an install message. Arch is DIY anyway, don't mess with autoconfiguration stuff.

Offline

#7 2010-02-27 18:59:26

jib2
Member
From: Paris, France
Registered: 2009-08-13
Posts: 93

Re: PKGBUILD: user's screen resolution

OK. Thanks for your advice.

Offline

Board footer

Powered by FluxBB