FS#40975 - [python2][gnome-tweak-tool] Add startup application doesn't work
Attached to Project:
Arch Linux
Opened by Valdemar E. Winther (harrim4n) - Wednesday, 25 June 2014, 19:36 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 02 October 2017, 21:03 GMT
Opened by Valdemar E. Winther (harrim4n) - Wednesday, 25 June 2014, 19:36 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 02 October 2017, 21:03 GMT
|
Details
Description:
Under the tab Startup Applications it is not possible to add a new application. Additional info: * Version : 3.12.0-1 * Clicking the "+" button produces this output: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/gtweak/tweaks/tweak_group_startup.py", line 194, in _on_add_clicked set(self._get_running_executables())) File "/usr/lib/python2.7/site-packages/gtweak/tweaks/tweak_group_startup.py", line 210, in _get_running_executables os.getlogin(),'-o','cmd'], OSError: [Errno 2] No such file or directory * This appears to fix the problem: https://bbs.archlinux.org/viewtopic.php?pid=1414443#p1414443 (I haven't tried it though) Steps to reproduce: * Open gnome-tweak-tool * Go to "Startup Applications" * Try adding an application by clicking the "+" button on the bottom. |
This task depends upon
Closed by Eli Schwartz (eschwartz)
Monday, 02 October 2017, 21:03 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in 2014 via https://bugzilla.gnome.org/show_bug.cgi? id=728231
Monday, 02 October 2017, 21:03 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in 2014 via https://bugzilla.gnome.org/show_bug.cgi? id=728231
os.getlogin() first tries to read /proc/self/loginuid (requiring CONFIG_AUDIT=y, which we don't have) and if that doesn't exist, try to determine the user logged in on the process' controlling terminal by reading utmp. Since processes started from X sessions typically don't have a logged-in controlling terminal (unless started from xterm), the call fails.
Personally, I'd like to have AUDIT back, since I was making use of loginuid myself.
So it was a wontfix upstream since more than 10 years ago. I'd suggest to report to the gnome-tweak-tool upstream, according to the BUGS section of getlogin(3), use getpwuid(geteuid()) instead.
In Python, it would be something like this:
>>> pwd.getpwuid(os.getuid())
pwd.struct_passwd(pw_name='felix', pw_passwd='x', pw_uid=1000, pw_gid=100, pw_gecos='Felix Yan', pw_dir='/home/felix', pw_shell='/bin/bash')
so we can close it