Forum › Forums › antiX-development › Development › IceWM Double Click speed GUI selector
- This topic has 7 replies, 3 voices, and was last updated Mar 2-6:11 pm by marcelocripe.
-
AuthorPosts
-
October 28, 2021 at 9:16 pm #69707Member
PPC
Hi, all, over at the Portuguese sub-forum, I helped out an user that needed to change the double click speed. That made me think that a simple GUI to select that particular setting was the only thing missing from Control Center’s Mouse settings, so I wrote a small yad script that displays a slider that sets the double click speed.
It’s only for IceWM, but if there’s any interest, I can make the script work also in Fluxbox and JWM, with a bit more work…P.
#!/bin/bash # BY PPC, 28-10-2021, GNU licence # GUI TO select Double click speed in icewm # # Strings to localize: warning_title="Warning" warning_text="This script is meant to be run only in an IceWM desktop" text="Double Click Speed" ###Start of real code script: ###Check if the current desktop is IceWM, if not, exit desktop=$(wmctrl -m) if [[ $desktop == *"icewm"* ]]; then echo $"IceWM.... OK" else yad --title="$warning_title" --text="$warning_text" --timeout=10 --no-buttons --center exit fi FILE="$HOME/.icewm/preferences" #Make sure field regarding this variable is not commented out (it is by default in the antiX config file): sed -i '/^#.*MultiClickTime.*$/s/^#\ //' $FILE # CURRENT_VALUE=$(egrep "^MultiClickTime=" $FILE | cut -d'=' -f2 | cut -d'%' -f1) selection=$(yad --title="$text" \ --geometry=800x100+100+200 --window-icon="" \ --scale \ --value=$CURRENT_VALUE --min-value="0" --max-value="5000" --step="100") NEW_VALUE=$(echo $selection | cut -d'|' -f1 | cut -d'.' -f1) #IF no value was selected, exit [ -z "$NEW_VALUE" ] && exit # If a new value was selected, apply it to the comfig file and restart icewm sed_param=s/MultiClickTime=.*/MultiClickTime=${NEW_VALUE}/ sed -i "$sed_param" $FILE killall -SIGHUP icewm- This topic was modified 1 year, 6 months ago by PPC.
- This topic was modified 1 year, 6 months ago by PPC.
October 29, 2021 at 3:52 pm #69735Member
marcelocripe
::Hello PPC.
I tested your script and it worked. All the changes I made through the GUI were made in the ‘preferences’ file in the ‘.icewm’ folder.
Would it be possible to have a new button in the ds-mouse program, when the user clicks on the ‘Double Click Speed’ button a script checks which Window Manager is active and then edits the corresponding file?
Grateful.
marcelocripe
(Original text in Brazilian Portuguese language)– – – – –
Olá PPC.
Eu testei o seu script e funcionou. Todas as alterações que eu fazia através da interface gráfica foram feitas no arquivo ‘preferences’ da pasta ‘.icewm’.
Será que seria possível um novo botão no programa ds-mouse, quando o usuário clicar no botão ‘Double Click Speed’ um script verifica qual é o Gerenciador de Janelas que está ativo e assim editará o arquivo correspondente?
Grato.
marcelocripe
(Texto original em idioma Português do Brasil)October 29, 2021 at 4:36 pm #69737Forum Admin
Dave
::@PPC,
If you could make a function in ds-mouse (https://gitlab.com/antiX-Linux/ds-mouse-antix/-/blob/master/bin/ds-mouse) with another command line argument under the case statement at the end of the script; I can add the slider option within the ds-mouse python gui.You can get the currently running window manager via the DESKTOP_SESSION_WM environment variable or read / parse the window manager from the ~/.desktop-session/desktop-code.$display file. $display is the environment variable $DISPLAY cut to be the first number of the output (EX: $DISPLAY=:1.2 $display=1) If you source the desktop-session-file-locations.sh file you can use the variable $desktop_code and not worry that it will be different than what desktop-session uses for the code file, but that would make it dependent on desktop-session.
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
November 5, 2021 at 2:16 pm #70304MemberPPC
::@Dave: sorry for not replying, I was busy with the latest TIM version… I’ll try to take a stab at ds-mouse, but I’m a bash and yad guy only, I know nothing of python…
P.
November 5, 2021 at 4:41 pm #70329Forum Admin
Dave
::I’ll try to take a stab at ds-mouse, but I’m a bash and yad guy only, I know nothing of python…
Perfect! It should only be bash that is needed.
The python part is done and the option / function. Only need to take into account the window manager and the code to change the needed configs based on what the window manager is.https://gitlab.com/antiX-Linux/ds-mouse-antix/-/blob/master/bin/ds-mouse
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
March 1, 2023 at 6:16 pm #100878Member
marcelocripe
::Hello Dave.
Could you please include one or three more programs in “mouse-ds”?
It would be the “IceWM Double Click speed GUI selector”, “Fluxbox Double Click speed GUI selector” and “JWWM Double Click speed GUI selector”.
The antiX does not have a GUI to control the double-click speed, i.e. the time interval between the first click and the second click.
Note: I and all people who get antiX through me use zzzFM (or SpaceFM) with double click to open folders or files.
– – – – –
Olá Dave.
Por favor, você poderia incluir mais um ou três programas no “mouse-ds”?
Seria o “IceWM Double Click speed GUI selector”, o “Fluxbox Double Click speed GUI selector” e o “JWWM Double Click speed GUI selector”.
O antiX não possui uma GUI para controlar a velocidade do clique duplo, ou seja, o intervalo de tempo entre o primeiro clique e o segundo clique.
Observação: Eu e todas as pessoas que recebem o antiX através de mim, utilizam o zzzFM (ou o SpaceFM) com o clique duplo para abrir as pastas ou os arquivos.
March 2, 2023 at 6:09 pm #100941Member
marcelocripe
::In the other topic How antiX is progressing, and some suggestions for the future Dave wrote:
I had started this a while ago as shown in the thread you linked to.
Finished both options now. (Multiclick time, and touchpad lockout while typing)
Also added the option to completely disable the touchpad as well as enable / disable reverse (Natural) scrolling.These are also scriptable via sed (to edit ~/.desktop-session/mouse.conf) and ds-mouse; see ds-mouse -h.
Note: ~/.desktop-session/mouse.conf will need to be edited manually first to match the updated mouse.conf otherwise it will error out due to missing options.
https://gitlab.com/antiX-Dave/ds-mouse-antixEdit: The multiclick / doubleclick speed is set based on the window manager running; but the gui does not directly reflect this. Should it be set as per window manager based on the currently running one or should it update all of them regardless if running or not?
– – – – –
No outro tópico How antiX is progressing, and some suggestions for the future o Dave escreveu:
I had started this a while ago as shown in the thread you linked to.
Finished both options now. (Multiclick time, and touchpad lockout while typing)
Also added the option to completely disable the touchpad as well as enable / disable reverse (Natural) scrolling.These are also scriptable via sed (to edit ~/.desktop-session/mouse.conf) and ds-mouse; see ds-mouse -h.
Note: ~/.desktop-session/mouse.conf will need to be edited manually first to match the updated mouse.conf otherwise it will error out due to missing options.
https://gitlab.com/antiX-Dave/ds-mouse-antixEdit: The multiclick / doubleclick speed is set based on the window manager running; but the gui does not directly reflect this. Should it be set as per window manager based on the currently running one or should it update all of them regardless if running or not?
A tradução automática está abaixo para auxiliar os falantes do idioma Português:
Eu comecei isso há algum tempo, conforme mostrado no tópico ao qual você vinculou.
Terminei as duas opções agora. (Tempo de cliques múltiplos e bloqueio do touchpad durante a digitação)
Também foi adicionada a opção de desativar completamente o touchpad, bem como ativar/desativar a rolagem reversa (Natural).Eles também podem ser programados via sed (para editar ~/.desktop-session/mouse.conf) e ds-mouse; consulte ds-mouse -h.
Observação: ~/.desktop-session/mouse.conf precisará ser editado manualmente primeiro para corresponder ao mouse.conf atualizado, caso contrário, ocorrerá um erro devido à falta de opções.
https://gitlab.com/antiX-Dave/ds-mouse-antixEdit: A velocidade de multiclique/duplo clique é definida com base no gerenciador de janelas em execução; mas o gui não reflete isso diretamente. Ele deve ser definido de acordo com o gerenciador de janelas com base no atual ou deve atualizar todos eles, independentemente de estar em execução ou não?
March 2, 2023 at 6:11 pm #100942Member
marcelocripe
::Edit: The multiclick / doubleclick speed is set based on the window manager running; but the gui does not directly reflect this. Should it be set as per window manager based on the currently running one or should it update all of them regardless if running or not?
Dave, honestly, I really liked both possibilities, both being able to apply it to the three window managers (IceWM, JWM and Fluxbox), and applying it only to the running window managers. But if it only works in the running window managers, we already have something very important for users who use the double click.
Is it too much work for you to implement the two possibilities (options) available or is it better to implement only one?
What does the anti-capitalist and others consider to be the most coherent option?
Thank you very much for returning to “ds-mouse”.
– – – – –
Edit: The multiclick / doubleclick speed is set based on the window manager running; but the gui does not directly reflect this. Should it be set as per window manager based on the currently running one or should it update all of them regardless if running or not?
Dave, sinceramente, eu gostei muito das duas possibilidades, tanto de poder aplicar nos três gerenciadores de janelas (IceWM, JWM e Fluxbox), quanto aplicar apenas no gerenciadores de janelas em execução. Mas se funcionar apenas no gerenciadores de janelas em execução já teremos algo muito importante para os usuários que utilizam o duplo clique.
É muito trabalhoso para você implementar as duas possibilidades (opções) disponíveis ou é melhor implementar apenas uma?
O que o anticapitalista e as outras pessoas consideram ser a opção mais coerente?
Muito obrigado por você retornar ao “ds-mouse”.
-
AuthorPosts
- You must be logged in to reply to this topic.