diff --git a/.pybuild/cpython3_3.11/.pydistutils.cfg b/.pybuild/cpython3_3.11/.pydistutils.cfg new file mode 100644 index 0000000..4a266c3 --- /dev/null +++ b/.pybuild/cpython3_3.11/.pydistutils.cfg @@ -0,0 +1,10 @@ +[clean] +all=1 +[build] +build_lib=/home/etapadmin/Masaüstü/eta-menu/.pybuild/cpython3_3.11/build +[install] +force=1 +install_layout=deb +install_scripts=$base/bin +install_lib=/usr/lib/python3.11/dist-packages +prefix=/usr diff --git a/data/eta-menu.desktop b/data/eta-menu.desktop new file mode 100644 index 0000000..a407e25 --- /dev/null +++ b/data/eta-menu.desktop @@ -0,0 +1,9 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Type=Application +Name=Eta Menu +Comment=Eta Menu Ayarları +Exec=cinnamon-settings applets eta-menu@karahan +Icon=eta-menu +Categories=Settings; + diff --git a/data/eta-menu@karahan/applet.js b/data/eta-menu@karahan/applet.js new file mode 100644 index 0000000..91163c8 --- /dev/null +++ b/data/eta-menu@karahan/applet.js @@ -0,0 +1,123 @@ +const Applet = imports.ui.applet; +const Settings = imports.ui.settings; +const Main = imports.ui.main; +const GLib = imports.gi.GLib; + +const St = imports.gi.St; +const Gio = imports.gi.Gio; + + +class EtaMenuApplet extends Applet.TextIconApplet { + constructor(metadata, orientation, panelHeight, instanceId) { + super(orientation, panelHeight, instanceId); + + this.settings = new Settings.AppletSettings(this, metadata.uuid, instanceId); + + this.settings.bind("menu-command", "menuCommand"); + this.settings.bind("use-icon", "useIcon", this._updateAppearance.bind(this)); + this.settings.bind("use-label", "useLabel", this._updateAppearance.bind(this)); + this.settings.bind("icon-name", "iconName", this._updateAppearance.bind(this)); + this.settings.bind("label-text", "labelText", this._updateAppearance.bind(this)); + this.settings.bind("overlay-key", "overlayKey", this._updateKeybinding); + this.settings.bind("icon-size", "menuIconSize", this._updateAppearance.bind(this)); + + + this.set_applet_tooltip("Eta Menu"); + + this._updateAppearance(); + this._updateKeybinding(); + + } + +_updateKeybinding() { + global.logError("tuşa basıldı boş!"); + if (this._hotkeyId) + Main.keybindingManager.removeHotKey(this._hotkeyId); + + this._hotkeyId = Main.keybindingManager.addHotKey( + "eta-menu-overlay-" + this.instance_id, + this.overlayKey, + () => { + this.on_applet_clicked(); + } + ); +} + +_updateAppearance() { + // Label fallback + let text = (this.useLabel && this.labelText && this.labelText.length > 0) + ? this.labelText + : (this.useLabel ? "Menu" : ""); + + // 1️⃣ Sadece metin + if (!this.useIcon && this.useLabel) { + this._applet_icon_box.hide(); + this.set_applet_label(text); + } + // 2️⃣ Sadece ikon + else if (this.useIcon && !this.useLabel) { + this.set_applet_label(""); + this._applet_icon_box.show(); + let iconToUse = (this.iconName && this.iconName.includes("-symbolic")) + ? this.iconName + : "eta-menu-symbolic"; + + this.set_applet_icon_symbolic_name(iconToUse); + + + // Boyutu uygula + if (this._applet_icon_box.get_children().length > 0) { + this._applet_icon_box.get_children()[0].set_icon_size(this.menuIconSize); + } + } + // 3️⃣ İkon + metin + else if (this.useIcon && this.useLabel) { + this._applet_icon_box.show(); + this.set_applet_label(text); + + let iconToUse = (this.iconName && this.iconName.includes("-symbolic")) + ? this.iconName + : "eta-menu-symbolic"; + + this.set_applet_icon_symbolic_name(iconToUse); + + // Boyutu uygula + if (this._applet_icon_box.get_children().length > 0) { + this._applet_icon_box.get_children()[0].set_icon_size(this.menuIconSize); + } + } + // 4️⃣ Ne ikon ne metin seçili → fallback ikon + else { + this._applet_icon_box.show(); + this.set_applet_icon_symbolic_name("eta-menu-symbolic"); + this.set_applet_label(""); + + if (this._applet_icon_box.get_children().length > 0) { + this._applet_icon_box.get_children()[0].set_icon_size(this.menuIconSize); + } + let fullIcon = new St.Icon({ + gicon: Gio.icon_new_for_string(this.path + "/icons/eta-menu.svg"), + icon_size: this.menuIconSize +}); +this._applet_icon_box.add_child(fullIcon); + + } + + // Tooltip + this.set_applet_tooltip(text); +} + + + on_applet_clicked() { + if (!this.menuCommand) { + global.logError("menuCommand boş!"); + return; + } + GLib.spawn_command_line_async(this.menuCommand); + } +} + +function main(metadata, orientation, panelHeight, instanceId) { + return new EtaMenuApplet(metadata, orientation, panelHeight, instanceId); +} + diff --git a/data/eta-menu@karahan/metadata.json b/data/eta-menu@karahan/metadata.json new file mode 100644 index 0000000..b9e56ac --- /dev/null +++ b/data/eta-menu@karahan/metadata.json @@ -0,0 +1,8 @@ +{ + "uuid": "eta-menu@karahan", + "name": "Eta Menu", + "description": "Eta Menu (Cinnamon tarzı)", + "version": 1, + "max-instances": 1 +} + diff --git a/data/eta-menu@karahan/settings-schema.json b/data/eta-menu@karahan/settings-schema.json new file mode 100644 index 0000000..c3b427c --- /dev/null +++ b/data/eta-menu@karahan/settings-schema.json @@ -0,0 +1,49 @@ +{ + "menu-command": { + "type": "entry", + "default": "/usr/bin/eta-menu", + "description": "Çalıştırılacak komut" + }, + "use-icon": { + "type": "checkbox", + "default": true, + "description": "Simge göster" + }, + + "icon-name": { + "type": "iconfilechooser", + "default": "start-here", + "description": "Simge", + "dependency": "use-icon" + }, +"icon-size": { + "type": "spinbutton", + "default": 32, + "min": 16, + "max": 96, + "step": 1, + "units": "px", + "description": "Simge boyutu (px)", + "dependency": "use-icon" +}, + + "use-label": { + "type": "checkbox", + "default": true, + "description": "Metin göster" + }, + + "label-text": { + "type": "entry", + "default": "Menu", + "description": "Metin", + "dependency": "use-label" + }, + "overlay-key" : { + "type" : "keybinding", + "description" : "Keyboard shortcut to open and close the menu", + "default" : "Super_L::Super_R" + } + +} + diff --git a/debian/changelog b/debian/changelog index 2e959ff..ad36aeb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -eta-menu (1.2.0) unstable; urgency=medium +eta-menu (1.2.1) unstable; urgency=medium * Add PowerOff Dialog for power_off button * Update po/files diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..5ab3d57 --- /dev/null +++ b/debian/files @@ -0,0 +1,2 @@ +eta-menu_1.2.1_all.deb x11 optional +eta-menu_1.2.1_amd64.buildinfo x11 optional diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/eta-menu_1.2.1_all.deb b/eta-menu_1.2.1_all.deb new file mode 100644 index 0000000..10f3abd Binary files /dev/null and b/eta-menu_1.2.1_all.deb differ diff --git a/setup.py b/setup.py index 5a6da9d..8c46575 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,19 @@ def create_mo_files(): ("/usr/share/icons/hicolor/scalable/apps/", ["data/eta-menu.svg", "data/eta-menu-panel-symbolic.svg"]), + + ("/usr/share/cinnamon/applets/eta-menu@karahan/", + ["data/eta-menu@karahan/metadata.json"]), + + ("/usr/share/cinnamon/applets/eta-menu@karahan/", + ["data/eta-menu@karahan/settings-schema.json"]), + + ("/usr/share/cinnamon/applets/eta-menu@karahan/", + ["data/eta-menu@karahan/applet.js"]), + + ("/usr/share/applications/", + ["data/eta-menu.desktop"]), + ("/etc/eta/eta-menu/", ["data/favorites.json"]), ("/etc/xdg/autostart/", diff --git a/src/__version__ b/src/__version__ new file mode 100644 index 0000000..cb174d5 --- /dev/null +++ b/src/__version__ @@ -0,0 +1 @@ +1.2.1 \ No newline at end of file