Browse Source

premier commit : export/import depuis DFiso

master
arpinux 2 years ago
commit
44335ebc4c
  1. 4
      .gitignore
  2. 37
      README.md
  3. 567
      changelog
  4. 22
      copyright
  5. 13
      handymenu
  6. 12
      handymenu.1
  7. 11
      handymenu.desktop
  8. 70
      handymenu.equivs
  9. BIN
      handymenu.png
  10. 505
      hm-scripts/handymenu-configuration.py
  11. 385
      hm-scripts/handymenu.py
  12. 27
      hm-scripts/hm-start.py
  13. 648
      hm-scripts/hm_utils.py
  14. BIN
      icons/_icons-src.xcf
  15. BIN
      icons/add_section.png
  16. BIN
      icons/appfinder.png
  17. BIN
      icons/burn.png
  18. BIN
      icons/calcul.png
  19. BIN
      icons/chatons.png
  20. BIN
      icons/circle.png
  21. BIN
      icons/config.png
  22. BIN
      icons/debian.png
  23. BIN
      icons/df-manuel.png
  24. BIN
      icons/epub.png
  25. BIN
      icons/file_documents.png
  26. BIN
      icons/file_download.png
  27. BIN
      icons/file_home.png
  28. BIN
      icons/file_music.png
  29. BIN
      icons/file_pictures.png
  30. BIN
      icons/file_public.png
  31. BIN
      icons/file_trash.png
  32. BIN
      icons/file_videos.png
  33. BIN
      icons/firefox.png
  34. BIN
      icons/forumdf.png
  35. BIN
      icons/handymenu.png
  36. BIN
      icons/image-viewer.png
  37. BIN
      icons/irc.png
  38. BIN
      icons/lcdd.png
  39. BIN
      icons/libreoffice.png
  40. BIN
      icons/logiciels.png
  41. BIN
      icons/music-player.png
  42. BIN
      icons/network.png
  43. BIN
      icons/notes.png
  44. BIN
      icons/printer.png
  45. BIN
      icons/ripper.png
  46. BIN
      icons/scanner.png
  47. BIN
      icons/sources.png
  48. BIN
      icons/terminal.png
  49. BIN
      icons/text-editor.png
  50. BIN
      icons/thunderbird.png
  51. BIN
      icons/transmission.png
  52. BIN
      icons/vlc.png
  53. BIN
      icons/volume.png
  54. BIN
      icons/wikidf.png
  55. BIN
      icons/wikipedia.png
  56. 24
      postinst
  57. 24
      postrm
  58. 8
      readme

4
.gitignore vendored

@ -0,0 +1,4 @@
**/*.pdf
**/*.deb
*.pdf
*.deb

37
README.md

@ -0,0 +1,37 @@
Sources de construction du handymenu.deb
========================================
dépendance :
sudo apt update && sudo apt install equivs-build
manuel :
man equivs-build
commande à lancer pour construire le paquet depuis le dossier source :
equivs-build handymenu.equivs
qui construira le deb dans le dossier. pour l'installer :
dpkg -i handymenu_xx.deb
avec *xx* correspondant à la version du handymenu. pour le tester :
handymenu
pensez à supprimer le dossier de configuration entre les tests :
rm -Rf ~/.handymenu
----------------------------------------
thème d'icônes utilisé :
* les icônes sont réalisées à partir du thème Clarity par Jakub Jankiewicz http://jcubic.pl GPLv3
* les sources intèrent le fichier 'xcf' pour the gimp afin de créer/éditer vos icônes
* le fichier xcf n'est pas intégré dans le paquet handymenu par défaut et contient des icônes en plus
----------------------------------------

567
changelog

