Mini Dzidziso: Kugadzira Applets yeCinnamon

Tichagadzira applet yakapusa ye Cinnamon. Kutanga, tinofanira kuziva izvozvo Cinnamon inopa akasiyana maapplet:

  • ChinyorwaApplet (kuratidza chirafu pane pani)
  • IconApplet (kuratidza icon pane pani)
  • ChinyorwaIconApplet (inoratidza zvese icon uye chiraira pane iyo pani)
  • applet (yevanogadzira hardcore, iyo inoratidza isina chinhu bhokisi iwe unogona kuzvizadza wega)

Mune ino dzidziso, isu tinongoda kuratidza icon pane iyo pani, saka isu tinoshandisa iyo "IconApplet". Kuti tigadzirise applet yedu ku Sinamoni kana Gnome isu tinofanirwa kuziva nekuziva zvimwe zvirongwa muJavascript

Nzvimbo yekodhi yedu.

Kutanga, ngatitarisei iko kune faira redu. Nzvimbo yeapplet yedu inopihwa kukero dzinotevera:

/.local/share/cinnamon/applets kana in /usr/share/cinnamon/applets

Cinnamon_Applet

Mafaira anoumba Applet yedu.

Cinnamon_Applet2

Isu tinoenderera nekutsanangura applet.js

kodhi

applet.js

 

Zvino ngatitangei kuona kodhi ye applet.js uye tsanangura imwe neimwe yemitsara yayo:

applet.js kodhi kutanga

applet kodhi

JavaScript kodhi

Ngatione imwe neimwe yemitsara yekodhi yedu yapfuura

const Lang = kupinza.lang; / * Isu tinokumbira maGtk neLang maraibhurari, iwo chikamu chekutanga chechero GNOME application, vanotibvumidza kuti tigadzire windows, mawijeti uye tivabatanidze. / * Tinokumbira raibhurari yeApplet iyo inotibvumidza kuti tigadzire applet yeCinnamon neGnome uye panguva imwechete inotipa zvivakwa nemabasa ayo. * / Const GLib = imports.gi.GLib; / * GLib raibhurari yekubatsira, inotibvumidza kuita zvinhu muGNOME, semuenzaniso taura kuti kupi hellognome.html faira, raibhurari iri mukutarisira zviratidzo. * / Const Gettext = imports.gettext.domain ('sinamoni -applets '); const _ = Gettext.gettext; // Gettext raibhurari iyo inotibvumidza isu kuendesa hunhu hweCinnamon desktop. const PopupMenu = imports.ui.popupMenu; / * PopupMenu raibhurari yekushandisa maneja wemenyu, inotibvumidza kukumbira iyo popup-menyu widget inowanzo shandiswa mumaapplet. * / Basa MyApplet (maitiro) {this._init (maitiro); }

Iyo inovaka applet yedu inotsanangurwa pazasi, ngatitarisei kuKirasi yedu kana Kirasi:

gjs kirasi

Isu tinoenderera mberi nerondedzero yemumwe nemumwe wezvirevo

