Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tuned-gui package not working in Linux Mint #441

Open
fmresearchnovak opened this issue May 21, 2022 · 5 comments
Open

tuned-gui package not working in Linux Mint #441

fmresearchnovak opened this issue May 21, 2022 · 5 comments

Comments

@fmresearchnovak
Copy link

fmresearchnovak commented May 21, 2022

I have a relatively clean / fresh install of Linux Mint 20.3 Una. I installed the package tuned-gtk (Version: 2.10.0-1) when I try to run it I get this error:

me@my-machine$ tuned-gui 
/usr/sbin/tuned-gui:152: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "name" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  action_group = Gtk.ActionGroup('my_actions')
Traceback (most recent call last):
  File "/usr/sbin/tuned-gui", line 1034, in <module>
    base = Base()
  File "/usr/sbin/tuned-gui", line 281, in __init__
    for plugin in sorted(self.plugin_loader.plugins):
TypeError: '<' not supported between instances of 'SysctlPlugin' and 'USBPlugin'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_sbin_tuned-gui.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/sbin/tuned-gui", line 1034, in <module>
    base = Base()
  File "/usr/sbin/tuned-gui", line 281, in __init__
    for plugin in sorted(self.plugin_loader.plugins):
TypeError: '<' not supported between instances of 'SysctlPlugin' and 'USBPlugin'

me@my-machine$

I added some code to the file /usr/lib/python3/dist-packages/tuned/plugins/base.py Specifically I added this snippet to the bottom

	# converts this object's name to a number used in __lt__ and __eq__
	# ultimately used in sorting
	def __int__(self):
		name_str = self.name
		digits_str = ""
		for letter in name_str:
			ascii_val = ord(letter)
			digits_str = str(ascii_val) + digits_str
			
		return int(digits_str)
		
		
	def __lt__(self, other):
		return int(self) < int(other)
		
		
	def __eq__(self, other):
		return int(self) == int(other)
		
		
	def __hash__(self):
		# probably not a good hash function for this object, WHATEVER!
		#print("hash(" + str(self.name) + ")")
		return hash(self.name)

Program now works / runs correctly on mysystem.

@fmresearchnovak
Copy link
Author

base.py.txt

@torqx
Copy link

torqx commented Dec 1, 2023

@fmresearchnovak:
Thank YOU Very Much. This was a solution to a similar problem on MxLinux 19.
The GUI is now working.

@yarda
Copy link
Contributor

yarda commented Dec 2, 2023

Thanks, for the info. Is it worth fixing upstream? Because IMHO the current Linux Mint is 21.2 and the current version of TuneD is 2.21.0. I wonder whether it's still broken with the recent versions. If not, it's probably not worth fixing, because the fix would go out not sooner than in TuneD 2.21.1 or 2.22.0 and I think it would very probably not get into Mint < 21.

@fmresearchnovak
Copy link
Author

Seems like it's worth fixing upstream to me!

@torqx
Copy link

torqx commented Dec 3, 2023

@yarda, @fmresearchnovak..
Yes, I concur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants