Skip to content

Commit

Permalink
add icon to destop entry and about dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeyg56 committed Feb 12, 2023
1 parent 4379024 commit 4ddbb9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions auto-cpufreq-installer
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function install {
mkdir -p /usr/local/share/auto-cpufreq/
cp -r scripts/ /usr/local/share/auto-cpufreq/
cp -r images/ /usr/local/share/auto-cpufreq/
cp images/icon.png /usr/share/pixmaps/auto-cpufreq.png

# this is necessary since we need this script before we can run auto-cpufreq itself
cp scripts/auto-cpufreq-venv-wrapper /usr/local/bin/auto-cpufreq
Expand Down
8 changes: 7 additions & 1 deletion auto_cpufreq/gui/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,20 @@ def __init__(self, parent):
self.box.set_spacing(10)
self.add_button("Close", Gtk.ResponseType.CLOSE)
self.set_default_size(400, 350)

img_buffer = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename="/usr/local/share/auto-cpufreq/images/icon.png",
width=150,
height=150,
preserve_aspect_ratio=True)
self.image = Gtk.Image.new_from_pixbuf(img_buffer)
self.title = Gtk.Label(label="auto-cpufreq", name="bold")
self.version = Gtk.Label(label=app_version)
self.python = Gtk.Label(label=f"Python {pl.python_version()}")
self.github = Gtk.Label(label="https://github.com/AdnanHodzic/auto-cpufreq")
self.license = Gtk.Label(label="Licensed under LGPL3", name="small")
self.love = Gtk.Label(label="Made with <3", name="small")

self.box.pack_start(self.image, False, False, 0)
self.box.pack_start(self.title, False, False, 0)
self.box.pack_start(self.version, False, False, 0)
self.box.pack_start(self.python, False, False, 0)
Expand Down
1 change: 1 addition & 0 deletions scripts/auto-cpufreq-gtk.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Name=auto-cpufreq
Exec=auto-cpufreq-gtk
Type=Application
Terminal=false
Icon=auto-cpufreq
Categories=System;

0 comments on commit 4ddbb9c

Please sign in to comment.