passage des paquets externes en sources+equivs-build + rename DFLinux/DFiso + del handyhook + fix README + fix handymenu

pull/60/head
arpinux 3 years ago
parent 8c1f648426
commit 4f96dcbb38

6
.gitignore vendored

@ -1,8 +1,8 @@
/binary/
/cache/
/dfl-amd64/
/dfl-i386/
/dflinux.log
/dfiso-amd64/
/dfiso-i386/
/dfiso.log
/chroot/
/chroot.files
/chroot.packages.install

@ -30,10 +30,24 @@ fi
lb clean
## mise en place
echo "INFO: building DFLinux-${VERSION}-${ARCH}"
echo "INFO: building DFiso-${VERSION}-${ARCH}"
# import des paquets externes
## mise en place du dossier des paquets externes
mkdir -p config/packages
## construction des paquets debian
# gdebi-fixdesk
cd src-deb/gdebi-fixdesk/
equivs-build gdebi-fixdesk.equivs
mv *.deb ../../config/packages/
cd ../../
# handymenu
cd src-deb/handymenu/
equivs-build handymenu.equivs
mv *.deb ../../config/packages/
cd ../../
# import des cahiers du débutant
ln ext/*.deb config/packages/
# utiliser apt-cacher s'il est installé
@ -56,14 +70,14 @@ lb build
## renommage
echo "INFO: renommer"
if test -f live-image-${ARCH}.hybrid.iso; then
mkdir -p dfl-${ARCH}
mv live-image-${ARCH}.hybrid.iso dfl-${ARCH}/debian-facile-${VERSION}-${ARCH}.iso
mv chroot.packages.install dfl-${ARCH}/debian-facile-${VERSION}-${ARCH}.pkgs
mv dflinux.log dfl-${ARCH}/debian-facile-${VERSION}-${ARCH}.log
cd dfl-${ARCH} && md5sum debian-facile-${VERSION}-${ARCH}.iso > debian-facile-${VERSION}-${ARCH}.md5 && cd ../
mkdir -p dfiso-${ARCH}
mv live-image-${ARCH}.hybrid.iso dfiso-${ARCH}/debian-facile-${VERSION}-${ARCH}.iso
mv chroot.packages.install dfiso-${ARCH}/debian-facile-${VERSION}-${ARCH}.pkgs
mv dfiso.log dfiso-${ARCH}/debian-facile-${VERSION}-${ARCH}.log
cd dfiso-${ARCH} && md5sum debian-facile-${VERSION}-${ARCH}.iso > debian-facile-${VERSION}-${ARCH}.md5 && cd ../
lb clean
else
echo "ISO non construite : erreur, voir le fichier dflinux.log"
echo "ISO non construite : erreur, voir le fichier dfiso.log"
exit 1
fi

@ -9,11 +9,15 @@ DIY : direction [doc/](doc/) ;)
Dépendances live-build :
# apt-get update && apt-get install live-build live-manual live-tools
# apt update && apt install live-build live-manual live-tools
Dépendance git :
# apt-get update && apt-get install git
# apt update && apt install git
Dépendance debian :
# ap update && apt install equivs
Cloner le sources git :
@ -31,4 +35,4 @@ Construire son iso :
# ./DFbuild.sh <32 ou 64> (selon la plateforme 32 ou 64 bits)
Ttest de l'iso : sur une machine réelle ou en machine virtuelle.
Test de l'iso : sur une machine réelle ou en machine virtuelle.

@ -1,3 +1,3 @@
#!/bin/sh
lb build noauto "${@}" 2>&1 | tee dflinux.log
lb build noauto "${@}" 2>&1 | tee dfiso.log

@ -22,8 +22,8 @@ lb config noauto \
--debian-installer-gui "true" \
--firmware-binary "true" \
--firmware-chroot "true" \
--iso-application "dflinux" \
--iso-volume "dflinux" \
--iso-application "dfiso" \
--iso-volume "dfiso" \
--memtest "none" \
--win32-loader "false" \
--clean \

@ -1,11 +0,0 @@
#!/bin/sh
set -e
echo ""
echo "------------------------------------------------------------------------------------"
echo "- INFO : Patch HandyMenu - "max_workers""
sed -i "s/with ThreadPoolExecutor(max_workers=4) as executor:/with ThreadPoolExecutor(max_workers=1) as executor:/" /usr/share/handymenu/handymenu.py
echo ""
echo "------------------------------------------------------------------------------------"
echo ""

@ -1,4 +1,4 @@
## dflinux packages ##
## dfiso packages ##
#base
task-french-desktop task-french task-print-server

Binary file not shown.

Binary file not shown.

@ -0,0 +1,21 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: gdebi-fixdesk
Files: *
Copyright:
2020 arnault perret <contact@arpinux.org>
2020 association debian-facile <contact@debian-facile.org>
License: WTFPLv2
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
.
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING,
DISTRIBUTION AND MODIFICATION
.
0. You just DO WHAT THE FUCK YOU WANT TO.

@ -0,0 +1,16 @@
Section: misc
Priority: optional
Homepage: https://debian-facile.org
Standards-Version: 3.9.2
Package: gdebi-fixdesk
Version: 1.0
Copyright: copyright
Maintainer: arnault perret <contact@arpinux.org>
Depends: gdebi
Architecture: all
Files: gdebi.desktop /usr/local/share/applications/
Description: Correcteur de lanceur gdebi-gtk
Paquet de transition pour corriger le lanceur
gdebi installé par défaut.
.

@ -0,0 +1,17 @@
[Desktop Entry]
Name=GDebi Package Installer
Name[fr]=Installateur de paquets GDebi
GenericName=Package Installer
GenericName[fr]=Installateur de paquets
Comment=Install and view software packages
Comment[fr]=Installer et lister les paquets logiciels
Exec=sh -c "gdebi-gtk %f"
Icon=gnome-mime-application-x-deb
Terminal=false
Type=Application
Categories=System;
MimeType=application/vnd.debian.binary-package;
NotShowIn=KDE;
X-Ubuntu-Gettext-Domain=gdebi
StartupNotify=true
Keywords=package;apt;dpkg;install

@ -0,0 +1,546 @@
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

@ -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".

@ -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

@ -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

@ -0,0 +1,13 @@
[Desktop Entry]
Name=HandyMenu
Comment=Minimalist menu for Debian
Comment[fr]=Menu simplifié pour Debian
Comment[es]=Menú simplificado para Debian
Comment[eo]=Simpligita menuo por Debian
Exec=/usr/bin/handymenu
Icon=handymenu
StartupNotify=true
Terminal=false
Type=Application
Categories=X-XFCE;Utility;
OnlyShowIn=XFCE;

@ -0,0 +1,47 @@
Section: x11
Priority: optional
Homepage: https://debian-facile.org
Standards-Version: 3.9.2
Package: handymenu
Version: 4.2
Copyright: copyright
Changelog: changelog
Postinst: postinst
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/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_trash.png /usr/share/handymenu/icons/
icons/file_videos.png /usr/share/handymenu/icons/
icons/firefox.png /usr/share/handymenu/icons/
icons/handymenu.png /usr/share/handymenu/icons/
icons/help.png /usr/share/handymenu/icons/
icons/internet_framasoft.png /usr/share/handymenu/icons/
icons/internet_framatalk.png /usr/share/handymenu/icons/
icons/webbrowser.png /usr/share/handymenu/icons/
locale/de/LC_MESSAGES/handymenu.mo /usr/share/locale/de/LC_MESSAGES/
locale/en/LC_MESSAGES/handymenu.mo /usr/share/locale/en/LC_MESSAGES/
locale/es/LC_MESSAGES/handymenu.mo /usr/share/locale/es/LC_MESSAGES/
locale/fr/LC_MESSAGES/handymenu.mo /usr/share/locale/fr/LC_MESSAGES/
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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@ -0,0 +1,513 @@
#!/usr/bin/python3
# -*- coding:Utf-8 -*-
"""
Description :
Configuration du handymenu
"""
import sys
import os
from gi.repository import Gtk, GObject, Gdk, GdkPixbuf
from xdg import DesktopEntry
import gettext
import locale
from hm_utils import *
gettext.bindtextdomain('handymenu', '/usr/share/locale')
gettext.textdomain('handymenu')
_ = gettext.gettext
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, _("Handymenu Configuration"), 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\
author : {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 join 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/viewtopic.php?id=14632")
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=_("Choose an icon"))
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(_('Closed, no files selected'))
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=_("Edit the launcher"))
# 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 = _("Change"))
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 = _("Change the label"))
nameframe.add(box)
nameframe.show()
# Changement de l'icône
iconbtn = Gtk.Button(label = _("Change icon"))
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 = _("Change the application icon"))
iconframe.add(iconbtn)
iconframe.show()
# déplacement de l'application
upbtn = Gtk.Button(label=_("Move up"))
downbtn = Gtk.Button(label=_("Move down"))
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 = _("Move this app"))
moveframe.add(box)
moveframe.show()
# Nécessaire pour la suppression
delbtn = Gtk.Button(label = _("Delete"), stock=Gtk.STOCK_DELETE)
delbtn.connect("clicked", self.del_appli, d, section, app)
delbtn.show()
delframe = Gtk.Frame(label = _("Delete this launcher"))
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 = _("Delete this section"))
delbtn.connect_object("clicked", self.del_section, s)
addbtn = Gtk.Button(label=_("Search for applications"))
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 = _("Move section up"))
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 = _("Move section down"))
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(_("To add an application, Drag and drop it below"))
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(_("Name of the new 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 = _("More"), 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(_("Add a 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(_("Show recent files"))
recents_files_check.set_tooltip_text(_("Show recent files"))
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 of modules in 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 = _("Reset"))
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 = _("View config"))
viewbtn.connect("clicked", lambda x: self.view_config())
btnbox.pack_start(viewbtn, True, True, 0)
savebtn = Gtk.Button(label = _("Quit"), 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

@ -0,0 +1,392 @@
#!/usr/bin/python3
# -*- coding:Utf-8 -*-
"""
HandyMenu : menu principal de la distribution
HandyLinux <https://handylinux.org>
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
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 *
gettext.bindtextdomain('handymenu', '/usr/share/locale')
gettext.textdomain('handymenu')
_ = gettext.gettext
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/handysoft"):
m = Gtk.MessageDialog(self.window, 0, Gtk.MessageType.QUESTION, \
Gtk.ButtonsType.YES_NO, \
_('Error at launching {}\n\nDo you want to install it?').format(cmd))
ret = m.run()
m.destroy()
if ret == Gtk.ResponseType.YES:
open_cmd("handysoft {}".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)