@ -0,0 +1,567 @@
handymenu (4.3) buster; urgency=medium
* refonte icons - full independant menu & icon theme
* add icons.xcf sources for the gimp with extra icons
* change labels for one-line behaviour
-- arnault perret <contact@arpinux.org> Wed, 19 Aug 2020 10:11:12 +0200
handymenu (4.2-2) buster; urgency=medium
* add postrm
-- arnault perret <contact@arpinux.org> Tue, 18 Aug 2020 16:12:25 +0200
handymenu (4.2-1) buster; urgency=medium
* delete trads - keep fr
* rearrange icons for independant menu
-- arnault perret <contact@arpinux.org> Mon, 17 Aug 2020 23:24:25 +0200
handymenu (4.2) buster; urgency=medium
* fix max_workers
-- arnault perret <contact@arpinux.org> Mon, 17 Aug 2020 17:23:42 +0200
handymenu (4.1-12) stretch; urgency=medium
* fix lcdd path
-- team dflinux <dflinux@member.fsf.org> Tue, 25 Jul 2017 21:16:28 +0200
handymenu (4.1-11) stretch; urgency=medium
* fix dflinux links
-- team dflinux <dflinux@member.fsf.org> Wed, 14 Jun 2017 16:43:06 +0200
handymenu (4.1-10) stretch; urgency=medium
* retourde synaptic
-- team dflinux <dflinux@member.fsf.org> Sun, 28 May 2017 15:48:55 +0200
handymenu (4.1-9) stretch; urgency=medium
* update launchers for stretch
-- team dflinux <dflinux@member.fsf.org> Thu, 18 May 2017 22:28:56 +0200
handymenu (4.1-8) jessie; urgency=medium
* passage à thunderbird pour le client mail
-- team dflinux <dflinux@member.fsf.org> Fri, 28 Apr 2017 15:40:09 +0200
handymenu (4.1-7) jessie; urgency=medium
* ajout des icones firefox et webbrowser
* browser generique en recents
* browser fixe en internet
-- team dflinux <dflinux@member.fsf.org> Mon, 28 Nov 2016 18:24:48 +0100
handymenu (4.1-6) jessie; urgency=medium
* fix file help link (thx Starsheep)
-- team dflinux <dflinux@member.fsf.org> Thu, 24 Nov 2016 14:08:00 +0100
handymenu (4.1-5) jessie; urgency=medium
* add fbreader in office section
-- team dflinux <dflinux@member.fsf.org> Sat, 22 Oct 2016 14:57:22 +0200
handymenu (4.1-4) jessie; urgency=medium
* coquille
-- team dflinux <dflinux@member.fsf.org> Fri, 21 Oct 2016 04:46:01 +0200
handymenu (4.1-3) jessie; urgency=medium
* replace framasoft by framatalk
* update traductions
* add framatalk icon
-- team dflinux <dflinux@member.fsf.org> Fri, 21 Oct 2016 04:23:07 +0200
handymenu (4.1-2) jessie; urgency=medium
* correction de l'icône des cahiers du débutant
-- team dflinux <dflinux@member.fsf.org> Mon, 29 Aug 2016 00:58:08 +0200
handymenu (4.1-1) jessie; urgency=medium
* nettoyage et passage à Debian-Facile
-- team dflinux <dflinux@member.fsf.org> Wed, 10 Aug 2016 22:57:18 +0200
handymenu (4.0-32) unstable; urgency=medium
* Use hello icon
-- team handylinux <dev@handylinux.org> Tue, 05 Apr 2016 19:39:19 +0200
handymenu (4.0-31) unstable; urgency=medium
* fix typo. thx fibi.
-- team handylinux <dev@handylinux.org> Tue, 05 Apr 2016 18:31:22 +0200
handymenu (4.0-30) unstable; urgency=medium
* skype sucks! No longer in the menu
-- team handylinux <dev@handylinux.org> Tue, 15 Mar 2016 16:58:41 +0100
handymenu (4.0-29) unstable; urgency=medium
* iceweasel -> firefox in default config
-- team handylinux <dev@handylinux.org> Sun, 13 Mar 2016 16:45:28 +0100
handymenu (4.0-28) unstable; urgency=medium
* ajout de la gestion des profils
-- arnault perret <arpinux@member.fsf.org> Mon, 01 Feb 2016 19:19:39 +0100
handymenu (4.0-27) unstable; urgency=medium
* increase window-size when more than 7 tabs
-- arnault perret <arpinux@member.fsf.org> Wed, 27 Jan 2016 22:04:55 +0100
handymenu (4.0-26) unstable; urgency=medium
* ajout de python3-xdg as dep
-- arnault perret <arpinux@member.fsf.org> Wed, 27 Jan 2016 13:21:08 +0100
handymenu (4.0-25) unstable; urgency=medium
* déplacement du about dans la config
* lancement de myhandylinux au clic sur l'icöne
-- arnault perret <arpinux@member.fsf.org> Wed, 27 Jan 2016 13:18:21 +0100
handymenu (4.0-24) unstable; urgency=medium
* fix lancement de fichiers avec espace dans le nom
-- arnault perret <arpinux@member.fsf.org> Tue, 19 Jan 2016 22:23:00 +0100
handymenu (4.0-23) unstable; urgency=medium
* suppression du module des sites visités
-- arnault perret <arpinux@member.fsf.org> Mon, 18 Jan 2016 23:11:11 +0100
handymenu (4.0-22) unstable; urgency=medium
* fix handysoft install popup
* minor trad fix
-- arnault perret <arpinux@member.fsf.org> Mon, 18 Jan 2016 18:43:36 +0100
handymenu (4.0-21) unstable; urgency=medium
* minor form fix for close option case
-- arnault perret <arpinux@member.fsf.org> Sun, 10 Jan 2016 17:19:51 +0100
handymenu (4.0-20) unstable; urgency=medium
* options d'accessibilité passées au thème GTK
-- arnault perret <arpinux@member.fsf.org> Sun, 10 Jan 2016 16:22:44 +0100
handymenu (4.0-19) unstable; urgency=medium
* boutons tous de même taille
* handymenu - large. Préparation pour accessibilité
* convertir aussi la partie sur les raccourcis dossiers
* Pas de floxbox. Navigation facilitée
-- arnault perret <arpinux@member.fsf.org> Sat, 09 Jan 2016 19:58:19 +0100
handymenu (4.0-18) unstable; urgency=medium
* same player, try again
-- arnault perret <arpinux@member.fsf.org> Sat, 09 Jan 2016 13:54:55 +0100
handymenu (4.0-17) unstable; urgency=medium
* fix debuild errors
-- arnault perret <arpinux@member.fsf.org> Sat, 09 Jan 2016 13:51:34 +0100
handymenu (4.0-16) unstable; urgency=medium
* ajout de python2.7 as dep
* fix postinstall script
-- arnault perret <arpinux@member.fsf.org> Sat, 09 Jan 2016 13:47:15 +0100
handymenu (4.0-15) unstable; urgency=medium
* restore fermeture après éxécution
* éléments centrés dans le menu
* mouse scroll restored
-- arnault perret <arpinux@member.fsf.org> Sat, 09 Jan 2016 13:08:28 +0100
handymenu (4.0-14) unstable; urgency=medium
* conversion de la configuration v3 en v4
* abandon des easter eggs
* minor fix
-- arnault perret <arpinux@member.fsf.org> Fri, 08 Jan 2016 21:37:27 +0100
handymenu (4.0-13) unstable; urgency=medium
* installation proposée si appli absente
-- arnault perret <arpinux@member.fsf.org> Tue, 05 Jan 2016 22:39:23 +0100
handymenu (4.0-12) unstable; urgency=medium
* la fenêtre ne clignote plus aux modifs. Merci wlourf
* repartition + homogène, comme avant
-- arnault perret <arpinux@member.fsf.org> Mon, 04 Jan 2016 21:35:49 +0100
handymenu (4.0-11) unstable; urgency=medium
* add mnemonic pour onglets
* use flowbow. thx Starsheep
* largeur de fenêtre adaptée
* maximum d'onglets comprend les modules
* help for drag and drop
* pas à resélectionner la section. Merci wlourf
-- arnault perret <arpinux@member.fsf.org> Sun, 03 Jan 2016 14:23:16 +0100
handymenu (4.0-10) unstable; urgency=medium
* ajout de xdg-utils as dep
* ajout de deux lanceurs pour la première slide
* fix la taille des lanceurs
* fix traduction
-- arnault perret <arpinux@member.fsf.org> Fri, 01 Jan 2016 18:11:42 +0100
handymenu (4.0-9) unstable; urgency=medium
* fix HandyLinux-1.x compatibility
-- arnault perret <arpinux@member.fsf.org> Wed, 30 Dec 2015 22:03:58 +0100
handymenu (4.0-8) unstable; urgency=medium
* ajout de xdg-user-dirs as dep
-- arnault perret <arpinux@member.fsf.org> Wed, 30 Dec 2015 14:30:36 +0100
handymenu (4.0-7) unstable; urgency=medium
* ajout de l'affichage de la conf
* fix largeur
* fix formatage
-- arnault perret <arpinux@member.fsf.org> Wed, 30 Dec 2015 14:27:42 +0100
handymenu (4.0-6) unstable; urgency=medium
* set patch content
-- arnault perret <arpinux@member.fsf.org> Tue, 29 Dec 2015 23:21:00 +0100
handymenu (4.0-5) unstable; urgency=medium
* fix home folder launcher
-- arnault perret <arpinux@member.fsf.org> Tue, 29 Dec 2015 23:19:34 +0100
handymenu (4.0-4) unstable; urgency=medium
* retour du controle clavier pour les onglets
* fix gtk3/gtk2 minor bug
* fix modules
-- arnault perret <arpinux@member.fsf.org> Tue, 29 Dec 2015 23:08:57 +0100
handymenu (4.0-3) unstable; urgency=medium
* ne pas montrer les applications désinstallées
-- arnault perret <arpinux@member.fsf.org> Tue, 29 Dec 2015 15:22:51 +0100
handymenu (4.0-2) unstable; urgency=medium
* set trad
-- arnault perret <arpinux@member.fsf.org> Wed, 09 Dec 2015 02:24:22 +0100
handymenu (4.0-1) unstable; urgency=medium
* passage en gtk3 par thuban
* ajout des modules
* améliorations multiples
-- arnault perret <arpinux@member.fsf.org> Tue, 08 Dec 2015 14:16:42 +0100
handymenu (3.2-6) unstable; urgency=medium
* mémoire de l'option "ne pas fermer"
-- arnault perret <arpinux@member.fsf.org> Fri, 18 Sep 2015 16:18:59 +0200
handymenu (3.2-5) unstable; urgency=medium
* retour du about
-- arnault perret <arpinux@member.fsf.org> Sun, 13 Sep 2015 18:46:35 +0200
handymenu (3.2-4) unstable; urgency=medium
* activation du déplacement du menu au clic-maintenu
* suppression du lien du titre
-- arnault perret <arpinux@member.fsf.org> Sun, 13 Sep 2015 18:15:18 +0200
handymenu (3.2-3) unstable; urgency=medium
* ajout de la possibilité de changer l'icône d'un lanceur par thuban
* ajout de la traduction allemande par arpinux
-- arnault perret <arpinux@member.fsf.org> Fri, 04 Sep 2015 15:13:27 +0200
handymenu (3.2-2) unstable; urgency=medium
* replace exo-open --launch WebBrowser by iceweasel
* set https links
-- arnault perret <arpinux@member.fsf.org> Thu, 27 Aug 2015 19:07:24 +0200
handymenu (3.2-1) unstable; urgency=medium
* ajout de l'option déplacer le lanceur
* ajout de la couleur pour l'onglet sélectionné
* mise à jour de la traduction
-- arnault perret <arpinux@member.fsf.org> Sun, 23 Aug 2015 22:15:54 +0200
handymenu (3.1-1) unstable; urgency=medium
* minor fixes
* stabilisation
-- arnault perret <arpinux@member.fsf.org> Mon, 22 Jun 2015 15:17:01 +0200
handymenu (3.0-26) unstable; urgency=medium
* add icon for 'add section' button
-- arnault perret <arpinux@member.fsf.org> Sat, 20 Jun 2015 20:22:38 +0200
handymenu (3.0-25) unstable; urgency=medium
* fix add section appearance
-- arnault perret <arpinux@member.fsf.org> Sat, 20 Jun 2015 17:13:23 +0200
handymenu (3.0-24) unstable; urgency=medium
* change "add section" to stock button (ask by chalu)
-- arnault perret <arpinux@member.fsf.org> Sat, 20 Jun 2015 16:25:59 +0200
handymenu (3.0-23) unstable; urgency=medium
* enable web links by drag and drop
-- arnault perret <arpinux@member.fsf.org> Sat, 20 Jun 2015 12:07:52 +0200
handymenu (3.0-22) unstable; urgency=medium
* fix .desktop file reading if icon address includes ext.
-- arnault perret <arpinux@member.fsf.org> Thu, 18 Jun 2015 22:48:42 +0200
handymenu (3.0-21) unstable; urgency=medium
* support directories/files shortcuts
-- Thuban <xcartron@april.org> Wed, 17 Jun 2015 15:16:04 +0200
handymenu (3.0-20) unstable; urgency=medium
* intégration dans les dépôts
* numéro de version simple
-- arnault perret <arpinux@member.fsf.org> Mon, 15 Jun 2015 00:18:47 +0200
handymenu (3.0-19) unstable; urgency=medium
* fix translation for es/eo/nl and ru
-- arnault perret <arpinux@member.fsf.org> Sun, 14 Jun 2015 18:52:23 +0200
handymenu (3.0-18) unstable; urgency=medium
* fix translation : rewrote all scripts in english
* fix english and french translation files
* merge changes for es/eo/nl/ru ... waiting for translation
-- arnault perret <arpinux@member.fsf.org> Sun, 14 Jun 2015 04:33:40 +0200
handymenu (3.0-17) unstable; urgency=medium
* fix translation
-- arnault perret <arpinux@member.fsf.org> Sun, 14 Jun 2015 02:24:21 +0200
handymenu (3.0-16) unstable; urgency=medium
* change Upstream Name
* fix about/credits window
* prepare for repository integration
* fix translations en/es/eo/nl/ru
* set conflict and replace properties against handy-menu (v2)
* fix makefile to remove lang*files during uninstallation
* remove social launchers
-- arnault perret <arpinux@member.fsf.org> Sat, 13 Jun 2015 18:10:02 +0200
handy-menu (3.0-15) unstable; urgency=medium
* Texte de titre + gros
* code nettoyé
-- Thuban <xcartron@april.org> Sat, 13 Jun 2015 14:42:59 +0200
handy-menu (3.0-14) unstable; urgency=medium
* remove bottom buttons
* move buttons to top right corner
* remove banner, replaced by simple text
-- Thuban <xcartron@april.org> Sat, 13 Jun 2015 12:17:52 +0200
handy-menu (3.0-13) unstable; urgency=medium
* Seul entree ferme la fenêtre avec le bouton
* Les boutons d'edition de section sont en haut
-- Thuban <xcartron@april.org> Fri, 12 Jun 2015 17:22:16 +0200
handy-menu (3.0-12) unstable; urgency=medium
* restore close button and remove decoration
* add small black border
* cPickle to pickle to increase start time
* killall at startup to avoid zombie process
-- Thuban <xcartron@april.org> Fri, 12 Jun 2015 16:28:20 +0200
handy-menu (3.0-11) unstable; urgency=medium
* retore window decoration
* disable resizing
* remove close button
-- Thuban <xcartron@april.org> Fri, 12 Jun 2015 14:57:44 +0200
handy-menu (3.0-10) unstable; urgency=medium
* remove window decoration
* fix uri button centering
* fix tab width if lesser than 7
* fix reset button name
* fix icon size warning
-- Thuban <xcartron@april.org> Fri, 12 Jun 2015 10:20:05 +0200
handy-menu (3.0-9) unstable; urgency=medium
* delete about button
* editable launchers
* fix translations
* fix tabs size
-- arnault perret <arpinux@member.fsf.org> Fri, 12 Jun 2015 02:02:21 +0200
handy-menu (3.0-8) unstable; urgency=medium
* fix posinst script
* set "about" button
* fix preferences window size
* fix button size
-- arnault perret <arpinux@member.fsf.org> Tue, 09 Jun 2015 22:04:18 +0200
handy-menu (3.0-7) unstable; urgency=medium
* fix window size
* disable wraping tabs
* fix Enter press action
-- arnault perret <arpinux@member.fsf.org> Sun, 07 Jun 2015 14:17:40 +0200
handy-menu (3.0-6) unstable; urgency=medium
* meilleur support de la langue pour rechercher le nom de l'appli ajoutée
* boutons pilotables au clavier
* une seule instance
* compilation des .py
* changement de la bannière
-- arnault perret <arpinux@member.fsf.org> Sun, 07 Jun 2015 01:00:48 +0200
handy-menu (3.0-5) unstable; urgency=medium
* fix button padding & margin
* auto restart menu after configuration
-- arnault perret <arpinux@member.fsf.org> Fri, 05 Jun 2015 22:51:11 +0200
handy-menu (3.0-4) unstable; urgency=medium
* minor edit : fix addapps window size
-- arnault perret <arpinux@member.fsf.org> Fri, 05 Jun 2015 19:56:33 +0200
handy-menu (3.0-3) unstable; urgency=medium
* fix start menu path
* fix row & columns
* fix icons size
* fix .desktop used names
* set latest tab default apps
* cleaning
-- arnault perret <arpinux@member.fsf.org> Fri, 05 Jun 2015 19:16:07 +0200
handy-menu (3.0-2) unstable; urgency=medium
* move locale files to regular /usr/share/locale directory
* fix hover behaviour
* fix en translation
* png optimization
* set icons size to 64px
-- arnault perret <arpinux@member.fsf.org> Fri, 05 Jun 2015 15:03:54 +0200
handy-menu (3.0-1) unstable; urgency=low
* handymenu rewrite from scratch by thuban
-- arnault perret <arpinux@member.fsf.org> Fri, 05 Jun 2015 06:00:06 +0200

