You are not logged in.

#1 2024-06-03 18:14:40

aljustiet
Member
Registered: 2024-02-09
Posts: 42

[SOLVED] The gtk apps don't ask for the root password.

When I run the:

timeshift-gtk

I'm getting this output

timeshift-gtk
E: Admin access is required to backup and restore system files.
Please re-run the application as admin (using 'sudo' or 'su')

(timeshift-gtk:93742): Gtk-CRITICAL **: 23:13:16.919: gtk_icon_theme_load_icon_for_scale: assertion 'GTK_IS_ICON_THEME (icon_theme)' failed

** (timeshift-gtk:93742): CRITICAL **: 23:13:16.919: gee_abstract_collection_get_size: assertion 'self != NULL' failed

I guess it's somehow related to the polkit. Any idea how can I fix it?

Last edited by aljustiet (2024-06-04 13:30:48)

Offline

#2 2024-06-03 18:44:44

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,924

Re: [SOLVED] The gtk apps don't ask for the root password.

the output from the program you ran wrote:

Please re-run the application as admin (using 'sudo' or 'su')

Last edited by ewaller (2024-06-03 18:45:12)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#3 2024-06-03 18:49:15

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

ewaller wrote:
the output from the program you ran wrote:

Please re-run the application as admin (using 'sudo' or 'su')

It's gtk application. I want to be able to run it from the applications launcher. In distributions like Linux mint it asks for the password when I launch it.

Last edited by aljustiet (2024-06-03 18:50:10)

Offline

#4 2024-06-03 19:47:19

Funny0facer
Member
From: Germany
Registered: 2022-12-03
Posts: 86

Re: [SOLVED] The gtk apps don't ask for the root password.

what desktop environment do you use?
It works fine for me on plasma.

Offline

#5 2024-06-03 19:58:20

loqs
Member
Registered: 2014-03-06
Posts: 17,719

Re: [SOLVED] The gtk apps don't ask for the root password.

What groups is the user you started timeshift-gtk a member of? From the contents of /usr/share/polkit-1/actions/in.teejeetech.pkexec.timeshift.policy

<policyconfig>
<vendor>Tony George</vendor>
<vendor_url>https://github.com/teejee2008</vendor_url>
<action id="in.teejeetech.pkexec.timeshift-gtk">
<message gettext-domain="timeshift">Timeshift</message>
<description>Run Timeshift as Administrator</description>
<icon_name>timeshift</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/timeshift-gtk</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
<action id="in.teejeetech.pkexec.timeshift">
<message gettext-domain="timeshift">
Authentication is required to run Timeshift as Administrator
</message>
<description>Run Timeshift as Administrator</description>
<icon_name>timeshift</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/timeshift</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

your guess it is polkit related appears correct.

Offline

#6 2024-06-03 21:21:30

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

Funny0facer wrote:

what desktop environment do you use?
It works fine for me on plasma.

I use Hyprland.

Offline

#7 2024-06-03 21:23:19

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

loqs wrote:

What groups is the user you started timeshift-gtk a member of? From the contents of /usr/share/polkit-1/actions/in.teejeetech.pkexec.timeshift.policy

<policyconfig>
<vendor>Tony George</vendor>
<vendor_url>https://github.com/teejee2008</vendor_url>
<action id="in.teejeetech.pkexec.timeshift-gtk">
<message gettext-domain="timeshift">Timeshift</message>
<description>Run Timeshift as Administrator</description>
<icon_name>timeshift</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/timeshift-gtk</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
<action id="in.teejeetech.pkexec.timeshift">
<message gettext-domain="timeshift">
Authentication is required to run Timeshift as Administrator
</message>
<description>Run Timeshift as Administrator</description>
<icon_name>timeshift</icon_name>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/timeshift</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

your guess it is polkit related appears correct.

https://rentry.co/9pgsubxs

Offline

#8 2024-06-03 21:26:51

loqs
Member
Registered: 2014-03-06
Posts: 17,719

Re: [SOLVED] The gtk apps don't ask for the root password.

What is the output when you run `groups` as the same user you have the issue running `timeshift-gtk` as?

Offline

#9 2024-06-03 21:28:19

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

loqs wrote:

What is the output when you run `groups` as the same user you have the issue running `timeshift-gtk` as?

https://rentry.co/k36vzr3a

Offline

#10 2024-06-03 21:33:27

loqs
Member
Registered: 2014-03-06
Posts: 17,719

Re: [SOLVED] The gtk apps don't ask for the root password.

Do you have polkit and a polkit authentication agent installed?

pacman -Qs polkit

Offline

#11 2024-06-03 21:34:24

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

loqs wrote:

