This forum has been archived. All content is frozen. Please use KDE Discuss instead.

sudo applications and breeze theme

Tags: None
(comma "," separated)
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS

sudo applications and breeze theme

Wed Mar 04, 2015 8:42 am
Hi,

Having some minor problems with the theme settings in kubuntu 15.04 beta (updated today: Mar/04/2015):

"sudo kate" will give me a kate window with an undefineable theme - it's not oxygen, it's not raleigh or breeze. It uses some sandish color
I've tried quite a few things now, but nothing seems to make the launched instances of kate or any kde application use the default theme.

Also: The icons seem to be mostly just missing.

So, sudo and kubuntu aren't working smoothly, right now.

Any pointers for someone who really does enjoy the new style of Breeze? Can I c/p some files into default directories that are getting used?
Should I report a bug? If - what package would be the one this applies to?

Thanks in advance,
Timo
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
The problem is that you use sudo for graphical applications. That's hardly supported, e.g. required env variables are not passed to the application resulting in the correct style not picked up.

If you really have to run graphical applications as root at least use kdesudo.
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS
Unfortunately, there is no visual difference between launching sudo kate and kdesudo kate.

Both cases provide me with a "bad" theme. Please, see for yourself:
http://i.imgur.com/OH0HVzE.png
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
could you please have a look at the environment variables of the process run as root?
User avatar
david_edmundson
KDE Developer
Posts
359
Karma
1
OS
VISUAL=kwrite sudoedit /etc/somefile

This will
copy the file as root to /tmp/ and change it so your user has access
launch the editor in $VISUAL
wait for the editor to exit
as root copy the file back

Safe.

As you're running kwrite as you, you get all your settings. Including your personal kwrite specific things. Win win.
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS
Same thing for kdesudo and sudo, different for normal user.
kdesudo / sudo
Code: Select all
~ $ kdesudo printenv
LANGUAGE=de:en_US
PS1=\w $
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=de_DE.UTF-8
DISPLAY=:0
XAUTHORITY=/tmp/kdesudo-nn5214-xauth
TERM=xterm
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
HOME=/root
SHELL=/bin/bash
MAIL=/var/mail/root
LOGNAME=root
USER=root
USERNAME=root
SUDO_COMMAND=/usr/bin/printenv
SUDO_USER=myuser
SUDO_UID=1000
SUDO_GID=1000
QCoreApplication::postEvent: Unexpected null receiver


And for my normal user it's:
Code: Select all
XDG_VTNR=1
SSH_AGENT_PID=1666
XDG_SESSION_ID=2
CLUTTER_IM_MODULE=xim
GPG_AGENT_INFO=/tmp/gpg-CO4LG2/S.gpg-agent:1667:1
SHELL=/bin/bash
TERM=xterm
XDG_SESSION_COOKIE=cbe9acccc64f4f98dd8b693c54f086b2-1425454224.215428-671571432
KONSOLE_DBUS_SERVICE=:1.92
KONSOLE_PROFILE_NAME=Shell
GS_LIB=/home/myuser/.fonts
WINDOWID=16777222
SHELL_SESSION_ID=976b536a6db54000ab54197ff17193be
XDG_SESSION_CLASS=user
KDE_FULL_SESSION=true
USER=myuser
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
DROPBOX_USE_LIBAPPINDICATOR=1
SSH_AUTH_SOCK=/tmp/ssh-RnEY4FmKCFMr/agent.1616
SESSION_MANAGER=local/easys:@/tmp/.ICE-unix/1815,unix/easys:/tmp/.ICE-unix/1815
DEFAULTS_PATH=/usr/share/gconf/plasma.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
DESKTOP_SESSION=plasma
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
QT_IM_MODULE=ibus
PWD=/home/myuser
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=ibus
KONSOLE_DBUS_WINDOW=/Windows/1
LANG=de_DE.UTF-8
KDE_SESSION_UID=1000
MANDATORY_PATH=/usr/share/gconf/plasma.mandatory.path
PS1=\w $
KONSOLE_DBUS_SESSION=/Sessions/1
XDG_SEAT=seat0
COLORFGBG=0;15
HOME=/home/myuser
SHLVL=1
KDE_SESSION_VERSION=5
LANGUAGE=de:en_US
XCURSOR_THEME=breeze_cursors
LOGNAME=myuser
XDG_SESSION_DESKTOP=KDE
XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-pK1lKBHCeI,guid=0e50f1adc2ebda45e2bd687a54f6b490
KDED_STARTED_BY_KDEINIT=1
QT4_IM_MODULE=ibus
LESSOPEN=| /usr/bin/lesspipe %s
TEXTDOMAIN=im-config
PROFILEHOME=
XDG_RUNTIME_DIR=/run/user/1000
DISPLAY=:0
QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins:/lib/kde5/plugins/
XDG_CURRENT_DESKTOP=KDE
GTK_IM_MODULE=xim
LESSCLOSE=/usr/bin/lesspipe %s %s
PAM_KWALLET_LOGIN=/tmp//myuser.socket
TEXTDOMAINDIR=/usr/share/locale/
XAUTHORITY=/tmp/xauth-1000-_0
_=/usr/bin/printenv