22
copyright

@ -0,0 +1,22 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: handymenu
Files: *
Copyright: 2014-2020 arnault perret <contact@arpinux.org>
2015-2017 Xavier Cartron <thuban@yeuxdelibad.net>
License: GPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

13
handymenu

@ -0,0 +1,13 @@
#!/bin/sh
if [ -z "$(pidof -sx hm-start.py)" ]; then
cd "/usr/share/handymenu"
./hm-start.py $@
else
echo "Handy-menu est déjà lancé"
killall hm-start.py
cd "/usr/share/handymenu"
./hm-start.py $@
fi
exit 0

12
handymenu.1

@ -0,0 +1,12 @@
.TH HANDYMENU 1 "June 4, 2015"
.SH NAME
handymenu \- menu simplifié pour Xfce
.SH SYNOPSIS
.B handymenu
.SH DESCRIPTION
Le HandyMenu est un menu graphique simplifié intégrant son outil de configuration.
Lancez simplement
.B handymenu.
.SH CONFIGURATION
Le HandyMenu est configurable graphiquement depuis le bouton préférences.
.PP

11
handymenu.desktop

@ -0,0 +1,11 @@
[Desktop Entry]
Name=HandyMenu
Comment=Minimalist menu for Debian
Comment[fr]=Menu simplifié pour Debian
Exec=/usr/bin/handymenu
Icon=handymenu
StartupNotify=true
Terminal=false
Type=Application
Categories=X-XFCE;Utility;
OnlyShowIn=XFCE;

