You are not logged in.

#1 2021-06-02 10:55:01

dat-adi
Member
Registered: 2021-05-30
Posts: 3

[SOLVED] Applications depending on GTK don't launch from terminal.

Hello everyone,
So, I was experimenting with themes and ended up getting rid of Numix, and the Numix-Light directories in hope of resetting my icon themes.

It broke my GTK applications.
I'm no longer able to launch my GTK Applications through the terminal, but, they seem to work when I launch them through rofi or the Qtile Spawn.

I seem to also have two methods to launch the Qtile WM, through LightDM and through the xinitrc.
The GTK applications work when I launch it through the startx command on tty, but, the LightDM session causes issues.

This is the error that pops up when I try to run lxappearance.

(lxappearance:118979): Gtk-WARNING **: 16:17:50.492: Error loading theme icon 'process-stop' for stock: Icon 'process-stop' not present in theme Adwaita

(lxappearance:118979): Gtk-WARNING **: 16:17:50.492: Error loading theme icon 'image-missing' for stock: Failed to load /org/gtk/libgtk/icons/24x24/status/image-missing.png: Unrecognized image file format

(lxappearance:118979): Gdk-CRITICAL **: 16:17:50.492: gdk_cairo_surface_create_from_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(lxappearance:118979): GLib-GObject-CRITICAL **: 16:17:50.492: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
**
Gtk:ERROR:../gtk/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../gtk/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
fish: Job 1, 'lxappearance' terminated by signal SIGABRT (Abort)

My xinitrc,

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# Fonts
xset +fp /usr/share/fonts/TTF/
xset +fp /usr/share/fonts/OTF/


# start some programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
export SSH_AUTH_SOCK

xrandr --output eDP-1 --primary --mode 1920x1080 --rate 60.00 --output HDMI-1 --mode 3440x1440 --rate 60.00 --right-of eDP-1

picom &
pulseaudio &
flameshot &
alsactl --file ~/.config/asound.state restore
setroot --restore &
exec qtile start

LightDM Xsession

#!/bin/sh
#
# LightDM wrapper to run around X sessions.

echo "Running X session wrapper"

# Load profile
for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
    if [ -f "$file" ]; then
        echo "Loading profile from $file";
        . "$file"
    fi
done

# Load resources
for file in "/etc/X11/Xresources" "$HOME/.Xresources"; do
    if [ -f "$file" ]; then
        echo "Loading resource: $file"
        xrdb -merge "$file"
    fi
done

# Load keymaps
for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do
    if [ -f "$file" ]; then
        echo "Loading keymap: $file"
        setxkbmap `cat "$file"`
        XKB_IN_USE=yes
    fi
done

# Load xmodmap if not using XKB
if [ -z "$XKB_IN_USE" ]; then
    for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do
        if [ -f "$file" ]; then
           echo "Loading modmap: $file"
           xmodmap "$file"
        fi
    done
fi

unset XKB_IN_USE