Last edited by timorei on Wed Mar 04, 2015 9:40 am, edited 1 time in total.
User avatar
david_edmundson
KDE Developer
Posts
359
Karma
1
OS
sudo -E would probably work.
It copies the env, including the all important
KDE_FULL_SESSION=true
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS
testing...

Code: Select all
~ $ sudo -E kate
kf5.kiconthemes: "Theme tree: (Breeze)"
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
"Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)"



Code: Select all
XDG_VTNR=1
SSH_AGENT_PID=1666
XDG_SESSION_ID=2
CLUTTER_IM_MODULE=xim
GPG_AGENT_INFO=/tmp/gpg-CO4LG2/S.gpg-agent:1667:1
SHELL=/bin/bash
TERM=xterm
XDG_SESSION_COOKIE=cbe9acccc64f4f98dd8b693c54f086b2-1425454224.215428-671571432
KONSOLE_DBUS_SERVICE=:1.92
KONSOLE_PROFILE_NAME=Shell
GS_LIB=/home/myuser/.fonts
WINDOWID=16777222
SHELL_SESSION_ID=976b536a6db54000ab54197ff17193be
XDG_SESSION_CLASS=user
KDE_FULL_SESSION=true
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
DROPBOX_USE_LIBAPPINDICATOR=1
SSH_AUTH_SOCK=/tmp/ssh-RnEY4FmKCFMr/agent.1616
SESSION_MANAGER=local/easys:@/tmp/.ICE-unix/1815,unix/easys:/tmp/.ICE-unix/1815
DEFAULTS_PATH=/usr/share/gconf/plasma.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
DESKTOP_SESSION=plasma
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
QT_IM_MODULE=ibus
PWD=/home/myuser
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=ibus
KONSOLE_DBUS_WINDOW=/Windows/1
LANG=de_DE.UTF-8
KDE_SESSION_UID=1000
MANDATORY_PATH=/usr/share/gconf/plasma.mandatory.path
PS1=\w $
KONSOLE_DBUS_SESSION=/Sessions/1
XDG_SEAT=seat0
COLORFGBG=0;15
HOME=/home/myuser
SHLVL=1
KDE_SESSION_VERSION=5
LANGUAGE=de:en_US
XCURSOR_THEME=breeze_cursors
LOGNAME=root
XDG_SESSION_DESKTOP=KDE
XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-pK1lKBHCeI,guid=0e50f1adc2ebda45e2bd687a54f6b490
KDED_STARTED_BY_KDEINIT=1
QT4_IM_MODULE=ibus
LESSOPEN=| /usr/bin/lesspipe %s
TEXTDOMAIN=im-config
PROFILEHOME=
XDG_RUNTIME_DIR=/run/user/1000
DISPLAY=:0
QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins:/lib/kde5/plugins/
XDG_CURRENT_DESKTOP=KDE
GTK_IM_MODULE=xim
LESSCLOSE=/usr/bin/lesspipe %s %s
PAM_KWALLET_LOGIN=/tmp//myuser.socket
TEXTDOMAINDIR=/usr/share/locale/
XAUTHORITY=/tmp/xauth-1000-_0
_=/usr/bin/sudo
USERNAME=root
SUDO_COMMAND=/usr/bin/printenv
SUDO_USER=myuser
SUDO_UID=1000
SUDO_GID=1000
mgraesslin
KDE Developer
Posts
572
Karma
7
OS
well it boils down to: don't combine sudo with GUI. It's evil and starts to fight back :-P

more seriously: kdesudo should probably changed to pass along KDE_FULL_SESSION
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS
Using this quite often to work on system (config) files.

What would be the best solution to open files as root?
Would my solution be to set the environment variable for root?
User avatar
david_edmundson
KDE Developer
Posts
359
Karma
1
OS
>What would be the best solution to open files as root?

sudoedit that I posted earlier.
It's better for numerous reasons.
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS
As reported: sudo -E kate test.txt

Code: Select all
~ $ sudo -E kate test.txt
kf5.kiconthemes: "Theme tree: (Breeze)"
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.Disconnected", "Not connected to D-Bus server")
"Session bus not found
To circumvent this problem try the following command (with Linux and bash)
export $(dbus-launch)"
~ $

Just... shows up for a splitsecond then gone.

I guess I'll stick to the all powerfull sudo vim. ;)
User avatar
david_edmundson
KDE Developer
Posts
359
Karma
1
OS
sudoedit and sudo -E are not the same things.

This one

Code: Select all
VISUAL=kwrite sudoedit /etc/somefile
User avatar
timorei
Registered Member
Posts
19
Karma
0
OS
Ah ok - will take a look. Thanks. See what happens if one gets used to something as trivial as vim? *cough*

Thanks a lot.
wolfi323
Registered Member
Posts
1129
Karma
11
OS
"kdesu kwrite" should work as well, I suppose. (note: kdesu, not kdesudo)

At least it does here in openSUSE. I have no idea whether this is installed by default in Kubuntu or not, though. It's in the package kde-cli-tools5 here.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]