70
handymenu.equivs

@ -0,0 +1,70 @@
Section: x11
Priority: optional
Homepage: https://debian-facile.org
Standards-Version: 3.9.2
Package: handymenu
Version: 4.3
Copyright: copyright
Changelog: changelog
Readme: readme
Postinst: postinst
Postrm: postrm
Maintainer: arnault perret <contact@arpinux.org>
Depends: python (>= 2.7), python3, python3-gi, python3-xdg, xdg-user-dirs, xdg-utils
Architecture: all
Files: handymenu /usr/bin/
handymenu.desktop /usr/share/applications/
handymenu.png /usr/share/pixmaps/
handymenu.1 /usr/share/man/man1/
hm-scripts/handymenu-configuration.py /usr/share/handymenu/
hm-scripts/handymenu.py /usr/share/handymenu/
hm-scripts/hm-start.py /usr/share/handymenu/
hm-scripts/hm_utils.py /usr/share/handymenu/
icons/add_section.png /usr/share/handymenu/icons/
icons/appfinder.png /usr/share/handymenu/icons/
icons/burn.png /usr/share/handymenu/icons/
icons/calcul.png /usr/share/handymenu/icons/
icons/chatons.png /usr/share/handymenu/icons/
icons/config.png /usr/share/handymenu/icons/
icons/debian.png /usr/share/handymenu/icons/
icons/df-manuel.png /usr/share/handymenu/icons/
icons/epub.png /usr/share/handymenu/icons/
icons/file_documents.png /usr/share/handymenu/icons/
icons/file_download.png /usr/share/handymenu/icons/
icons/file_home.png /usr/share/handymenu/icons/
icons/file_music.png /usr/share/handymenu/icons/
icons/file_pictures.png /usr/share/handymenu/icons/
icons/file_public.png /usr/share/handymenu/icons/
icons/file_trash.png /usr/share/handymenu/icons/
icons/file_videos.png /usr/share/handymenu/icons/
icons/firefox.png /usr/share/handymenu/icons/
icons/forumdf.png /usr/share/handymenu/icons/
icons/image-viewer.png /usr/share/handymenu/icons/
icons/irc.png /usr/share/handymenu/icons/
icons/handymenu.png /usr/share/handymenu/icons/
icons/lcdd.png /usr/share/handymenu/icons/
icons/libreoffice.png /usr/share/handymenu/icons/
icons/logiciels.png /usr/share/handymenu/icons/
icons/music-player.png /usr/share/handymenu/icons/
icons/network.png /usr/share/handymenu/icons/
icons/notes.png /usr/share/handymenu/icons/
icons/printer.png /usr/share/handymenu/icons/
icons/ripper.png /usr/share/handymenu/icons/
icons/scanner.png /usr/share/handymenu/icons/
icons/sources.png /usr/share/handymenu/icons/
icons/terminal.png /usr/share/handymenu/icons/
icons/text-editor.png /usr/share/handymenu/icons/
icons/thunderbird.png /usr/share/handymenu/icons/
icons/transmission.png /usr/share/handymenu/icons/
icons/vlc.png /usr/share/handymenu/icons/
icons/volume.png /usr/share/handymenu/icons/
icons/wikidf.png /usr/share/handymenu/icons/
icons/wikipedia.png /usr/share/handymenu/icons/
Description: Menu simplifié pour Xfce
Le HandyMenu présente les applications principales
installées dans une interface claire organisée
par thèmes et distribuée par onglets.
.
Le HandyMenu permet une configuration complète
depuis le menu de préférences.