Do you have polkit and a polkit authentication agent installed?

pacman -Qs polkit
aljustiet@arch ~> pacman -Q | grep polkit
lib32-polkit 124-1
polkit 124-2
polkit-gnome 0.105-10
polkit-kde-agent 6.0.5-1
polkit-qt6 0.200.0-1

Offline

#12 2024-06-03 21:34:53

Funny0facer
Member
From: Germany
Registered: 2022-12-03
Posts: 86

Re: [SOLVED] The gtk apps don't ask for the root password.

Offline

#13 2024-06-03 21:43:02

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

I manually run the

/usr/lib/polkit/polkit-kde-authentication-agent-1

and

hyprctl dispatcher exec /usr/lib/polkit-kde-authentication-agent-1

, then tried to launch the timeshift-gtk, but still have the same result

Offline

#14 2024-06-03 21:50:36

Funny0facer
Member
From: Germany
Registered: 2022-12-03
Posts: 86

Re: [SOLVED] The gtk apps don't ask for the root password.

pkcheck -u -p $$ --enable-internal-agent -a in.teejeetech.pkexec.timeshift-gtk

Offline

#15 2024-06-04 07:40:50

seth
Member
Registered: 2012-09-03
Posts: 53,661

Re: [SOLVED] The gtk apps don't ask for the root password.

I want to be able to run it from the applications launcher.

Run what, how?
The desktop entry in the package runs timeshift-launcher which in turn checks $- and $XDG_SESSION_TYPE to determine what it'll do and either run su, pkexec or su in a terminal.
Punching "timeshift-gtk" into a terminal will not work resp. consistently lead to that result.

If you want to debug the timeshift-launcher script add

exec 1> /tmp/timeshift.dbg 2>&1
set -x

below the shebang and click your icon that doesn't work. Then inspect /tmp/timeshift.dbg

Offline

#16 2024-06-04 07:46:28

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

Funny0facer wrote:
pkcheck -u -p $$ --enable-internal-agent -a in.teejeetech.pkexec.timeshift-gtk

Now I'm having this output:

aljustiet@arch ~> rofi -show drun

(process:8709): Rofi-WARNING **: 12:45:20.673: ABI version of plugin: 'emoji.so' does not match: 00000006 expecting: 00000007
aljustiet@arch ~> localuser:root being added to access control list

(timeshift-gtk:8902): Gtk-WARNING **: 12:45:25.605: cannot open display: 
localuser:root being removed from access control list
access control enabled, only authorized clients can connect
SI:localuser:aljustiet

Offline

#17 2024-06-04 07:57:54

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

seth wrote:

I want to be able to run it from the applications launcher.

Run what, how?
The desktop entry in the package runs timeshift-launcher which in turn checks $- and $XDG_SESSION_TYPE to determine what it'll do and either run su, pkexec or su in a terminal.
Punching "timeshift-gtk" into a terminal will not work resp. consistently lead to that result.

If you want to debug the timeshift-launcher script add

exec 1> /tmp/timeshift.dbg 2>&1
set -x

below the shebang and click your icon that doesn't work. Then inspect /tmp/timeshift.dbg

I have the content I've posted before this one.

Offline

#18 2024-06-04 13:15:35

seth
Member
Registered: 2012-09-03
Posts: 53,661

Re: [SOLVED] The gtk apps don't ask for the root password.

Which is entirely not a trace of the timeshift-launcher script but from https://github.com/linuxmint/timeshift/ … t-launcher it looks like you entered the wayland/pkexec branch but the script doesn't import the relevant environment - this is probably a wayland specific issue.

https://github.com/linuxmint/timeshift/issues/206
Next to just inheriting the entire environment you could adapt https://gist.github.com/AladW/de1c5676d93d05a5a0e1 - obviously don't inherit it from xinit.

Offline

#19 2024-06-04 13:30:30

aljustiet
Member
Registered: 2024-02-09
Posts: 42

Re: [SOLVED] The gtk apps don't ask for the root password.

seth wrote:

Which is entirely not a trace of the timeshift-launcher script but from https://github.com/linuxmint/timeshift/ … t-launcher it looks like you entered the wayland/pkexec branch but the script doesn't import the relevant environment - this is probably a wayland specific issue.

https://github.com/linuxmint/timeshift/issues/206
Next to just inheriting the entire environment you could adapt https://gist.github.com/AladW/de1c5676d93d05a5a0e1 - obviously don't inherit it from xinit.

I created the timeshift.sh shell script that executes the

bash -c 'pkexec env $(env) timeshift-launcher'

, and replaced the Exec line in the desktop file to execute that bash script.

Offline

Board footer

Powered by FluxBB