# Run all system xinitrc shell scripts
xinitdir="/etc/X11/xinit/xinitrc.d"
if [ -d "$xinitdir" ]; then
    for script in $xinitdir/*; do
        echo "Loading xinit script $script"
        if [ -x "$script" -a ! -d "$script" ]; then
            . "$script"
        fi
    done
fi

# Run user xsession shell script
script="$HOME/.Xsession"
if [ -x "$script" -a ! -d "$script" ]; then
    echo "Loading xsession script $script"
    . "$script"
fi

echo "X session wrapper complete, running session $@"

exec $@

Any help would be appreciated, thanks!

Last edited by dat-adi (2021-06-02 17:47:59)

Offline

#2 2021-06-02 14:09:35

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Applications depending on GTK don't launch from terminal.

Please edit your post and wrap the outputs in "code" tags, https://bbs.archlinux.org/help.php#bbcode

Then compare the outputs of

loginctl session-status
printenv

from either case (lightdm and init)

Offline

#3 2021-06-02 17:19:51

dat-adi
Member
Registered: 2021-05-30
Posts: 3

Re: [SOLVED] Applications depending on GTK don't launch from terminal.

Thank you for your response.
I didn't know how to wrap it in code tags, I've edited the post appropriately.
I've executed both the commands, and here are the outputs,

Output for loginctl session-status,

2 - dat-adi (1001)
           Since: Wed 2021-06-02 11:54:07 IST; 10h ago
          Leader: 4458 (lightdm)
            Seat: seat0; vc7
         Display: :0
           Since: Wed 2021-06-02 11:54:07 IST; 10h ago
          Leader: 4458 (lightdm)
            Seat: seat0; vc7
         Display: :0
         Service: lightdm; type x11; class user
         Desktop: qtile
           State: active
            Unit: session-2.scope
                  ├─  4458 lightdm --session-child 12 19
                  ├─  4533 /usr/bin/gnome-keyring-daemon --daemonize --login
                  ├─  4536 /usr/bin/python /usr/bin/qtile start --no-spawn --with-state=/tm>
                  ├─  4650 picom
                  ├─  4652 pulseaudio
                  ├─  4653 flameshot
                  ├─  4704 /usr/bin/emacs --daemon
                  ├─  4717 /usr/lib/pulse/gsettings-helper
                  ├─ 54917 ssh-agent -c
                  ├─147677 /opt/discord/Discord
                  ├─147680 /opt/discord/Discord --type=zygote --no-zygote-sandbox
                  ├─147681 /opt/discord/Discord --type=zygote
                  ├─147685 /opt/discord/Discord --type=zygote
                  ├─147714 /opt/discord/Discord --type=gpu-process --field-trial-handle=147>
                  ├─147722 /opt/discord/Discord --type=utility --field-trial-handle=1477154>
                  ├─147768 /opt/discord/Discord --type=renderer --autoplay-policy=no-user-g>
                  ├─147805 /opt/discord/Discord --type=utility --field-trial-handle=1477154>
                  ├─297000 /usr/bin/python3 /usr/bin/qutebrowser
                  ├─297018 /usr/lib/qt/libexec/QtWebEngineProcess --type=zygote --no-zygote>
                  ├─297019 /usr/lib/qt/libexec/QtWebEngineProcess --type=zygote --applicati>
                  ├─297023 /usr/lib/qt/libexec/QtWebEngineProcess --type=zygote --applicati>
                  ├─297043 /usr/lib/qt/libexec/QtWebEngineProcess --type=utility --utility->
                  ├─297114 /usr/lib/qt/libexec/QtWebEngineProcess --type=renderer --disable>
                  ├─297399 /usr/lib/qt/libexec/QtWebEngineProcess --type=utility --utility->
                  ├─301826 emacsclient -c -a emacs
                  ├─305810 /usr/lib/qt/libexec/QtWebEngineProcess --type=renderer --disable>
                  ├─308740 /usr/lib/qt/libexec/QtWebEngineProcess --type=renderer --disable>
                  ├─309150 /usr/lib/qt/libexec/QtWebEngineProcess --type=renderer --disable>
                  ├─310642 alacritty
                  ├─310647 /usr/bin/fish
                  ├─310794 loginctl session-status
                  └─310796 less

Jun 02 15:35:32 datlenovo sudo[91829]: pam_unix(sudo:session): session opened for user root>
Jun 02 15:35:52 datlenovo sudo[91829]: pam_unix(sudo:session): session closed for user root
Jun 02 15:45:35 datlenovo sudo[97542]: pam_systemd_home(sudo:account): systemd-homed is not>
Jun 02 15:45:35 datlenovo sudo[97542]:  dat-adi : TTY=pts/1 ; PWD=/home/dat-adi ; USER=root>
Jun 02 15:45:35 datlenovo sudo[97542]: pam_unix(sudo:session): session opened for user root>
Jun 02 15:58:07 datlenovo sudo[97542]: pam_unix(sudo:session): session closed for user root

Here's the output of the printenv.

XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/dat-adi
XDG_DATA_DIRS=/home/dat-adi/.config
OMF_CONFIG=/home/dat-adi/.config/omf
SHLVL=1
ALACRITTY_LOG=/tmp/Alacritty-310642.log
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus
GDMSESSION=qtile
PWD=/home/dat-adi
DESKTOP_SESSION=qtile
DISPLAY=:0
MAIL=/var/spool/mail/dat-adi
XAUTHORITY=/home/dat-adi/.Xauthority
ORACLE_SID=XE
QT_AUTO_SCREEN_SCALE_FACTOR=1
MOTD_SHOWN=pam
SSH_AGENT_PID=54917
OMF_PATH=/home/dat-adi/.local/share/omf
ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
LANG=en_US.UTF-8
LOGNAME=dat-adi
GTK_MODULES=canberra-gtk-module
SSH_ENV=/home/dat-adi/.ssh/environment
STARSHIP_SHELL=fish
LINES=48
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
STARSHIP_SESSION_KEY=1303751050944313
SHELL=/usr/bin/fish
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXyTYbfA/agent.54915
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/opt/oracle/product/18c/dbhomeXE/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
USER=dat-adi
XDG_VTNR=7
COLUMNS=92
HOME=/home/dat-adi
PT8HOME=/opt/packettracer/
XDG_SEAT=seat0
TERM=xterm-256color
XDG_SESSION_TYPE=x11
XDG_SESSION_DESKTOP=qtile
XDG_SESSION_ID=2
XDG_SESSION_CLASS=user
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
WINDOWID=29360130
XDG_RUNTIME_DIR=/run/user/1001

I've gone through a few articles and some of them did point out that the XDG_DATA_DIRS might be the issue, but, I'm not sure how.

Offline

#4 2021-06-02 17:30:42

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Applications depending on GTK don't launch from terminal.

https://wiki.archlinux.org/title/XDG_Ba … irectories
You probably set the bogus path in your fishrc (which is why rofi is unaffected)?

Offline

#5 2021-06-02 17:40:08

dat-adi
Member
Registered: 2021-05-30
Posts: 3

Re: [SOLVED] Applications depending on GTK don't launch from terminal.

You're a lifesaver, thank you!
I never even gave the fishrc a consideration, it works absolutely fine now.

[ SOLUTION ]
Removed the line that defined the XDG_DATA_DIRS in my fishrc configuration.

Last edited by dat-adi (2021-06-02 17:40:58)

Offline

Board footer

Powered by FluxBB