kdesu problems with kubuntu 22.04

In Kubuntu 22.04 it could be impossible to start programs such as kubuntu from kde menu while with terminal (command sudo krusader) it will remain possible.

To fix this bug (due to the lack of kdesu in kubuntu 22.04), you can use (in kde menu):

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY krusader

programmare (schedule) un evento

Si può usare, in Linux, crontab. Così:

1. Create uno script. Ad esempio, se volete che vi sia ricordato di bere:

#!/bin/sh

kdeconnect-cli –ping-msg “ricordati di bere!” -d d30fdc9ed6e2bf56
play /mnt/musica/avviso.wav &&
zenity –info –display=:0.0
    –text=”Time is $(date +%Hh%M)nnricordati di bere.”
    –title=”drink time”

2. creare un evento crontab
    a. in un terminale digitale crontab -e
    b. digitare, ad esempio in nano, 30 8-11,15-18 * * * /path/to/script

Per vedere se il sistema ha salvato correttamente il proprio file di cron, digitare il seguente comando:
crontab -l
 

3. Per avere anche sullo smartphone l’avviso dovete avere kdeconnect
 
Fatto!

python script per cycle case (lower – mixed – upper)

Utile con autokey. Eccolo:

pre.CICodeFormatter{
font-family:arial;
font-size:12px;
border:1px dashed #CCCCCC;
width:99%;
height:auto;
overflow:auto;
background:#f0f0f0;
line-height:20px;
background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);
padding:0px;
color:#000000;
text-align:left;
}
pre.CICodeFormatter code{
color:#000000;
word-wrap:normal;
}

 # Get the current selection.  
 sText=clipboard.get_selection()  
 lLength=len(sText)  
   
 try:  
   if not store.has_key("textCycle"):  
     store.set_value("state","title")  
   
 except:  
   pass  
   
 # get saved value of textCycle  
 state = store.get_value("textCycle")  
   
   
 # modify text and set next modfication style  
 if state == "title":  
   #sText=sText.capitalize()  
   sText=sText.title()  
   newstate = "lower"  
   
 elif state == "lower":  
   sText=sText.lower()  
   newstate = "upper"  
   
 elif state == "upper":  
   sText=sText.upper()  
   newstate = "title"  
   
 else:  
   newstate = "lower"  
   
 # save for next run of script  
 store.set_value("textCycle",newstate)    
   
 # Send the result.  
 keyboard.send_keys(sText)  
 keyboard.send_keys("<shift>+<left>"*lLength)  

Krusader: per sincronizzare

all’inizio

si può aprire da terminale Krusader scegliendo quale pannello debba stare a sinistra e quale a destra, ad esempio
“krusader –left /path –right /media/path”

escludere certi (tipi di) files dalla sincrinizzazione

In file filter anteporre | al tipo di file. Ad esempio “| *.ini” per escludere dalla sincro i files con estensione ini.

exclude a program from autokey

Per settare più programmi con autokey, in window filter
(progr1)|(progr2).

per escludere un programma da un item di autokey 

Si può usare questa regex: ^((?!.*Firefox).)*$
In questo caso escludiamo Firefox: non occorre mettere tutto il nome della window, ma solo la parte finale (senza spazi o punti). In effetti la finestra di Firefox sarebbe “Navigator.Firefox”, ma così non funzionerebbe.

un bug 

L’esclusione suddetta non funziona per il terminale (konsole). Speriamo che risolvano. Per aggirare questo ostacolo si possono indicare (positivamente) tutti gli altri programmi in cui si usa quella abbreviazione.