Forum › Forums › antiX-development › Development › APT based offline repo (small yad-bash project)
- This topic has 140 replies, 7 voices, and was last updated Nov 6-7:45 pm by Xecure.
-
AuthorPosts
-
September 5, 2020 at 3:41 am #41129Member
Xecure
::It seems to be a long standing YAD problem (https://sourceforge.net/p/yad-dialog/tickets/305/ )
declare –field=”blahblah:CBE“
Thanks, PPC and skidoo. This change fixed the enter key problem.
@Xecure- I’ve not tested your latest script, so, sorry if you already thought of this- about your “enter key” problem… why not use xdotool to simulate pressing “tab”, to change focus to your input field?
I really don’t know how to do this for only one of the fields (I don’t want it to work when hitting Enter if you select a different button) inside yad, so I think the other solution you and skidoo found is the best option (in CBE field, Enter key is ignored).
FWIW, the earlier version of the script, attached to post #1, seemed to have superior usability.
What does it mean exactly? Is it the interface change? Is it that I only keep one window now instead of keeping all windows for each yad section? Or is it more error information in the terminal? If it is the “more windows before”, I did this for limited systems, as each yad window is an extra 10 MBs in RAM. To go back, one hits “Cancel” (I use “Cancel” because I don’t know what gtk button is “Back”, as I want them to autotranslate. “Cancel” is the only button I found that made sense and translated properly).
Both versions provide “a false sense of successful outcome” in the case where one or more packages could not be downloaded. If an “errors.log” is generated, should pop a window to display its content and not dislpay “…was successful“.
You are right. I need to fix this, adding a piece in the script to verify if each package downloads properly, and display an error if there is a missing package at the end of the process. For now, all apt download errors were syphoned to the errors.log file, without much order. I will see what I can do this weekend.
The later version of the script, v0922, following a successful download operation and click OK (labeled “Quit”?)… the dialog window is destroyed, but the script does not exit to the command prompt. Also, try this: in the “Download Dependencies” dialog, type “miragee” (intentional typo) as package name and… press enter OR click Close. Result: poof, no UI and no exit to commandline (just “Incorrect NoPackage” echoed to the terminal).
I have been testing executing directly from Geany, so I wasn’t paying much attention to how it ran if launched from terminal. I will pay attention to this.
Process: Download kdenlive and its dependencies.
…
In the Menu, Applications, Multimedia, the kdenlive shortcut icon was created, I clicked on the kdenlive menu icon, the first time kdenlive started, it displayed the message “… missing packages: frei0r-plugins and breeze-icon -theme “, Ok, despite the previous message, kdenlive has opened and it seems to be working.Yes. That is probably because it is missing the suggested packages, but it works without the suggested packages, so all is well.
Process: Download the kodi and its dependencies.
…
In the Menu, Applications, Multimedia, the kodi shortcut icon was created, I clicked on the kodi menu icon and the program opened and is working.Good to know it is working for you. It is probably close to finished.
I will try adding a check old packages, verify correct download or missing packages, a configuration file and maybe change the amount of dependencies to download (1 level, 2 levels, rdepends and ALL). Once I add these changes I will upload the next version.
antiX Live system enthusiast.
General Live Boot Parameters for antiX.September 5, 2020 at 11:47 am #41151Member
marcelocripe
::wrote: Xecure
Good to know it is working for you. It is probably close to finished.Xecure, unfortunately I did not understand everything you and colleagues skidoo and PPC wrote.
But if it is better and easier for you to be able to program by putting all the options and features in a single window, do it with one window, if it is easier to maintain this way, with several windows, then keep it that way.
The latest version of the program works like this, the user runs my-offline-repo.sh, clicks a button of the desired functionality, the current window is closed to open another window with the continuation of the desired functionality.
If including the action of the “Enter” key or including the “Back” button will complicate the program code, don’t worry about it, for me it’s just details.
I do not want to discourage you, on the contrary, I am very grateful for what you are doing and I believe that it is interesting for me to remind you what is most important, which is to function correctly and in the best possible way. I understand … you must be striving for excellence.
Thank you
marcelocripe
—————
wrote: Xecure
Good to know it is working for you. It is probably close to finished.Xecure, infelizmente eu não entendi tudo que você e os colegas skidoo e PPC escreveram.
Mas se for melhor e mais fácil para você conseguir programar colocando todas as opções e funcionalidades em uma única janela, faz com uma janela, se for mais fácil manter desta forma, com várias janela, então mantenha assim.
A versão mais recente do programa funciona assim, o usuário executa o my-offline-repo.sh, clica em um botão da funcionalidade desejada, a janela atual é fechada para abrir outra janela com a continuação da funcionalidade desejada.
Se incluir a ação da tecla “Enter” ou incluir o botão “Voltar” for complicar o código do programa, não se preocupe com isso, para mim são apenas detalhes.
Não quero te desanimar, ao contrário, sou muito grato pelo que você está fazendo e acredito que seja interessante eu te lembrar o que é mais importante, que é funcionar corretamente e da melhor forma possível. Eu entendo … você deve estar buscando a excelência.
Obrigado
marcelocripe
September 5, 2020 at 12:44 pm #41156Anonymous
::I don’t know what gtk button is “Back”, as I want them to autotranslate.
I reckon a suitable stock button name would be “gtk-go-back” ( or “gtk-go-back-ltr” ? )
This page, about halfway down the page, it lists icon + name for all the “stock” buttons
https://developer.gnome.org/gtk2/stable/gtk2-Stock-Items.html
but we should not presume that every stock item listed on that page will be available on every user’s system.
(they are distributed split across various packages e.g. gnome-icon-theme, gnome-icons-extra…)$ locate gtk-go-back
Here, booted to an antix16 machine, I found SVG and various-sized PNG variants for gtk-go-back-ltr and gtk-go-back-rtl$ dpkg-query -S /usr/share/icons/gnome/16×16/actions/gtk-go-back-ltr.png
^—v
gnome-icon-theme: /usr/share/icons/gnome/16×16/actions/gtk-go-back-ltr.pngSeptember 5, 2020 at 1:09 pm #41157Anonymous
::What does it mean exactly? Is it the interface change? Is it that I only keep one window now
At any given moment, whatever was displayed in a (the) dialogboxes seemed more understandable. The later version showed “Quit?” in places that didn’t make sense (at a given juncture, it wasn’t appropriate to “quit” ~~ maybe changing to “Cancel” or “Back” would remove potential confusion).
The only other detail I would add to the script (for my use) would be to generate a manifest for each transaction.
example:
If I requested localrepo download of package “fbdesk”, and the retrieved pkg is fbdesk_1.4.1-10_amd64.deb
write fbdesk_1.4.1-10_amd64.txt containing a manifest of all the associated downloaded debfiles.September 6, 2020 at 7:36 am #41185Member
Xecure
::I reckon a suitable stock button name would be “gtk-go-back” ( or “gtk-go-back-ltr” ? )
I wanted to use it (yad automatically translates it) but the button is , as you mentioned later, gtk-go-back-ltr.
I have opted to use that icon and simply translate “Back” manually.The later version showed “Quit?” in places that didn’t make sense (at a given juncture, it wasn’t appropriate to “quit” ~~ maybe changing to “Cancel” or “Back” would remove potential confusion).
Thanks. This is the specific feedback I needed from you. I have changed it to “Close” for all the pop-up windows where “quit” didn’t make sense.
The only other detail I would add to the script (for my use) would be to generate a manifest for each transaction.
example:
If I requested localrepo download of package “fbdesk”, and the retrieved pkg is fbdesk_1.4.1-10_amd64.deb
write fbdesk_1.4.1-10_amd64.txt containing a manifest of all the associated downloaded debfiles.Actually, the .repo file generated after downloading a package contained the list of all packages downloaded/related to the package selected. But you are right that one needs to know what is going to be downloaded before proceeding. I have added a List button to display all packages/dependencies that will be downloaded for the selected package.
Thanks very much for the feedback.
I will also include, as it was before, an option to select the amount of dependencies one wants to download. Direct dependencies, based on apt-rdepends (if installed) or all dependencies. This way there is better control.I do not want to discourage you, on the contrary
Thanks. Don’t be afraid to suggest things. I will try to add them if I can. If I cannot, then i will proceed as with the “Enter” button issue, and say it is too much for me.
I am happy it is working well for you. I will try to finish the config file and menu soon so i can include them in the next update.
If you see something you don’t like, let me know.antiX Live system enthusiast.
General Live Boot Parameters for antiX.September 6, 2020 at 10:00 am #41193Anonymous
::translate “Back” manually.
howabout
<—–<<
or
http://xahlee.info/comp/unicode_arrows.htmledit:
not buttons, but a here’s crude example of unicode displayed within a yad dialog
(tried to embed image here, did not show, so I’ll try “upload an attachment”)September 6, 2020 at 10:12 am #41194Moderator
Brian Masinick
::In my personal opinion the Unicode arrow convention makes more sense and there is less translation and confusion.
Thanks Skidoo!
--
Brian MasinickSeptember 6, 2020 at 11:34 am #41202Member
Xecure
::You are right. I was too insistent on keeping all buttons similar (keep consistent). I will simply use an icon, as you and masinick suggest. It was really a simple solution. I was too blockheaded.
- This reply was modified 2 years, 8 months ago by Xecure. Reason: typo
antiX Live system enthusiast.
General Live Boot Parameters for antiX.September 6, 2020 at 11:45 am #41204Moderator
Brian Masinick
::The more you create, build, develop and design software the easier it is to make decisions.
You are doing well, don’t be too hard on yourself. I think that many of us, even veterans, have learned a few things from your efforts. Keep up the good work!
--
Brian MasinickSeptember 6, 2020 at 5:36 pm #41216Member
marcelocripe
::Brian,
I believe that Xecure needs to define the objective, a goal.
If the program will have buttons that contain images or buttons that contain text, it doesn’t matter, what really matters is that the program works in the best possible way. I believe that using images should increase memory consumption at the time of execution. Xecure even thought about memory consumption, how many programmers are concerned with that? Xecure is programming by itself!
Just thinking that this program will not depend on another program or dependencies to work, makes me very happy. Besides the fact that it is a portable or executable program, which makes it perfect!
It is becoming, or has already become, the best tool for managing package dependency packages and still installing locally. As much as Xecure says it is using everything that already exists, I believe it is the only one that is bringing together everything that is done in text mode to be done in graphical mode, bringing together in the same program the possibility to download and install programs of “source” APT and PI, this part (APT and PI) I still don’t understand, but I imagine they are from different sources or repositories. It will be the portable program all in one.
If the “Enter” button doesn’t work, it doesn’t change the quality of the program, if the “Tab” works and the confirmation occurs with “Space”, that’s fine! If it does not work with keyboard commands and only with mouse commands, the quality of the program does not change, there are several programs that do not work without the use of the mouse.
The “accessories”, I’ll call “accessories” the keyboard commands and other details, I just hope they are not hindering the development and improvement of the program code, sometimes, the simple is the best, “less is more “, what really matters is that the program works in the best possible way.
This is where the objective or goal cannot be lost.
Thank you Xecure.
marcelcripe
———–
Brian,
Eu acredito que o Xecure precisa definir o objetivo, uma meta.
Se o programa vai possuir botões que contenham imagens ou botões que contenham texto, isso não importa, o que realmente importa é o programa funcionar da melhor maneira possível. Eu acredito que usar imagens deve aumentar o consumo de memória no momento da execução. O Xecure pensou inclusive no consumo de memória, quantos programadores se preocupam com isso? O Xecure está programando sozinho!
Só em pensar que este programa não dependerá de outro programa ou de dependências para funcionar, já me deixa muito feliz. Além do fato de ser um programa portátil ou executável, o que o torna perfeito!
Está se tornando ou já se tornou, a melhor ferramenta para gerenciar pacotes de dependências de pacotes e ainda instalar localmente. Por mais que o Xecure diga que está usando tudo aquilo que já existe, acredito que ele seja o único que esteja reunindo tudo que é feito no modo texto para ser feito no modo gráfico, reunindo em um mesmo programa a possibilidade de baixar e instalar programas de “origem” APT e PI, esta parte (APT e PI) eu ainda não entendo, mas imagino que sejam de origem ou repositórios diferentes. Vai ser o programa portátil tudo em um.
Se o botão “Enter” não funcionar, isso não muda a qualidade do programa, se o “Tab” funcionar e a confirmação ocorrer com o “Espaço”, tudo bem! Se não funcionar com comandos do teclado e apenas com os comandos do mouse, não muda a qualidade do programa, existem vários programas que não funcionam sem o uso do mouse.
Os “acessórios”, vou chamar de “acessórios” os comandos de teclado e outros detalhes, eu só espero que não estejam atrapalhando o desenvolvimento e a melhoria do código do programa, as vezes, o que é simples é o melhor, “menos é mais”, o que realmente importa é o programa funcionar da melhor maneira possível.
É aí que o objetivo ou a meta não podem se perder.
Obrigado Xecure.
marcelcripe
- This reply was modified 2 years, 8 months ago by marcelocripe.
September 6, 2020 at 7:15 pm #41218Moderator
Brian Masinick
::According to skidoo the icons are already available.
Xah Lee put the icons in the tools in 2010. I don’t think that they will be “expensive” resource consumers so it’s worth trying them. If they use a lot of resources they can be removed.
--
Brian MasinickSeptember 6, 2020 at 11:38 pm #41234Anonymous
::micro optimization
unicode font glyphs vs png icons
Unless yad is instructed to use a specific font, the default desktop font will be used, and that fontfile content is already loaded and buffered in memory, eh?Someone can test (but I’m fairly certain the diff will be negligible):
If the script uses “gtk-go-back-ltr.png” and “gtk-cancel.png” and “gtk-quit.png” (and “gtk-next.png”?) …
can we notice the additional pixbuf buffer memory consumed by those image assets?
check my sleepy math:
16bit(2byte)color * 32px wide * 32px high * 4(? number of icon imagefiles) == 8kb additional memory overheadrelated, if you care to peek under the hood:
sudo apt install strace man strace strace -e trace=file {{program}}September 7, 2020 at 1:25 pm #41251Moderator
Brian Masinick
::micro optimization
unicode font glyphs vs png icons
Unless yad is instructed to use a specific font, the default desktop font will be used, and that fontfile content is already loaded and buffered in memory, eh?Someone can test (but I’m fairly certain the diff will be negligible):
If the script uses “gtk-go-back-ltr.png” and “gtk-cancel.png” and “gtk-quit.png” (and “gtk-next.png”?) …
can we notice the additional pixbuf buffer memory consumed by those image assets?
check my sleepy math:
16bit(2byte)color * 32px wide * 32px high * 4(? number of icon imagefiles) == 8kb additional memory overheadrelated, if you care to peek under the hood:
sudo apt install strace man strace strace -e trace=file {{program}}I agree skidoo, and I don’t need to do an strace in order to reach my conclusion. The use of icons and symbols is already quite common in every graphical user interface that I am familiar with and they exhibit characteristics that are reasonable for the environment in which they are used.
All it will take to confirm this is to make a couple copies of the code, one with the Xaw Lee icons and the other with the previous approach and give them a trial run. It’s not even necessary to run strace; just run htop before, during and after running each tool and observe the overall system performance and memory utilization. If something is weird, then investigate with strace. Bottom line is that I agree with your conclusions. Actually testing will confirm.
- This reply was modified 2 years, 8 months ago by Brian Masinick.
--
Brian MasinickSeptember 8, 2020 at 10:24 am #41284Member
Xecure
::Thanks all for the recommendations. I have changed the “Back” button for the arrow icon (It is a few KBs, so it doesn’t really impact on the end program).
I will add a window to change options and update the pt_BR translations. If I cannot finish it tonight I will upload it tomorrow.Thanks for all the feedback.
antiX Live system enthusiast.
General Live Boot Parameters for antiX.September 8, 2020 at 10:54 am #41288Moderator
Brian Masinick
-
AuthorPosts
- You must be logged in to reply to this topic.