unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Re: redshift and geoclue not working together
@ 2021-02-14  9:20 Göktuğ Kayaalp
  0 siblings, 0 replies; 2+ messages in thread
From: Göktuğ Kayaalp @ 2021-02-14  9:20 UTC (permalink / raw)
  To: help-guix

I have encountered and solved this problem on a Debian system, and
posting the solution in the hopes that it’s useful to someone dealing
with the same problem.

Apparently you don’t need to fiddle with geoclue-service configuration,
as the user apps can’t connect to the service directly.  Instead, you
need a steward process that handles the connection within the user
session.  I think for Gnome and Gnome-like desktop, it’s gnome-shell
that does this, but the executable ‘geoclue-2.0/demos/agent’ can do it
for you for your non-Gnome desktops.  You want it to run in the
background.

I haven’t tested this on a GuixSD system yet, and if there’s any
differences, I’ll report it here.

Best,

        -gk.



^ permalink raw reply	[flat|nested] 2+ messages in thread
* redshift and geoclue not working together
@ 2021-02-08  1:29 Göktuğ Kayaalp
  0 siblings, 0 replies; 2+ messages in thread
From: Göktuğ Kayaalp @ 2021-02-08  1:29 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 3368 bytes --]

Hi all,

For the last few hours I’ve been trying to have redshift(-gtk) work with
geoclue. The relevant bit in my operating-system form is as follows:

  (cons* ;; ...
         (geoclue-service
          #:applications
          (cons* (geoclue-application "redshift-gtk" #:allowed? #t #:system? #t)
                 (geoclue-application "redshift" #:allowed? #t #:system? #t)
                 (geoclue-application "emacs" #:allowed? #t)
                 %standard-geoclue-applications))
         ;; ...
         (remove (lambda (s) (or (eq? (service-kind s) gdm-service-type)
                                 (eq? (service-kind s) geoclue-service-type)
                                 (eq? (service-kind s) slim-service-type)
                                 (eq? (service-kind s) sane-service-type)))
                 %desktop-services)))


On the user side I install packages geoclue, redshift, and
redshift:gtk.  It behaves as follows:

When redshift-gtk is run from .xsession, the icon appears on the system
tray, but nothing happens. When I click on the icon, the following error
message appears in a dialog box:

Failed to run redshift
Trying location provider `geoclue2'
Waiting for initial location to become available...
poll: interrupted system call
Unable to get location from provider.

This leads to following errors to appear in the user Xorg log:

(geoclue:3744) Geoclue-WARNING **: <date>: Failed to create query: no
WiFi devices available
(geoclue:3744) Geoclue-WARNING **: <date>: Failed to create query:
TLS/SSL support not available; install glib-networking

The said package on the last line is an input of geoclue, and I’ve tried
manually installing it as the user too (guix package -i glib-networking).

When I run the command line program, the output is as follows:

[In: ~/cf; Mon Feb 08 04:08; on branch master#; ^1]
[7] g@guixtest (0)$ DISPLAY=:0 redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
Waiting for initial location to become available...

After that last line it sits indefinitely, and in Xorg logs (i.e. on
tty1 when slim is active on tty7) I observe the same error lines about
WiFi and TLS as above.

When I run either redshift or redshift-gtk with command line with the -l
option, manually specifying latitude and longitude info, everything
works fine.

I’ve checked the implementation, and geoclue-service uses Mozilla’s
API.  I’ve compared the URL with the one in my Linux Mint machine’s
config, and they are the same URLs.

I’ve also tried installing redshift not in user manifest but through the
operating-system form, again, to no avail.

The demo applications that come with geoclue just timeout
(find /gnu/store -name \*where-am-i).

This is not a huge issue as I can just set an environment variable and
use it from redshift and Emacs, but ideally I wouldn’t be setting this
manually because while the current GuixSD setup I’m working on is
destined towards an immobile desktop system, I wish to attempt
converting my laptop later on too.

Has any of you been able to get geoclue working, or does anybody know if
this is a mistaken setup on my part or a bug somewhere?

Thanks in advance,

       -gk.

P.S.: I attach the relevant configuration files for reference.


[-- Attachment #2: User manifest (for guix package -m user.scm) --]
[-- Type: application/octet-stream, Size: 3323 bytes --]

;;; user.scm --- packages to be installed for my profile, some customised

(use-modules (gnu)
             (guix download)
             (guix packages)
             (gk guix-packages)
             (srfi srfi-1))

(use-package-modules
 admin aidc aspell astronomy audio backup cmake commencement
 cran curl disk dns djvu dunst emacs emacs-xyz entr fonts fontutils
 freedesktop gdb gimp gnome gnupg graphviz gtk haskell-xyz
 hunspell inkscape image imagemagick image-viewers javascript
 julia kde kde-frameworks language libreoffice linux m4 mail
 maths moreutils networking password-utils patchutils perl
 pdf photo pv python python-xyz pulseaudio qt ruby sqlite
 statistics suckless tex tmux version-control video
 virtualization vim w3m web web-browsers wm xdisorg
 xfce xorg)

;; emacs will need libjansson, also check emacs-telega for telegram
(packages->manifest
 (append
  ;; Build dependencies for Emacs.
  (cons* jansson
         (map cadr (package-inputs emacs-next)))
  ;; Build dependencies for Emacs pdf-tools.
  (map cadr (package-inputs emacs-pdf-tools))
  (list
   ;; linguistics
   praat
   ;; desktop apps
   okular audacity gk-qutebrowser cheese gimp gparted inkscape
   mpv stellarium libreoffice xpdf ristretto simple-scan
   ;; tui apps
   lynx mutt tmux w3m
   ;; xorg / desktop utilities
   clipit rofi simplescreenrecorder xclip desktop-file-utils
   xinput xrdb setxkbmap kdeconnect (list redshift "out")
   (list redshift "gtk") dunst gk-volctl pavucontrol xsettingsd
   flameshot  gnome-themes-standard hicolor-icon-theme
   breeze-icons xsetroot feh xprop imagemagick xauth pulseaudio
   alsa-plugins libnotify
   ;; fonts and font utilities
   fontconfig font-gnu-unifont font-gnu-freefont xfontsel
   font-libertinus font-google-roboto font-ubuntu font-terminus
   font-liberation font-google-noto font-dseg font-dejavu
   xlsfonts font-sil-gentium font-sil-charis font-sil-andika
   font-openmoji font-opendyslexic font-inconsolata
   font-comic-neue font-adobe-source-code-pro font-util
   font-mathjax font-alias font-linuxlibertine font-public-sans
   font-blackfoundry-inria font-bitstream-vera kbd
   ;; network utilities
   (list isc-bind "utils") bridge-utils ndisc6 curl
   ;; encryption, privacy & security
   gnupg password-store pwgen
   ;; programming
   gnu-make python python-pip gcc-toolchain ruby bundler cmake gdb
   gfortran-toolchain julia python-setuptools perl m4
   ;; development libraries
   perl-image-exiftool perl-switch perl-universal-isa
   ;; maths, data, statistics & plotting
   gnuplot r r-car r-psych r-rio r-tidyverse sqlite
   units graphviz
   ;; version control (git is installed in guix-system.scm)
   cvs mercurial rcs subversion
   ;; documents & authoring
   djvulibre pandoc pandoc-citeproc pdfarranger stapler
   texlive texlive-latex-polyglossia texlive-latex-fontspec
   texlive-microtype hunspell
   (specification->package "hunspell-dict-fr-toutesvariantes")
   hunspell-dict-it-it
   hunspell-dict-en hunspell-dict-en-us hunspell-dict-en-gb
   hunspell-dict-en-ca hunspell-dict-en-au
   hunspell-dict-de
   ;; command-line utilities
   entr inotify-tools jq mailutils mb2md moreutils pv
   qrencode youtube-dl vim-full
   ;; e-mail
   mpop msmtp procmail gk-mairix
   ;; virtualisation
   qemu
   ;; system utilities
   smartmontools strace)))

[-- Attachment #3: System configuration that contains the operating-system form --]
[-- Type: application/octet-stream, Size: 2855 bytes --]

;; This is an operating system configuration generated
;; by the graphical installer.

(use-modules (gnu)
             (gnu system nss)
             (srfi srfi-1))

(use-service-modules cups desktop networking ssh xorg)
(use-package-modules cups)

(operating-system
 (locale "en_GB.utf8")
 (timezone "Europe/Istanbul")
 (keyboard-layout (keyboard-layout "gb"))
 (host-name "guixtest")
 (users (cons* (user-account
                (name "g")
                (comment "cadadr")
                (group "users")
                (home-directory "/home/g")
                (supplementary-groups
                 '("wheel" "netdev" "audio" "video")))
               %base-user-accounts))
 (packages
  (cons*
   (specification->package "i3-gaps")
   (specification->package "i3status")
   (specification->package "vim-full")
   (specification->package "dmenu")
   (specification->package "xterm")
   (specification->package "git")
   (specification->package "nss-mdns")
   (specification->package "nss-certs")
   %base-packages))
 (name-service-switch %mdns-host-lookup-nss)
 (services
  (cons* (service openssh-service-type
				  (openssh-configuration
					(x11-forwarding? #t)))
         (service cups-service-type
                  (cups-configuration
                   (extensions
                    (list cups-filters hplip-minimal))))
         (service sane-service-type)
         (geoclue-service #:applications
                          (cons* (geoclue-application "redshift-gtk" #:allowed? #t #:system? #t)
                                 (geoclue-application "redshift" #:allowed? #t #:system? #t)
                                 (geoclue-application "emacs" #:allowed? #t)
                                 %standard-geoclue-applications))
		 (service gnome-keyring-service-type)
         (service slim-service-type
                  (slim-configuration
                   (xorg-configuration (xorg-configuration (keyboard-layout keyboard-layout)))))
         (remove (lambda (s) (or (eq? (service-kind s) gdm-service-type)
                                 (eq? (service-kind s) geoclue-service-type)
                                 (eq? (service-kind s) slim-service-type)
                                 (eq? (service-kind s) sane-service-type)))
                 %desktop-services)))
 (bootloader
  (bootloader-configuration
   (bootloader grub-efi-bootloader)
   (target "/boot/efi")
   (keyboard-layout keyboard-layout)))
 (swap-devices
  (list (uuid "14dee6a1-c28e-49cf-a274-6ad9fc8ff500")))
 (file-systems
  (cons* (file-system
          (mount-point "/boot/efi")
          (device (uuid "82F8-18A6" 'fat32))
          (type "vfat"))
         (file-system
          (mount-point "/")
          (device
           (uuid "e4058621-c98a-493f-8a30-a58d03f9db6f"
                 'ext4))
          (type "ext4"))
         %base-file-systems)))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-14  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14  9:20 redshift and geoclue not working together Göktuğ Kayaalp
  -- strict thread matches above, loose matches on Subject: below --
2021-02-08  1:29 Göktuğ Kayaalp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).