icc-brightness icon indicating copy to clipboard operation
icc-brightness copied to clipboard

Support for Archlinux

Open ncharles opened this issue 5 years ago • 5 comments

Thank you so much for this tool, it saved my eyes!

On Archlinux, the last step isn't correct, the .destkop file should be copied to /etc/xdg/autostart or ~/.config/autostart (path usr/share/gnome/autostart/ doesn't exist)

ncharles avatar Aug 01 '19 10:08 ncharles

@ncharles did you manage to get it to work on your arch installation?

in my case I am getting the following errors when I set the icc-brightness watch to run:

$ icc-brightness watch
ERROR: device-make-profile-default
Traceback (most recent call last):
  File "/usr/local/bin/icc-brightness", line 136, in main
    icc_brightness_apply()
  File "/usr/local/bin/icc-brightness", line 108, in icc_brightness_apply
    icc_brightness(brightness, max_brightness)
  File "/usr/local/bin/icc-brightness", line 85, in icc_brightness
    subprocess.check_output(['colormgr', 'import-profile', icc_filepath])
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colormgr', 'import-profile', '/tmp/brightness_24000_24000.icc']' returned non-zero exit status 1.
ERROR: Error during call to icc_brightness
Traceback (most recent call last):
  File "/usr/local/bin/icc-brightness", line 114, in handler
    icc_brightness_apply()
  File "/usr/local/bin/icc-brightness", line 108, in icc_brightness_apply
    icc_brightness(brightness, max_brightness)
  File "/usr/local/bin/icc-brightness", line 85, in icc_brightness
    subprocess.check_output(['colormgr', 'import-profile', icc_filepath])
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colormgr', 'import-profile', '/tmp/brightness_22800_24000.icc']' returned non-zero exit status 1.
ERROR: b'The profile was not added in time\n'
ERROR: Error during call to icc_brightness
Traceback (most recent call last):
  File "/usr/local/bin/icc-brightness", line 114, in handler
    icc_brightness_apply()
  File "/usr/local/bin/icc-brightness", line 108, in icc_brightness_apply
    icc_brightness(brightness, max_brightness)
  File "/usr/local/bin/icc-brightness", line 85, in icc_brightness
    subprocess.check_output(['colormgr', 'import-profile', icc_filepath])
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colormgr', 'import-profile', '/tmp/brightness_2400_24000.icc']' returned non-zero exit status 1.
ERROR: b'The profile was not added in time\n'
ERROR: Error during call to icc_brightness
Traceback (most recent call last):
  File "/usr/local/bin/icc-brightness", line 114, in handler
    icc_brightness_apply()
  File "/usr/local/bin/icc-brightness", line 108, in icc_brightness_apply
    icc_brightness(brightness, max_brightness)
  File "/usr/local/bin/icc-brightness", line 85, in icc_brightness
    subprocess.check_output(['colormgr', 'import-profile', icc_filepath])
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colormgr', 'import-profile', '/tmp/brightness_24000_24000.icc']' returned non-zero exit status 1.
ERROR: b'The profile was not added in time\n'

the way I am installing it is with the following personally made PKGBUILD:

pkgname=icc-brightness
pkgver=1.0
pkgrel=0
pkgdesc="Adjust OLED screen brightness."
arch=("any")
url="https://github.com/udifuchs/icc-brightness.git"
license=('MIT')
depends=('lcms2')
source=("https://github.com/udifuchs/icc-brightness.git")
sha1sums=('SKIP')

build() {
        git clone "$source"
        cd "$pkgname"
        make
}

package() {
    cd "$pkgname"
    mkdir -p $pkgdir/usr/local/bin
    install ./icc-brightness-gen $pkgdir/usr/local/bin/
    install ./icc-brightness $pkgdir/usr/local/bin/
    install ./icc-brightness.desktop $pkgdir/etc/xdg/autostart
}

ttsesm avatar Aug 10 '19 20:08 ttsesm

ok it seems that problem solved by installing the colord-kde package

ttsesm avatar Aug 11 '19 00:08 ttsesm

i manually made it work (make, and then copy to the final location) I didn't use colord-kde (i'm on gnome+wayland), but i think it was gnome-color-manager

ncharles avatar Aug 12 '19 13:08 ncharles

yes, you need either colord-kde or gnome-color-manager or any other icc profile loading application e.g. xiccd in order to work. In any case I have added it as a dependency on the above PKGBUILD. Thanks for the feedback.

I am also attaching the PKGBUILD here in case someone else wants to use it. I am not creating any autostart file though. This can be done from the user depending which desktop manager is using since the one in the source code is dedicated to gnome environment.

# Maintainer: TheodoreT
pkgname=icc-brightness
pkgver=1.0
pkgrel=0
pkgdesc="Adjust OLED display brightness by applying ICC color profiles."
arch=("any")
url="https://github.com/udifuchs/icc-brightness.git"
license=('MIT')
depends=('lcms2' 'colord-kde')
optdepends=('gnome-color-manager: Set of graphical utilities for color management to be used in the GNOME desktop.' 
            'xiccd: A simple bridge between colord and X. It allows non-Gnome and non-KDE desktop environment to load and apply icc profiles.')
source=("https://github.com/udifuchs/icc-brightness.git")
sha1sums=('SKIP')

build() {
        git clone "$source"
        cd "$pkgname"
        make
}

package() {
    cd "$pkgname"
    mkdir -p $pkgdir/usr/local/bin
    install ./icc-brightness-gen $pkgdir/usr/local/bin/
    install ./icc-brightness $pkgdir/usr/local/bin/
}

ttsesm avatar Aug 12 '19 17:08 ttsesm

@TheodoreT I improved your PKGBUILD and added it to AUR. See https://aur.archlinux.org/packages/icc-brightness-gnome-git

Note that I created a hard dependency on GNOME, because I don't have KDE and could not verify if it works there. Somebody has to create a separate icc-brightness-kde package, then.

@udifuchs I think this issue is solved now (at least for the GNOME folks) and could be closed.

dmoebius avatar Oct 26 '19 16:10 dmoebius