BIN
handymenu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

505
hm-scripts/handymenu-configuration.py

@ -0,0 +1,505 @@
#!/usr/bin/python3
# -*- coding:Utf-8 -*-
"""
Description :
Configuration du handymenu
"""
import sys
import os
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject, Gdk, GdkPixbuf
from xdg import DesktopEntry
import gettext
import locale
from hm_utils import *
def get_info_desktop(desktopfile):
"""return infos from a .desktop file"""
name, cmd, icon, generic= "", "", "", ""
lang = locale.setlocale(locale.LC_ALL, "")[0:2]
d = DesktopEntry.DesktopEntry(desktopfile)
name = d.getName()
icon = d.getIcon()
generic = d.getGenericName()
cmd = d.getExec()
cmd = cmd.split('%')[0].strip()
# handle wine shortcuts
if cmd.startswith('env WINEPREFIX'):
cmd = cmd.replace('\\\\','\\')
return(name, cmd, icon, generic)
class ViewHMConfig(Gtk.Dialog):
def __init__(self, parent, config):
Gtk.Dialog.__init__(self, ("Configuration du HandyMenu"), parent, 0)
self.set_border_width(10)
self.set_default_size(450, 300)
scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_hexpand(True)
scrolledwindow.set_vexpand(True)
self.textview = Gtk.TextView()
self.textbuffer = self.textview.get_buffer()
configuration = ""
for s in config:
configuration += str(s['name']) + "\n"
for app in s['apps']:
configuration += " {}\n".format(str(app))
self.textbuffer.set_text(configuration)
scrolledwindow.add(self.textview)
# on récupère la zone de stockage du dialogue
box = self.get_content_area()
box.add(scrolledwindow)
self.show_all()
class HandymenuConfig():
def about(self):
# fenêtre à propos.
m = Gtk.MessageDialog(parent=self.window)
m.add_buttons(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
m.set_markup(('<b>Handymenu</b>\n\n\
version : {0}\n\
auteur : {1}\n\
licence : {2}\n\
homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, auteur, licence, homepage))
import base64
import random
imgsrc = random.choice(imglist)
g = base64.b64decode(imgsrc)
imgpath = "/tmp/.hmbtn.png"
with open(imgpath, "wb") as t:
t.write(g)
image = Gtk.Image.new_from_file(imgpath)
btnbox = m.get_action_area()
for btn in btnbox: # il n'y en a qu'un
btn.set_label(("HandyLinux rejoint Debian-Facile"))
btn.set_image(image)
btn.set_image_position(Gtk.PositionType.TOP)
ret = m.run()
if ret == Gtk.ResponseType.CLOSE:
open_cmd("x-www-browser https://debian-facile.org")
os.remove(imgpath)
m.destroy()
def view_config(self):
m = ViewHMConfig(self.window, self.config)
ret = m.run()
GObject.idle_add(m.hide)
GObject.idle_add(m.destroy)
def close_application(self, widget, event, data=None):
open_cmd("handymenu --force &")
Gtk.main_quit()
return False
def appfinder(self, widget=None, event=None):
open_cmd('xfce4-appfinder &')
def restart(self, widget=None, event=None):
page = self.section_list.get_current_page()
self.config = load_config()
self.make_menu(initialize = False)
if page > len(self.config):
page = 0
self.section_list.set_current_page(page)
def back_to_default(self, widget):
set_default_config()
self.restart()
def add_new_section(self, widget):
name = widget.get_text().strip()
if len(name) != 0:
newsec = {'name' : name, 'id': "", 'apps': [] }
add_section(self.config, newsec)
self.restart()
def del_section(self, section):
self.config.remove(section)
save_config(self.config)
self.restart()
def move_sec(self, section, index):
reload = move_section(self.config, section, index)
self.section_list.set_current_page(self.config.index(section))
if reload:
self.restart()
def add_item_to_section(self, name, cmd, icon, generic, section):
app = {'name' : name, 'icon' : icon, 'cmd' : cmd, 'generic' : generic}
add_app(self.config, section, app)
self.restart()
def del_item_from_section(self, section, app):
del_app(self.config, section, app)
self.restart()
def mod_app_name(self, widget, event, dialog, section, app):
newname = widget.get_text().strip()
if len(newname) != 0:
mod_app(self.config, section, app, newname)
self.restart()
dialog.destroy()
def mod_app_icon_dialog(self, widget, event, dialog, section, app):
chooser = Gtk.FileChooserDialog(title=("Choisir une icône"))
chooser.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
chooser.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK)
chooser.set_current_folder(os.getcwd())
filter = Gtk.FileFilter()
filter.set_name(("Images"))
filter.add_mime_type("image/png")
filter.add_mime_type("image/jpeg")
chooser.add_filter(filter)
response = chooser.run()
if response == Gtk.ResponseType.CANCEL:
print(("Fermeture : pas de fichiers sélectionnés"))
chooser.destroy()
elif response == Gtk.ResponseType.OK:
i = chooser.get_filename()
chooser.destroy()
mod_app_icon(self.config, section, app, i)
self.restart()
dialog.destroy()
def move_app_up(self, widget, dialog, section, app):
move_app(self.config, section, app, -1)
dialog.destroy()
self.restart()
def move_app_down(self, widget, dialog, section, app):
move_app(self.config, section, app, 1)
dialog.destroy()
self.restart()
def handle_drop(self, data, section):
'''handle drag n drop to add to configuration'''
if data.startswith('file://'):
f = data.replace("file://", "").strip()
if os.path.isdir(f): # parse directories
name = os.path.basename(f)
cmd = 'exo-open --launch FileManager "{}"'.format(f)
icon = "folder"
self.add_item_to_section(name, cmd, icon, None, section)
elif os.path.isfile(f): # is it file?
if data.endswith('.desktop'): # une applicatino
name, cmd, icon, generic = get_info_desktop(f)
self.add_item_to_section(name, cmd, icon, generic, section)
else:
name = os.path.basename(f) # un fichier
cmd = 'exo-open "{}"'.format(f)
#raccourci pour fichier sans icone
self.add_item_to_section(name, cmd, "empty", None, section)
elif data.startswith("http://") or \
data.startswith("https://") or \
data.startswith("ftp://"): # cas d'une url
name = data.split('/')[2]
cmd = "exo-open --launch WebBrowser {}".format(data)
self.add_item_to_section(name, cmd, "text-html", "Lien vers une url", section)
def on_drag_data_received(self, widget, drag_context, x, y, data, info, time, section):
if data.get_data_type().name() == "text/uri-list":
uris = data.get_uris()
for u in uris:
self.handle_drop(u, section)
drag_context.finish(True, False, time)
return(True)
def on_drag_motion(self, widgt, context, c, y, time):
Gdk.drag_status(context, Gdk.DragAction.COPY, time)
return True
def on_drag_drop(self, widget, context, x, y, time):
widget.drag_get_data(context, context.list_targets()[-1], time)
return(True)
def del_appli(self, widget, dialog, section, app):
self.del_item_from_section(section, app)
dialog.destroy() # delete parent
def edit_appli(self, widget, event, section, app):
d = Gtk.Dialog(title=("Éditer le lanceur"))
# Edition du nom de l'appli
entry = Gtk.Entry()
entry.connect("activate", self.mod_app_name, entry, d, section, app) # entrée valide
entry.show()
namebtn = Gtk.Button(label = ("Changer"))
namebtn.connect_object("clicked", self.mod_app_name, entry, None, d, section, app )
namebtn.show()
# on met ça dans une boîte
box = Gtk.HBox(False,2)
box.pack_start(entry, True, True, 3)
box.pack_start(namebtn, False, False, 0)
box.show()
# et le tout dans un étiquette
nameframe = Gtk.Frame(label = ("Changer le nom"))
nameframe.add(box)
nameframe.show()
# Changement de l'icône
iconbtn = Gtk.Button(label = ("Changer l'icône"))
iconbtn.connect_object("clicked", self.mod_app_icon_dialog, entry, None, d, section, app )
iconbtn.show()
# on met ça dans une boîte
# et le tout dans un étiquette
iconframe = Gtk.Frame(label = ("Changer l'icône de l'application"))
iconframe.add(iconbtn)
iconframe.show()
# déplacement de l'application
upbtn = Gtk.Button(label=("Monter"))
downbtn = Gtk.Button(label=("Descendre"))
upi = Gtk.Image()
upi.set_from_stock(Gtk.STOCK_GO_UP, Gtk.IconSize.MENU)
upbtn.set_image(upi)
downi = Gtk.Image()
downi.set_from_stock(Gtk.STOCK_GO_DOWN, Gtk.IconSize.MENU)
downbtn.set_image(downi)
upbtn.connect_object("clicked", self.move_app_up, None, d, section, app)
downbtn.connect_object("clicked", self.move_app_down, None, d, section, app)
upbtn.show()
downbtn.show()
# on met ça dans une boîte
box = Gtk.HBox(False,2)
box.pack_start(upbtn, True, True, 3)
box.pack_start(downbtn, False, False, 0)
box.show()
# et le tout dans un étiquette
moveframe = Gtk.Frame(label = ("Déplacer ce lanceur"))
moveframe.add(box)
moveframe.show()
# Nécessaire pour la suppression
delbtn = Gtk.Button(label = ("Supprimer"), stock=Gtk.STOCK_DELETE)
delbtn.connect("clicked", self.del_appli, d, section, app)
delbtn.show()
delframe = Gtk.Frame(label = ("Supprimer ce lanceur"))
delframe.add(delbtn)
delframe.show()
# ajout des objets au dialogue
d.vbox.pack_start(nameframe, True, True, 0)
d.vbox.pack_start(iconframe, True, True, 0)
d.vbox.pack_start(moveframe, True, True, 0)
d.vbox.pack_start(delframe, True, True, 0)
d.run()
def make_entrylist(self):
self.section_list = Gtk.Notebook()
self.section_list.set_tab_pos(Gtk.PositionType.LEFT)
self.section_list.set_scrollable(True)
for s in self.config:
label = Gtk.Label(s['name'])
applist = Gtk.VBox()
scrolled_window = Gtk.ScrolledWindow()
scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
scrolled_window.set_size_request(620,-1)
self.section_list.append_page(scrolled_window, label)
# pour ajouter des applications
scrolled_window.drag_dest_set(0, [], 0)
scrolled_window.drag_dest_add_text_targets()
scrolled_window.drag_dest_add_uri_targets()
scrolled_window.connect("drag-data-received", self.on_drag_data_received, s)
scrolled_window.connect("drag-drop", self.on_drag_drop)
scrolled_window.connect('drag-motion', self.on_drag_motion)
# boutons de config
hb = Gtk.HBox(False, 10)
delbtn = Gtk.Button(label = ("Supprimer cette section"))
delbtn.connect_object("clicked", self.del_section, s)
addbtn = Gtk.Button(label= ("Rechercher une application"))
addbtn.connect("button_press_event", self.appfinder)
hb.pack_start(addbtn, True, True, 0)
hb.pack_start(delbtn, True, True, 0)
if self.config.index(s) > 0:
upbtn = Gtk.Button(label = ("Monter la section"))
upbtn.connect_object("clicked", self.move_sec, s, -1)
hb.pack_start(upbtn, True, True, 0)
if self.config.index(s) < len(self.config)-1:
downbtn = Gtk.Button(label = ("Descendre la section"))
downbtn.connect_object("clicked", self.move_sec, s, +1)
hb.pack_start(downbtn, True, True, 0)
applist.pack_start(hb, False,False, 10)
dragdrophelp = Gtk.Label(("Pour ajouter une application, glissez-là dans la liste"))
applist.pack_start(dragdrophelp, False,False, 2)
for a in s['apps']:
appname, icon, cmd= a['name'], a['icon'], a['cmd']
image = Gtk.Image()
if icon.endswith('.png') or icon.endswith('.jpg'):
image.set_from_file(icon)
else:
image.set_from_icon_name(icon, iconsize)
image.set_from_icon_name(icon, Gtk.IconSize.DIALOG)
image.set_pixel_size(iconsize)
# nom de l'appli
bapp = Gtk.Button(label=appname)
bapp.set_image(image)
#l'image est au dessus du texte
bapp.set_image_position(Gtk.PositionType.TOP)
# apparence du bouton
bapp.set_relief(Gtk.ReliefStyle.NONE)
bapp.connect("button_release_event", self.edit_appli, s, a)
applist.pack_start(bapp, True, True, 0)
scrolled_window.add_with_viewport(applist)
# ajout de la possibilité d'ajouter des sections
addbox = Gtk.VBox()
instruction = Gtk.Label(("Nom de la nouvelle section : "))
entry = Gtk.Entry()
entry.connect("activate", self.add_new_section) # entrée valide
addbox.pack_start(instruction, False, True, 3)
addbox.pack_start(entry, False, False, 20)
addbtn = Gtk.Button(label = ("Plus"), stock=Gtk.STOCK_ADD)
addbtn.connect_object("clicked", self.add_new_section, entry )
addbox.pack_start(addbtn, False, False, 10)
addlabel = Gtk.Image()
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.path.join(handy_icons,"add_section.png"))
scaled_buf = pixbuf.scale_simple(24,24,GdkPixbuf.InterpType.BILINEAR)
addlabel.set_from_pixbuf(scaled_buf)
addlabel.set_tooltip_text(("Ajouter une section"))
self.section_list.append_page(addbox, addlabel)
self.mainbox.pack_start(self.section_list, True, True, 0)
def module_toggle(self, widget, module):
if widget.get_active():
add_module(module)
else:
del_module(module)
def make_menu(self, initialize = True):
"""build the menu"""
if initialize :
self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
self.window.connect("delete_event", self.close_application)
self.window.set_title("Handymenu configuration")
self.window.set_border_width(0)
else:
self.window.remove(self.mainbox)
# Conteneur principal
self.mainbox = Gtk.VBox(False, 10)
self.mainbox.set_border_width(10)
# configuration principale
self.make_entrylist()
# extra options
extrabox = Gtk.HBox(False, 5)
self.mainbox.pack_start(extrabox, False, False, 0)
# coches pour modules
modulesbox = Gtk.HBox(False, 5)
modulesframe = Gtk.Frame(label = ("Modules"))
modulesframe.add(modulesbox)
extrabox.pack_start(modulesframe, False, False, 0)
recents_files_check = Gtk.CheckButton(("Afficher les fichiers récents"))
recents_files_check.set_tooltip_text(("Afficher les fichiers récents"))
if "_recent_files_" in load_modules()[1]:
recents_files_check.set_active(True)
recents_files_check.connect("toggled", self.module_toggle, "_recent_files_")
modulesbox.pack_start(recents_files_check, False, False,0)
# module firefox most viewed
#most_ffox_check = Gtk.CheckButton(_("Most visited"))
#most_ffox_check.set_tooltip_text(_("Show most visited uri"))
#if "_most_ffox_view_" in load_modules()[1]:
# most_ffox_check.set_active(True)
#most_ffox_check.connect("toggled", self.module_toggle, "_most_ffox_view_")
#modulesbox.pack_start(most_ffox_check, False, False,0)
# position des modules
self.modules_position = Gtk.SpinButton()
#adjustment = Gtk.Adjustment(0, start, max, step, 10, 0)
adjustment = Gtk.Adjustment(0, 1, len(self.config)+1, 1, 10, 0)
self.modules_position.set_adjustment(adjustment)
self.modules_position.set_numeric(True)
self.modules_position.set_value(load_modules()[0])
self.modules_position.set_tooltip_text(("Position des modules dans le menu"))
self.modules_position.connect("value-changed", \
lambda x: set_modules_position(self.modules_position.get_value_as_int()))
modulesbox.pack_start(self.modules_position, False, False,1)
# conteneur pour les boutons
btnbox = Gtk.HBox(True, 2)
self.mainbox.pack_start(btnbox, False, False, 0)
aboutbtn = Gtk.Button().new_from_icon_name("stock_about", Gtk.IconSize.BUTTON)
aboutbtn.connect("clicked", lambda x: self.about())
btnbox.pack_start(aboutbtn, False, False, 0)
defaultbtn = Gtk.Button(label = ("Réinitialiser"))
resetimg = Gtk.Image()
resetimg.set_from_stock(Gtk.STOCK_REDO, Gtk.IconSize.BUTTON)
defaultbtn.set_image(resetimg)
defaultbtn.connect_object("clicked", self.back_to_default, self.window )
btnbox.pack_start(defaultbtn, True, True,0)
viewbtn = Gtk.Button(label = ("Afficher la configuration"))
viewbtn.connect("clicked", lambda x: self.view_config())
btnbox.pack_start(viewbtn, True, True, 0)
savebtn = Gtk.Button(label = ("Quitter"), stock=Gtk.STOCK_CLOSE)
savebtn.connect_object("clicked", self.close_application, self.window, None )
btnbox.pack_start(savebtn, True, True, 0)
self.window.add(self.mainbox)
self.window.set_default_size(620, 560)
self.window.show_all()
def __init__(self):
self.config = load_config()
self.make_menu()
def main():
menu = HandymenuConfig()
Gtk.main()
return 0
if __name__ == "__main__":
main()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4

385
hm-scripts/handymenu.py

@ -0,0 +1,385 @@
#!/usr/bin/python3
# -*- coding:Utf-8 -*-
"""
HandyMenu : menu par catégories présentées en onglets
Auteurs : Xavier Cartron <thuban@yeuxdelibad.net>
licence : GNU General Public Licence v3
Description : Handymenu from scratch
Dépendances : python3-gi xdg-user-dirs xdg-utils
"""
import os
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GObject
from gi.repository.GdkPixbuf import Pixbuf, InterpType
from gi.repository.Gio import content_type_get_icon
from textwrap import fill
from math import ceil
from concurrent.futures import ThreadPoolExecutor
import gettext
from hm_utils import *
os.chdir(os.getenv('HOME'))
class Handymenu():
def close_application(self, widget, event, data=None):
# tests nécessaires pour que seul clic-gauche et Entrée soient valables
if event.type == Gdk.EventType.BUTTON_RELEASE and \
event.state & Gdk.ModifierType.BUTTON1_MASK:
Gtk.main_quit()
elif event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Return:
Gtk.main_quit()
def configure(self, data=None):
open_cmd(configcmd)
Gtk.main_quit()
def add_recent(self,app):
"""add a recent application
appname, icon, cmd= app['name'], app['icon'], app['cmd']
"""
for s in self.config:
if s['id'] == 'recent': # on prend la bonne section
# check if app is not already in recents
if app not in s['apps']:
s['apps'].insert(0,app)
# on vire les vieux éléments
if len(s['apps']) > max:
s['apps'].pop()
save_config(self.config)
def exec_app(self, widget, event, data):
exe = False
if event.type == Gdk.EventType.BUTTON_RELEASE and \
event.state & Gdk.ModifierType.BUTTON1_MASK:
exe = True
elif event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Return:
exe = True
if exe:
appname, icon, cmd= data['name'], data['icon'], data['cmd']
res = open_cmd("{}".format(cmd.strip()))
if res:
self.add_recent(data)
if self.closeafterrun:
GObject.idle_add(self.window.hide)
Gtk.main_quit()
else:
if os.path.isfile("/usr/bin/synaptic-pkexec"):
m = Gtk.MessageDialog(self.window, 0, Gtk.MessageType.QUESTION, \
Gtk.ButtonsType.YES_NO, \
("Erreur au lancement de {}\n\nVoulez-vous l'intaller ?").format(cmd))
ret = m.run()
m.destroy()
if ret == Gtk.ResponseType.YES:
open_cmd("synaptic-pkexec".format(cmd.strip()))
self.window.show_all()
def change_bg_on_focus(self,widget,b):
widget.modify_bg(Gtk.StateFlags.NORMAL, self.selected_bg_color)
widget.modify_bg(Gtk.StateFlags.PRELIGHT, self.selected_bg_color)
def change_bg_on_focus_leave(self,widget,b):
widget.modify_bg(Gtk.StateFlags.NORMAL, None)
widget.modify_bg(Gtk.StateFlags.PRELIGHT, None)
widget.modify_bg(Gtk.StateFlags.SELECTED, None)
def create_tabs(self):
modlist = load_modules()
index = modlist[0] -1
for m in modlist[1]:
if m == "_recent_files_":
recentfiles = get_recently_used(max)
self.config.insert(index,recentfiles)
with ThreadPoolExecutor(max_workers=1) as executor:
for page, label in executor.map(self.add_button, self.config):
self.onglets.append_page(page, label)
if len(self.config) > maxonglets: # dyp il aime pas :P
self.onglets.set_scrollable(True)# dyp y veut pas :P
self.window.set_size_request(win_max_width, -1) # pour éviter que la fenêtre soit trop large
def add_button(self,s):
# Description du bouton
label = Gtk.Label()
label.set_markup_with_mnemonic("_{}".format(s['name']))
label.set_width_chars(onglet_width) # pour avoir des onglets uniformes
r = 2 # 2 lignes par défaut
n = len(s['apps']) # number of apps to show
if n > 0:
r = ceil(n/3)
if r > 2:
r -= 1
c = ceil(n/r)
if c > 2:
c -= 1
if len(s['apps']) > 0:
page = Gtk.Table(rows=r, columns=c, homogeneous=True)
page.set_row_spacings(1)
page.set_col_spacings(1)
x, y = 0, 0
for a in s['apps']:
appname, icon, cmd, generic = a['name'], a['icon'], a['cmd'], a['generic']
# image utilisée dans le bouton
image = Gtk.Image()
filename, ext = os.path.splitext(icon)
if ext.lower() in ['.png', '.jpg', '.jpeg', '.gif'] :
try:
if os.path.isfile(icon):
pixbuf = Pixbuf.new_from_file(icon)
scaled_buf = pixbuf.scale_simple(iconsize,iconsize,InterpType.BILINEAR)
image.set_from_pixbuf(scaled_buf)
else:
image.set_from_icon_name("image-missing", Gtk.IconSize.DIALOG)
except:
image.set_from_icon_name("image-missing", Gtk.IconSize.DIALOG)
elif ext == ".ico":
if os.path.isfile(icon):
pixbuf = Pixbuf.new_from_file(icon)
scaled_buf = pixbuf.scale_simple(iconsize,iconsize,InterpType.BILINEAR)
image.set_from_pixbuf(scaled_buf)
else:
image.set_from_icon_name("applications-internet", Gtk.IconSize.DIALOG)
elif len(icon.split('/')) == 2: # mimetype?
icon = content_type_get_icon(icon)
image.set_from_gicon(icon, Gtk.IconSize.DIALOG)
else:
image.set_from_icon_name(icon, Gtk.IconSize.DIALOG)
image.set_pixel_size(iconsize)
# nom de l'appli
appname = fill(appname, button_width)
bapp = Gtk.Button.new_with_mnemonic('_{}'.format(appname))
bapp.set_border_width(1)
bapp.set_image(image)
# l'image est au dessus du texte
bapp.set_image_position(Gtk.PositionType.TOP)
# apparence du bouton
bapp.set_relief(Gtk.ReliefStyle.NONE)
# lancement au clic ou avec entrée
bapp.connect("button_release_event", self.exec_app, a)
bapp.connect("key_press_event", self.exec_app, a)
bapp.set_tooltip_text(generic)
page.attach(bapp, x, x+1, y, y+1,\
xoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL,\
yoptions=Gtk.AttachOptions.EXPAND|Gtk.AttachOptions.FILL,\
xpadding=1, ypadding=1)
if x < c:
x +=1
elif x == c:
x = 0
y += 1
else:
page = Gtk.Label(("Ce menu est vide"))
return(page, label)
def close_after(self, widget):
self.closeafterrun = widget.get_active()
if not self.closeafterrun: #on enregistre de ne pas fermer
with open(noclose,'w') as n:
n.write('Thuban veut un câlin :P')
else:
if os.path.isfile(noclose): #on ferme la prochiane fois
os.remove(noclose)
def make_menu(self):
"""build the menu"""
# Conteneur principal
mainbox = Gtk.EventBox()
# pour utiliser la couleur de fond du thème GTK
mainbox.modify_bg(Gtk.StateFlags.NORMAL, self.bg_color