How to launch custom scripts from right click menu on caja

2018-06-17 09:06:38




In order to create a script to launch it from mouse right click menu on caja you have to create a bash script and put it on : 
/home/user/.config/caja/scripts/
Where you have to replace user with your username
After that make the script executable with:
sudo chmod +x nomescript.sh

A useful script is this one that compress the selected folder and then delete it keeping only the compressed one.
Use it at your own risk


prefix="file://"
string=$(echo $CAJA_SCRIPT_SELECTED_URIS | tr "%20" " " ) #replace %20 with double space
string=$(echo $string | tr " " " " ) #replace double space with single space
#echo "$string" >> a
file_path=$(echo "$string" | grep -oP "^$prefix\K.*") #remove file:// from filename
current_file=$(basename "$file_path") #get the name after the last slash
#echo "$file_path" >> a
#echo "$current_path" >> a
zip -r -j "$current_file" "$current_file" && rm -rf "$current_file" #compress the file and delete the original


Method tested on debian 9 with Mate and Caja filemanager.
Comments




My new PC setup!!! i7 8700

2018-05-26 19:33:38




This is my new PC setup with i7 8700:


Cpu: Intel i7 8700 
Intel Core i7 8700 Cpu Processore, Argento


Motherboard:
Asrock Z370 Extreme4 LGA 1151


Asrock Z370 Extreme4 LGA 1151 (Socket H4) ATX motherboard - Motherboards (DDR4-SDRAM, DIMM, 2133,4333 MHz, Dual, 64 GB, Intel)


Ram:
Corsair Vengeance LPX 32 gb 3000MHZ
I have been a bit overkill but I wanted to boot debian in Ram so 32 gb is nice:)

Corsair Vengeance LPX Memorie per Desktop a Elevate Prestazioni, 32 GB (2 X 16 GB), DDR4, 3000 MHz, C15 XMP 2.0, Nero

SSD:
Samsung MZ-V7E250BW SSD 970 EVO, 250 GB
The best ssd available at the moment , its read speed is important for a fast ramboot!

Samsung MZ-V7E250BW SSD 970 EVO, 250 GB, M.2, NVMe, Nero/Arancione
Comments




Compress all the folders in a directory with rar on Linux

2018-05-07 19:54:41




To compress all the folders in a directory on the current path (only the folders)
Open a bash terminal , move to the wanted path with cd , then type:


for dir in */
do
 base=$(basename "$dir")
 rar a "${base}" "$dir"
 echo $base >> "log"
 rm -rf "$base"
done

Press enter.
Each folder will be replaced with a rar file with the same name and the same files the folders had.
Try this on some test folders before using it on the final folders..
Comments




     next >