Forum › Forums › New users › New Users and General Questions › How to disable laptop trackpad touchpad? [Solved]
- This topic has 38 replies, 9 voices, and was last updated Feb 18-4:25 pm by marcelocripe.
-
AuthorPosts
-
February 15, 2023 at 6:36 pm #99660Member
marcelocripe
::I don’t know if you can translate “Device Enabled” for it comes from xinput. I have no idea what the output is for non-English systems. Easy enough to test.
I wasn’t sure if the text ‘Device Enabled’ should be included or not for the translation, so I asked the question for you.
If the other two sentences echo $”Touchpad disabled.” and echo $”Touchpad enabled.” are translated in the test that I can do tonight (in my time zone) and the modified script does not show an error, I will send it to you here in this topic. The objective will be that the script with the changes to receive the translation resources can be tested at least for a second language other than English and Brazilian Portuguese. If everything is working properly (the script and the translations), you can update the script in your GitLab, as well as add a .desktop file for the script. If we get success and the interest of the other volunteer translators in wanting to translate “touchpad-toggle.po”, the next natural step will be to create a .deb package and I can help you with that, thanks to Robin’s teachings.
At the end of my text is a proposal for the .desktop file. You will need to choose the “Name=Touchpad Toggle” (this is the name that will be displayed in the menu), under which category “Categories=Utility;” will be displayed. or “Categories=Settings;HardwareSettings;”, in addition to choosing an existing antiX image or creating an exclusive image for the program.
– – – – –
I don’t know if you can translate “Device Enabled” for it comes from xinput. I have no idea what the output is for non-English systems. Easy enough to test.
Eu não tinha certeza se o texto ‘Device Enabled’ deveria ser incluso ou não para a tradução, por isso, eu fiz a pergunta para você.
Se as outras duas frases echo $”Touchpad disabled.” e echo $”Touchpad enabled.” forem traduzidas no teste que eu poderei fazer hoje à noite (no meu fuso horário) e o script modificado não apresentar erro, eu te enviarei aqui neste tópico. O objetivo será que o script com as alterações para receber os recursos de tradução possa ser testado ao menos por um segundo idioma diferente do Inglês e do Português do Brasil. Se tudo estiver funcionando adequadamente (o script e as traduções), você poderá atualizar o script no seu GitLab, além de adicionar um arquivo .desktop para o script. Se obtivermos sucesso e o interesse dos outros tradutores voluntários em querer traduzir o “touchpad-toggle.po”, o próximo passo natural será criarmos um pacote .deb e eu posso te ajudar com isso, graças os ensinamentos do Robin.
No final do meu texto está uma proposta para o arquivo .desktop. Você precisará escolher o “Name=Touchpad Toggle” (é o nome que será exibido no menu), em qual categoria será exibido “Categories=Utility;” ou “Categories=Settings;HardwareSettings;”, além de escolher uma imagem existente no antiX ou criar uma imagem exclusiva para o programa.
touchpad-toggle.desktop:
[Desktop Entry]
[Desktop Entry]
Categories=Utility;
#or
#Categories=Settings;HardwareSettings;
Encoding=UTF-8
Exec=touchpad-toggle.sh
Icon=
Terminal=false
NoDisplay=True
Type=ApplicationName=Touchpad Toggle
Name[am]=የመዳሰሻ ሰሌዳ መቀየሪያ
Name[ar]=تمكين أو تعطيل لوحة اللمس
Name[bn]=টাচপ্যাড সক্ষম বা নিষ্ক্রিয় করুন
Name[ca]=Commutador de Touchpad
Name[cs]=Touchpad Přepnout
Name[cy]=Toglo Touchpad
Name[de]=Touchpad-Umschalter
Name[el]=εναλλαγή επιφάνειας αφής
Name[eo]=Touchpad Baskulo
Name[et]=Touchpad lüliti
Name[fr_BE]=Touchpad marche/arrêt
Name[fr]=Touchpad marche/arrêt
Name[ga]=Toghadh Touchpad
Name[gd]=Togail Touchpad
Name[gu]=ટચપેડને સક્ષમ અથવા અક્ષમ કરો
Name[hi]=टचपॅड सक्षम किंवा अक्षम करा
Name[ht]=Touchpad baskile
Name[id]=Beralih Touchpad
Name[it]=Attiva/disattiva Touchpad
Name[ja]=Touchpad トグルへ
Name[km]=បើកឬបិទបន្ទះប៉ះ
Name[kn]=ಟಚ್ಪ್ಯಾಡ್ ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ ಅಥವಾ ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಿ
Name[ko]=Touchpad 토글
Name[lo]=Touchpad ສະຫຼັບ
Name[mi]=Takahuri Touchpad
Name[ml]=ടച്ച്പാഡ് പ്രവർത്തനക്ഷമമാക്കുക അല്ലെങ്കിൽ പ്രവർത്തനരഹിതമാക്കുക
Name[mr]=ടച്ച്പാഡ് പ്രവർത്തനക്ഷമമാക്കുക അല്ലെങ്കിൽ പ്രവർത്തനരഹിതമാക്കുക
Name[ms]=Togol Touchpad
Name[ne]=Touchpad टगल
Name[nl]=Touchpad Wissel
Name[or]=ଟଚ୍ ପ୍ୟାଡ୍ ସକ୍ଷମ କିମ୍ବା ଅକ୍ଷମ କରନ୍ତୁ |
Name[pa]=ਟੱਚਪੈਡ ਨੂੰ ਸਮਰੱਥ ਜਾਂ ਅਯੋਗ ਕਰੋ
Name[pl]=Przełącznik Touchpad
Name[ps]=د ټچ پیډ فعال یا غیر فعال کړئ
Name[pt_BR]=Ativar ou Desativar o Touchpad
Name[pt]=Mudar de Touchpad
Name[ro]=Comutare Touchpad
Name[rw]=Toggle
Name[sd]=ٽچ پيڊ کي فعال يا غير فعال ڪريو
Name[si]=Touchpad සක්රිය හෝ අක්රිය කරන්න
Name[sk]=Touchpad prepínač
Name[so]=Toggle Touchpad
Name[sr]=Цонки ТогглеОмогућите или онемогућите додирну таблу
Name[su]=Touchpad Togel
Name[sv]=Touchpad Toggle
Name[ta]=டச்பேடை இயக்கவும் அல்லது முடக்கவும்
Name[te]=టచ్ప్యాడ్ను ప్రారంభించండి లేదా నిలిపివేయండి
Name[tr]=Touchpad Geçişi
Name[tt]=Омогућите или онемогућите додирну таблу
Name[uk]=Перемикач Touchpad
Name[ur]=ٹچ پیڈ کو فعال یا غیر فعال کریں۔
Name[yi]=געבן אָדער דיסייבאַל די טאָוטשפּאַד
Name[zh_CN]=Touchpad 切换
Name[zh_TW]=Touchpad 切換February 15, 2023 at 8:03 pm #99665Member
techore
::For English “Touchpad Toggle” is a noun and “Toggle Touchpad” is a verb and object. I prefer “Touchpad Toggle” but use whatever is the antiX convention or that you believe is best.
I appreciate you asking.
February 16, 2023 at 12:06 am #99669Member
marcelocripe
::For English “Touchpad Toggle” is a noun and “Toggle Touchpad” is a verb and object. I prefer “Touchpad Toggle” but use whatever is the antiX convention or that you believe is best.
I don’t know how to read or write in English language. All texts proposed in the .desktop file are automatic translations made by Google translator and need to be proofread by native speakers of the respective languages. I referenced “conky-toggle.desktop” due to the similarity with “touchpad-toggle.desktop”, please correct everything necessary in your native language.
The attached file “touchpad-toggle.zip” has your original script and the script I added the translation features.
The tests I did can be found in the attached file “Test-of-touchpad-toggle-15-02-2023.zip”. The compressed file has a text file “Touchpad-toggle test 15-02-2023.txt” with the commands I applied in the terminal, in addition to the two images “Touchpad-toggle test 2023-02-15 (1). png” and “Test of touchpad-toggle 2023-02-15 (1).png” that demonstrate the “touchpad-toggle.sh” menu in my language “Ativador ou Desativar o Touchpad”.
The “touchpad-toggle.desktop” file worked perfectly, now you just need to choose an image for the icon.
In the tests I did, I couldn’t see the messages on the screen, only in the terminal emulator I was able to test the pt_BR translation. The pt_BR translation is in the “locate” folder. Will it be necessary to install some other package, in addition to “xinput” to display the messages on the desktop?
– – – – –
For English “Touchpad Toggle” is a noun and “Toggle Touchpad” is a verb and object. I prefer “Touchpad Toggle” but use whatever is the antiX convention or that you believe is best.
Eu não sei ler ou escrever em idioma Inglês. Todos os textos propostos no arquivo .desktop são traduções automáticas feitas pelo tradutor do Google e precisam ser revisados pelos nativos dos respectivos idiomas. Eu tomei como referência o “conky-toggle.desktop” devido a similaridade com o “touchpad-toggle.desktop”, por favor, corrija tudo que for necessário em seu idioma natal.
O arquivo anexo “touchpad-toggle.zip” possui o seu script original e o script que eu adicionei os recursos de tradução.
Os testes que eu fiz podem ser encontrados no arquivo anexo “Teste-do-touchpad-toggle-15-02-2023.zip”. O arquivo compactado possui um arquivo de texto “Teste do touchpad-toggle 15-02-2023.txt” com os comandos que eu apliquei no terminal, além das duas imagens “Teste do touchpad-toggle 15-02-2023 (1).png” e “Teste do touchpad-toggle 15-02-2023 (1).png” que demonstram o menu do “touchpad-toggle.sh” em meu idioma “Ativador ou Desativar o Touchpad”.
O arquivo “touchpad-toggle.desktop” funcionou perfeitamente, agora só falta você escolher uma imagem para o ícone.
Nos testes que eu fiz, eu não consegui visualizar as mensagem na tela, somente no emulador de terminal que eu consegui testar a tradução pt_BR. A tradução pt_BR está na pasta “locate”. Será preciso instalar mais algum outro pacote, além do “xinput” para exibir na area de trabalho as mensagem?
February 16, 2023 at 6:54 am #99677Memberspaz
::marcelocripe : “I hope Spaz doesn’t get upset that we use this thread to continue the details of the script.”
Absolutely not in any way upset!
More like fascinated and very interested by the discussion.
I have done a few very basic very introductory programming courses (Assembly/C/Java).
I don’t know any scripting languages (or any language very well).
But I would really like to learn more at some point.
I am really enjoying looking at how these discussions take place in relation to developers working on a system I really like — speaking low-level to hardware to automate a certain behaviour – with scripting languages, in a context like this — on a “basic” utility subject which is useful to me — even if I don’t understand everything (or even much) of what is being said right now.Thanks everybody for the discussion. I’m very glad I asked!
- This reply was modified 2 months, 3 weeks ago by spaz.
- This reply was modified 2 months, 3 weeks ago by spaz.
- This reply was modified 2 months, 3 weeks ago by spaz.
February 16, 2023 at 3:26 pm #99697Member
techore
::All texts proposed in the .desktop file are automatic translations made by Google translator and need to be proofread by native speakers of the respective languages.
Understood. Thank you.
The “touchpad-toggle.desktop” file worked perfectly, now you just need to choose an image for the icon.
I have no preference for the icon. I assume there a touchpad icon in whatever icon theme antiX is using.
In the tests I did, I couldn’t see the messages on the screen, only in the terminal emulator I was able to test the pt_BR translation. The pt_BR translation is in the “locate” folder. Will it be necessary to install some other package, in addition to “xinput” to display the messages on the desktop?
It never occurred to me antiX didn’t have a notification daemon. If it does, then that will need to be investigated.
On the antiX DWM Spin, I am using dunst.
Package: dunst Version: 1.5.0-1 Priority: optional Section: x11 Maintainer: Nikos Tsipinakis <nikos@tsipinakis.com> Installed-Size: 219 kB Provides: notification-daemon Depends: libc6 (>= 2.17), libcairo2 (>= 1.10.0), libgdk-pixbuf2.0-0 (>= 2.31.1), libglib2.0-0 (>= 2.35.8), libnotify4 (>= 0.7.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.22.0), libx11-6, libxext6, libxinerama1, libxrandr2 (>= 2:1.5.0), libxss1, default-dbus-session-bus | dbus-session-bus Recommends: sensible-utils Homepage: https://dunst-project.org/ Tag: uitoolkit::gtk Download-Size: 85.8 kB APT-Manual-Installed: yes APT-Sources: http://ftp.us.debian.org/debian bullseye/main amd64 Packages Description: dmenu-ish notification-daemon Dunst is a highly configurable and lightweight notification-daemon: The only thing it displays is a colored box with unformatted text. The whole notification specification (non-optional parts and the "body" capability) is supported as long as it fits into this look & feel. . Dunst is designed to fit nicely into minimalistic windowmanagers like dwm, but it should work on any Linux desktop.February 16, 2023 at 3:31 pm #99698Member
techore
::@marcelocripe, I need to update the script to notify the user if no touchpad is detected. Currently, it lies and prints the touchpad is enabled even when none is found.
I will work on it during my lunch and attach to this post.
- This reply was modified 2 months, 3 weeks ago by techore.
February 16, 2023 at 4:46 pm #99714Member
marcelocripe
::Absolutely not in any way upset!
More like fascinated and very interested by the discussion.Many application programs, which I usually call solutions, are born here on the antiX forum from a question or a request.
I have done a few very basic very introductory programming courses (Assembly/C/Java).
So you know more than me… I only studied HTML 5, CSS and a very little PHP. The little I know about translating scripts into the Bash language was taught by Robin in the HexChat chat, in the #antiX-translators room of Libera.Chat using the automatic translation program for HexChat that Robin himself created. Communication in HexChat with automatic translation is very fast and instantaneous, even though I don’t know how to read or write in a language other than Brazilian Portuguese.
But I would really like to learn more at some point.
You can look at various program codes that are in antiX’s /usr/local/bin folder.
I am really enjoying looking at how these discussions take place in relation to developers working on a system I really like
Each person can help in some way, be it programming, testing, translating, creating manuals, etc. with what you know. The antiX community is like that, one helps the other.
– – – – –
Absolutely not in any way upset!
More like fascinated and very interested by the discussion.Muitos programas aplicativos, que eu costumo chamar de soluções, nascem aqui no fórum do antiX a partir de uma pergunta ou um pedido.
I have done a few very basic very introductory programming courses (Assembly/C/Java).
Então você sabe mais do que eu… Eu só estudei HTML 5, CSS e um muito pouco de PHP. O pouco que eu conheço sobre traduzir os script em linguagem Bash foi ensinado pelo Robin no bate-papo do HexChat, na sala #antiX-translators do Libera.Chat com o uso do programa de tradução automática para o HexChat que o próprio Robin criou. A comunicação no HexChat com a tradução automática é muito rápida e instantânea, mesmo eu não sabendo ler ou escrever em um idioma diferente do Português do Brasil.
But I would really like to learn more at some point.
Você pode olhar vários códigos dos programas que estão pasta /usr/local/bin do antiX.
I am really enjoying looking at how these discussions take place in relation to developers working on a system I really like
Cada pessoa pode ajudar de alguma forma, seja programando, testando, traduzindo, criando manuais, etc. com o que sabe. A comunidade antiX é assim, um ajuda o outro.
February 16, 2023 at 5:06 pm #99717MemberPPC
::I’m not sure if the Toggle off touchpad only when there’s a mouse is what you folks want here, but I reworked my previous script and added yad output windows (so there’s no need to have system notifications working… Also, there’s a warning, if no touchpad is found…
#!/usr/bin/env bash declare -i ID ID=xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}' info="" if [ -n "$(ls /dev/input/by-id/*mouse 2>/dev/null | grep -i 'usb\|PS\|COM')" ] then echo "antiX found a mouse, trying to disabling touchpad" xinput disable $ID|| yad --center --text="No touchpad was found" --button=" x " else xinput enable $ID || info="No touchpad was found" yad --center --text="No mice around, trying to enable touchpad \n $info" --button=" x " fiFebruary 16, 2023 at 5:28 pm #99718Member
marcelocripe
::I have no preference for the icon. I assume there a touchpad icon in whatever icon theme antiX is using.
I looked through folders of icon images in antiX 22, but I didn’t find any that were consistent with the program. Please try to find an image and upload it to your GitLab so I can download it from there.
It never occurred to me antiX didn’t have a notification daemon. If it does, then that will need to be investigated.
On the antiX DWM Spin, I am using dunst.As I don’t know how to program in Bash, so I can only give suggestions and ideas. I think of some options:
1 – Include the “dunst” package and all its dependencies: libc6 (>= 2.17), libcairo2 (>= 1.10.0), libgdk-pixbuf2.0-0 (>= 2.31.1), libglib2.0-0 (>= 2.35.8), libnotify4 (>= 0.7.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.22.0), libx11-6, libxext6, libxinerama1 , libxrandr2 (>= 2:1.5.0), libxss1, default-dbus-session-bus | dbus-session-bus as dependencies for “touchpad-toggle.sh”. This made me sad, because “touchpad-toggle.sh” worked perfectly just with the “xinput” package.
2 – Include in “touchpad-toggle.sh” windows or dialog boxes, where the user presses a button to “Disable Touchpad” and another button to “Enable Touchpad”. In this window or in another one, the confirmation message can be displayed.
3 – With or without the confirmation messages, what I know is that “touchpad-toggle.sh” works.
I appreciate you posting here the description of “dunst”.
I will work on it during my lunch and attach to this post unless you have a repo where you want me to do a merge or pull request.
If the antiX forum administrators or moderators don’t complain that we are consuming disk space from the forum service provider, then we can continue posting here. Or if you prefer, you can upload everything to your GitLab and you just let me know here so I can download the latest script from there.
As private messaging in this forum is disabled, we will only be able to communicate here on the forum or by email. My GMail is public, it’s “marcelocripe”. If you prefer, you can also email me updated versions to test with the translation features I plan to include in the script.
– – – – –
I have no preference for the icon. I assume there a touchpad icon in whatever icon theme antiX is using.
Eu procurei nas pastas das imagens dos ícones no antiX 22, mas eu não encontrei nenhuma que fosse coerente com o programa. Por favor, tente encontrar uma imagem e envie para o seu GitLab, assim eu posso baixar de lá.
It never occurred to me antiX didn’t have a notification daemon. If it does, then that will need to be investigated.
On the antiX DWM Spin, I am using dunst.Como eu não sei programar no Bash, então eu só posso dar sugestões e ideias. Eu penso em algumas opções:
1 – Incluir o pacote “dunst” e todas as suas dependências: libc6 (>= 2.17), libcairo2 (>= 1.10.0), libgdk-pixbuf2.0-0 (>= 2.31.1), libglib2.0-0 (>= 2.35.8), libnotify4 (>= 0.7.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.22.0), libx11-6, libxext6, libxinerama1, libxrandr2 (>= 2:1.5.0), libxss1, default-dbus-session-bus | dbus-session-bus como sendo dependências para o “touchpad-toggle.sh”. Isso me deixou triste, porque o “touchpad-toggle.sh” funcionou perfeitamente apenas com o pacote “xinput”.
2 – Incluir no “touchpad-toggle.sh” janelas ou caixas de diálogos, onde o usuário pressiona um botão para “Desativar o Touchpad” e um outro botão para “Ativar o Touchpad”. Nesta janela ou em uma outra, pode ser exibido a mensagem de confirmação.
3 – Com ou sem as mensagens de confirmações, o que eu sei é que o “touchpad-toggle.sh” funciona.
Eu agradeço por você postar aqui a descrição do “dunst”.
I will work on it during my lunch and attach to this post unless you have a repo where you want me to do a merge or pull request.
Se os administradores ou moderadores do fórum do antiX não reclamarem por estarmos consumindo espaço em disco do provedor de serviços do fórum, então poderemos continuar postando aqui. Ou se você preferir, você pode enviar tudo para o seu GitLab e você só me avisa aqui para eu baixar de lá o script mais recente.
Como a mensagem particular neste fórum está desativada, só poderemos nos comunicar aqui no fórum ou por e-mail. O meu GMail é público, é “marcelocripe”. Se você preferir, também poderá me enviar por e-mail as versões atualizadas para serem testadas com os recursos de tradução que eu pretendo incluir no script.
February 16, 2023 at 5:51 pm #99722MemberPPC
::@Marcelocripe – I’m not sure if this tool is ever going to be used by more people that those here on this thread, but if so: why is the pt entry on the .desktop so strange? There are some differences between pt and pt-br, but dispite what you may think, they are the same language. The pt-br localization can be used as the pt one…
It not not eve make sense: “Mudar de Touchpad” – Change touchpad? That means, if users have more than one touchpad, they can change to another touchpad. The script is meant to turn on or off the touchpad, so the best translation is really the pt-br or, the more formal “Comutar Touchpad”
I can rework the main script so it uses yad “notifications”, so it does not depend on system notifications (and having Dunst or similar software installed). Do you guys want that?P.
February 16, 2023 at 7:01 pm #99738Member
techore
::@PPC, if you do use yad, please ensure to set a window title/name. Most of the antiX utilities set a title, however, several set a title/name, initially, then spawn another window without a title. Problematic if writing rules using a dynamic window manager. antiX’s tools using yad were very challenging with my spin.
I need to track the owners down and do merge requests–one of them is skidoo which is problematic. It is on my growing “To do” list.
@Marcelocripe, I have cleaned up the script including removing the “echo” statements which I failed to delete after testing, clarified the dependencies, and created a check for no touchpad. I did not add your changes for my focus was to fix it versus understanding the translation process. Happy to learn. I can reconcile your changes and add them but I suspect you would be much faster at it then me. Let me know.
The new string to be translated is “Touchpad undetected” which is the same as “Touchpad not detected”.
If you would rather not use dunst, then the occurences of notify-send can be replaced with an echo, printf, yad, or something else entirely.
I cannot attach my script due to Wordfence.
https://gitlab.com/techore/antix-dwm/-/blob/main/file/bin/touchpad-toggle.sh
@all, feel free to provide constructive criticism on the bash shell script.
February 16, 2023 at 10:51 pm #99767Member
marcelocripe
::Hello PPC.
why is the pt entry on the .desktop so strange? There are some differences between pt and pt-br, but dispite what you may think, they are the same language. The pt-br localization can be used as the pt one…
The answer to your question is right in front of your eyes. Please check the “pt” translation of “conky-toggle.desktop”. You’ll see that I’ve only replaced the word “Conky” with “Touchpad” in the languages I’m able to identify as the Latin-derived script, the Arabic and Eastern language texts are automatic translations of the “pt_BR” text. And since I don’t have any property in writing, correcting or improving the texts in “pt”, I prefer that you adapt the texts in the best way so that your language can be better understood by the Portuguese and by the other “pt” speakers spread around the world. planet Earth and in other countries.
When I upload the .desktop file to techore again, I’ll copy the text “pt_BR” to the entry “pt”. Do not forget that the revisions of the .desktop files were made by Zeh, according to him, it no longer translates to “pt” in the antiX area. Therefore, we only have you to take care of the translations, corrections and improvements of the “pt” language. What is sorely missing for antiX.Thanks.
– – – – –
Olá PPC.
why is the pt entry on the .desktop so strange? There are some differences between pt and pt-br, but dispite what you may think, they are the same language. The pt-br localization can be used as the pt one…
A resposta para a sua pergunta está bem perto dos seus olhos. Por favor, verifique a tradução “pt” do “conky-toggle.desktop”. Você verá que eu apenas substituí a palavra “Conky” por “Touchpad” nos idiomas que sou capaz de identificar a escrita derivada do latim, os textos dos idiomas árabes e orientais são traduções automáticas do texto “pt_BR”. E como eu não tenho propriedade alguma em escrever, corrigir ou melhor os textos em “pt”, eu prefiro que você adapte os textos da melhor maneira para o seu idioma poder ser melhor compreendido pelos Portugueses e pelos outros falantes do “pt” espalhados no planeta Terra e em outros países.
Quando eu for enviar novamente o arquivo .desktop para o techore, eu tomarei o cuidado de copiar o texto “pt_BR” para a entrada “pt”. Não se esqueça que as revisões dos arquivos .desktop foram feitas pelo Zeh, segundo ele, não traduz mais para “pt” na área do antiX. Por tanto, só temos você para cuidar das traduções, correções e melhorias do idioma “pt”. O que faz muita falta para o antiX.Obrigado.
February 16, 2023 at 11:47 pm #99772Member
marcelocripe
::Happy to learn. I can reconcile your changes and add them but I suspect you would be much faster at it then me. Let me know.
Please learn more in this thread Internationalisation of antiX community scripts which was very well explained by Xecure. It will be very important for you who have skills with programming codes to know the methods of internationalization of scripts. At the time, I couldn’t understand the Xecure’s teachings, Robin learned how to do it and then he taught me. But my knowledge is limited, any modification that requires programming knowledge, I will not know how to make the translation work without damaging the program code.
If you would rather not use dunst, then the occurences of notify-send can be replaced with an echo, printf, yad, or something else entirely.
I tend to think like this “the less the better”. I don’t like to install a package of a program that is about 500KB and depends on hundreds of other packages to work. I’ve seen packages that are less than 1 MB, but their dependencies were over 130 MB. If “touchpad-toggle.sh” can work depending only on Bash’s Yad, it will be the best option in consuming less disk space. But you are the one who decides the course of the program. I can only give suggestions and ideas.
I cannot attach my script due to Wordfence.
To attach to this forum, use compressed files in “.zip” format.
@all, feel free to provide constructive criticism on the bash shell script.
As I wrote before, I really like the idea that the user can choose when the Touchpad should work or not.
Now I’m going to test the new version.
– – – – –
Happy to learn. I can reconcile your changes and add them but I suspect you would be much faster at it then me. Let me know.
Por favor, aprenda mais neste tópico Internationalisation of antiX community scripts que foi muito bem explicado pelo Xecure. Será muito importante para você que possui habilidades com os códigos de programação conheça os métodos de internacionalização dos scripts. Na época, eu não conseguia compreender os ensinamentos do Xecure, o Robin aprendeu como fazer e depois ele me ensinou. Mas os meus conhecimentos são limitados, qualquer modificação que exija conhecimentos de programação, eu não saberei fazer funcionar a tradução sem danificar o código do programa.
If you would rather not use dunst, then the occurences of notify-send can be replaced with an echo, printf, yad, or something else entirely.
Eu costumo pensar da seguinte forma “quanto menos melhor”. Eu não gosto de instalar um pacote de um programa que possui cerca de 500 KB e depende de outras centenas de pacotes para funcionar. Eu já vi pacotes que possuem menos de 1 MB, mas as suas dependêcias chegavam a mais de 130 MB. Se o “touchpad-toggle.sh” puder funcionar dependendo apenas do Yad do Bash, será a melhor opção em consumir menos espaço em disco. Mas é você que decide os rumos do programa. EU só posso dar sugestões e ideias.
I cannot attach my script due to Wordfence.
Para anexar neste fórum, utilize os arquivos compactados em formato “.zip”.
@all, feel free to provide constructive criticism on the bash shell script.
Como eu escrevi antes, eu gosto muito da ideia de que o usuário possa escolher quando o Touchpad deve funcionar ou não.
Agora eu vou testar a nova versão.
February 17, 2023 at 2:59 pm #99842MemberPPC
::@techore and all:
Here is your script, adapted to use yad for “notifications”. Please test it and see if it works, if it does, then the script works, out of the box in any antiX installation (if it has yad installed- Full version always has it)
#!/usr/bin/env bash # Project: antix-dwm # Location: /usr/local/bin/toggle-touchpad.sh # Dependencies: xinput libnotify-bin dunst # Description: Simple script to enable or disable touchpad and # send a desktop notification using libnotify. # Usage: dwm calls on use of XF86XK_TouchpadToggle. If your laptop # does not have a touchpad toggle key, assign to a key combo # using dwm's config.h file. TOUCHPAD=<code>xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}'</code> if test "$TOUCHPAD" = "" ; then #notify-send "Touchpad undetected" -t 3000 yad --borders=10 --image="/usr/share/icons/papirus-antix/48x48/emblems/emblem-important.png" --undecorated --geometry=280x50-40-50 --window-icon=/usr/share/icons/Adwaita/48x48/devices/input-touchpad-symbolic.symbolic.png --title=$"Touchpad Toggle" --text=$"No touchpad detected" --button=" x " --timeout=3 --timeout-indicator=bottom --on-top --skip-taskbar exit fi ID=<code>grep -Eo '[0-9]{1,2}' <<< "$TOUCHPAD"</code> STATE=<code>xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'</code> if test $STATE -eq 0 ; then xinput enable $ID #notify-send "Touchpad enabled" -t 3000 yad --borders=10 --image="/usr/share/icons/papirus-antix/48x48/status/input-touchpad-on.png" --undecorated --geometry=280x50-40-50 --window-icon=/usr/share/icons/Adwaita/48x48/devices/input-touchpad-symbolic.symbolic.png --title=$"Touchpad Toggle" --text=$"Touchpad enabled" --button=" x " --timeout=3 --timeout-indicator=bottom --skip-taskbar --on-top else test $STATE -eq 1 xinput disable $ID #notify-send "Touchpad disabled" -t 3000 yad --borders=10 --image="/usr/share/icons/papirus-antix/48x48/status/input-touchpad-off.png" --undecorated --geometry=280x50-40-50 --window-icon=/usr/share/icons/Adwaita/48x48/devices/input-touchpad-symbolic.symbolic.png --title=$"Touchpad Toggle" --text=$"Touchpad disabled" --button=" x " --timeout=3 --timeout-indicator=bottom --skip-taskbar --on-top fiEdit1: I kept the text shown in the enabled/disabled notifications, but I think it’s redundant- the icons speak for themselves (and you can use other icons, of course, I just searched the system and used the first ones that popped up).
I use yad a lot for “notifications”, like that, in my scripts, to avoid depending on system notifications (that are not enabled by default in antiX, until the user install Dunst or a similar program).
I kept the same 3 seconds for the “notification”. Since clicking the window does not make it go away, I left a “close” button on the windows. I hope that the ” x ” sign is universally understood, and lets users know what that button does… (Yes, Marcelo, this is me being ironic, my friend 🙂 ).Edit2: Since the forum software mangled the code, I attach the revised script, in a compressed file…
Edit3: I uploaded the compressed script, got a warning for “Suspicious activity” and then noticed 2 files were uploaded. Ignore the second one…
I forgot to say – The progress bar showing how much time until the “notification” closes is optional. If you do not like it, remove the “–timeout-indicator=bottom” flags for each yad window…P.
- This reply was modified 2 months, 3 weeks ago by PPC.
- This reply was modified 2 months, 3 weeks ago by PPC.
- This reply was modified 2 months, 3 weeks ago by PPC.
Attachments:
February 17, 2023 at 3:57 pm #99856Member
marcelocripe
::I was going to post here the results of the tests I did yesterday, but I’ll just say that everything worked as expected after installing “xinput” (the “touchpad-toggle.sh” from 2023-02-16 works but does not display notifications) and “dunst” (the “touchpad-toggle.sh” from 2023-02-16 works and still displays notifications), “libnotify-bin” already comes in the 64-bit antiX 22 full ISO. The “touchpad-toggle.desktop” file now has the text of the “pt” entry the same as the “pt_BR” entry.
If the version modified by PPC does not depend on “dunst”, then it is one less program to disable or enable the Touchpad and that is very good.
What will the name of the program be? If the name “Touchpad Toggle” is to be changed to “Touchy Yad”, all translations will need to be changed in the .desktop file.
And what will be the image for the program’s shortcut icon?
– – – – –
Eu ia postar aqui os resultados dos testes que eu fiz ontem, mas eu vou apenas dizer que tudo funcionou como esperado após a instalação do “xinput” (o “touchpad-toggle.sh” do dia 16-02-2023 funciona mas não exibe as notificações) e do “dunst” (o “touchpad-toggle.sh” do dia 16-02-2023 funciona e ainda exibe as notificações), o “libnotify-bin” já vem na ISO do antiX 22 full de 64 bits. O arquivo “touchpad-toggle.desktop” agora possui o texto da entrada “pt” igual da entrada “pt_BR”.
Se a versão modificada pelo PPC não depende do “dunst”, então é um programa a menos para desativar ou ativar o Touchpad eisso é muito bom.
Qual será o nome do programa? Se o nome “Touchpad Toggle” será mudado para “Touchy Yad”, todas as traduções precisarão ser alteradas no arquivo .desktop.
E qual será a imagem para o ícone de atalho do programa?
-
AuthorPosts
- You must be logged in to reply to this topic.