MyApplet.prototype = {__proto__: Applet.IconApplet.prototype, // Tinotsanangura Chikamu chedu kana Kirasi _init: basa (maitiro) / * Isu tinoseta maitiro kuburikidza neCinnamon. Isu tinogadza kuti iro jira reapplet riri kumusoro kana kuzasi (izvi zvine chekuita nekwakatenderedzwa kwemaapplet menyu). * / Edza {// Ita chimwe chinhu} Bata (e) {// Chii chinoitika kana kukanganisa kukaitika } / * Isu tinoshandisa kuyedza / kubata kubata chero zvikanganiso zvinogona kuitika muapplet yedu uye kuona kuti zvakanyorwa kune yepasi rose yekukanganisa log. Nenzira iyi, kana paine chinokanganisika, unogona kuona iko kukanganisa mukutarisa Girazi: Dhinda Alt F2, nyora "lg" wobva wadzvanya pane "zvikanganiso" tab. * / This.menuManager = new PopupMenu.PopupMenuManager (iyi); // Gadzira popup-menyu uye gadzira menyu menyu iyi.menu = new Applet.AppletPopupMenu (iyi, maitiro); // isu tinogadzira menyu. iyi.menuManager.addMenu (iyi.menu); // Isu tinowedzera menyu kune popup-menyu. ichi.makeMenu (); // menuitem makeMenu, isu tinogadzira iyo menuitem inonzi makeMenu. izvi.buildContextMenu (); // kuvakaContextMenu, isu tinogadzira iyo menuitem inonzi buildContextMenu. this.set_applet_icon_name ("dhairekitori"); / * Isu tinogadzira iyo applet, iyi kesi yakasarudzika, iyo icon yakasarudzwa ndiyo folda kana dhairekitori, tinogona zvakare kumisikidza chinyorwa applet kana tichida. * /

Semuenzaniso chinja zita rekuti "dhairekitori" rive "chinongedzo", "docky" kumisikidza mazita matsva ona zita reGnome kana Cinnamon icons kana chero imwe icon icon, enda kukero.

/usr/share/icons

Z7qwRdp

 

this.set_applet_tooltip (_ ("Dzvanya apa kuti uuraye hwindo")); // Kubata kubata chero mhosho dzinogona kuitika muapplet yedu. bata (e) {global.logError (e); } makeMenu: function () {this.menu.addMenuItem (new PopupMenu.PopupMenuItem ("Test Message", {reactive: true})); }, / * Isu tinotsanangura zita reiyo makeMenu menuitem nemahunhu ayo. Mune ino kesi chitupa ndiTest Meseji ". Tichatsanangura {reactive: true} Isu tinosimbisa kuti kumashure kwemenuitem kuchachinja kana pointer ichipfuura pamusoro pemenuuitem kuburikidza ichokwadi kana chiri chenhema zvinopesana zvinoitika. * / BuildContextMenu: function . "on_applet_clicked: function (event) {this.menu.toggle ();} // Chiratidzo chinobudiswa neapplet, kudaidza popup-menyu function main (metadata, orientation) {let myApplet = new MyApplet (orientation); myApplet;} / * Pakupedzisira, isu tinongofanirwa kuwedzera "main" basa, iro rinogona kunge rakafanana muapplet yega yega, chiitiko cheapplet yedu inogadzirwa ndokudzorerwa kuCinnamon. * / // Isu tinovhara loop kudzoka myApplet;

Isu tinoenderera nekutsanangura metadata.json

LP0ol8b

 

Screenshot - 140314 - 21:11:34

"yakapedzisira kugadziriswa": "1331990905", // Yekupedzisira edition. "tsananguro": "Dzvanya paapplet kuratidza tsika yakatsanangurwa gtk menyu", // Tsananguro yeApplet. "icon": "docky", // Mifananidzo yakashandiswa kutsananguro yeapplet. Semuenzaniso chinja zita rekuti "docky" rive "terminal", "folda". "uuid": "nhema" // Dhairekitori uko kwedu metadata.json faira inosanganisirwa "zita": "Tsika gtk menyu" // Applet zita.

Cherechedza: Kuti uise mazita matsva ona zita reGnome kana Cinnamon icons kana chero imwe theme icon, enda kukero yefaira kero

/usr/share/icons

Mufananidzo weakagadzirwa Applet

  lKxpdkS

Qt, Gtk, Vala uye mimwe mitauro inoshandiswa kugadzira applet yeCinnamon kana Gnome

Ngatione nzvimbo yeapplet yedu yeCinnamon

Nzvimbo yeapplet yedu inopihwa kukero dzinotevera:

/.local/share/cinnamon/applets

kana in

/usr/share/cinnamon/applets

Nerd

Kuumbwa kweapplet yedu

Beta

 

Isu tinoenderera nekutsanangura applet.js 

kodhi

applet.js

Kutanga iyo applet.js kodhi

Screenshot - 140314 - 21:30:48

Kupera kweapplet.js

Iye zvino ngatitangei kuona iyo applet.js kodhi uye tsanangura zvirevo zvayo.

Iyo kodhi yakanyorwa inenge yakafanana neiyo yapfuura muenzaniso yakanyorwa neJavascript.
Chete chiratidzo chashandurwa, chinozodaidza yedu inogoneka.

on_applet_clicked: function (event) {GLib.spawn_command_line_async (GLib.get_home_dir () + '/ .local/share/cinnamon/applets/Qt4/Qtmenu/Menu'); }

Yedu inogadziriswa inogona kunyorwa neQt, Gtk, Gtkmm, wxWidget, Vala, nezvimwe. mitauro inogona kuzvimiririra. Yedu auto-inoitwa inonzi Menyu uye iri muQtmenu folda.

Beta

Tinogona zvakare kushandisa mimwe mitauro yekuronga ine zvisungo zveGtk yakadaro inyaya yePyGTK, Ruby Gtk, Perl Gtk, nezvimwe. iyo inogona kushandiswa kushandisa script kuita kodhi yakanyorwa mumitauro iyoyo. Iwo musimboti unogara wakafanana kufona zvirongwa, gadzira popup-menyu uye popup-hwindo zvinoenderana nezvatinoda.

Ngatione kodhi yeyedu auto-inogadziriswa yakanyorwa neQt

qt

Isu tinoenderera nekutsanangura metadata.json

LP0ol8b

mongo

Iyo kodhi yakanyorwa nenzira imwecheteyo nemuenzaniso wapfuura

Mufananidzo weApplet wakagadzirwa neQt

chii

 

Mufananidzo weApplet wakagadzirwa neGtk 3.10

Ini ndinokusiira iwe diki muenzaniso weapplet iyo inoshandisa inoitisa yakanyorwa muGtk, mune ino kesi isu tinotora myGtkMenu menyu inoshandiswa muOpenBox.

Iyo yekuzvitonga yega menyu.

megtk

Dhawunirodha dzidziso uye mienzaniso


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Makomendi gumi, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira iyo data: Miguel Ángel Gatón
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   Aioria akadaro

    Chinyorwa chinonakidza ...

    1.    marianogaudix akadaro

      Ndatenda . Changu ndechekuti tinodzidza zvishoma mazuva ese.

  2.   Danie akadaro

    Zvakanakisa, ndinozvida, ini ndaigara ndichida kuziva kuti aya maapplet akagadzirwa sei

  3.   Ngirozi Araya akadaro

    Kugadziriswa kudiki. Gettext hapana chakanangana neCinnamon sezvazvinotaura muchinyorwa, raibhurari inoita kuti otomatiki dudziro ibvire uye kubva kumatemplate.

  4.   msx akadaro

    Yakanaka kwazvo dzidziso uye zvese izvo asi chakakosha chinhu hachina kuiisa: chinongedzo kune Wallpaper?

    1.    marianogaudix akadaro

      Dhawunorodha iyo Linux Mint 16 Petra mifananidzo.
      Iyo pasuru inonzi mint-kumashure-petra: http://packages.linuxmint.com/list.php?release=Petra

  5.   Tesla akadaro

    Chinyorwa chinonakidza kwazvo. Chokwadi ndechekuti ini ndaigara ndichifunga kuti maapplet aya akagadzirwa sei. Pamwe ini ndinokurudzirwa kugadzira mini-player applet yeMPD kana chimwe chinhu chakafanana.

    Ndinotenda nekugovana!

  6.   Matiyasi akadaro

    Zvakanakisa, ndiri kungofunga nzira yekushandura iyo sinamoni nm-applet (network maneja), kuti ishandure ruvara kana ndisina internet yekuwana, (ndine wifi kadhi), uye izvi zvinondibatsira kuzvitenderedza zvishoma.

  7.   matiasbatero17 akadaro

    Haa pane Marian, handina kuziva kuti urikutumira pano. Zvido.

    1.    marianogaudix akadaro

      Paunenge uchifamba, Matute… .. ndinogara ndichifamba ndichitenderedza zvikamu izvi. Mufaro

  8.   lolbimbo akadaro

    Chinyorwa chakanaka.

  9.   honovan akadaro

    faira risina kuwanikwa rakamiswa nekuda kwekutyora kodzero.

    Zvandiri kureva ndezvekuti kana iwe unayo ipapo, unogona kuiisa zvakare ???. Ndokumbirawo.

    waita hako.

bool (chokwadi)