ooo that looks nice! I’ll try it once I need to unrust my script skills again, thanks for the help!
It’s fixed now! At first I researched a little more and found about the desktop-file-validate
cli utility from the desktop-file-utils
package, and it did tell me a lot about the syntax errors I was making with the exec command.
But as you wisely suggested, dealing with those escaping rules was a bit too bothersome for my use case, so I ended going the bash script route which worked flawlessly at last! So thank you for pointing that out!
Here’s the final .desktop file for anyone interested:
[Desktop Entry]
Type=Service
MimeType=image/png;image/jpg;image/jpeg;image/ico;image/heic;image/svg+xml;image/webp;
Actions=topng;tojpg;toico;towebp
X-KDE-Submenu=Convert Image Format
Icon=viewimage
[Desktop Action topng]
Name=To Png
Exec=/home/myuser/.local/share/kio/servicemenus/scripts/convert-image.sh %f png
Icon=viewimage
[Desktop Action tojpg]
Name=To Jpg
Exec=/home/myuser/.local/share/kio/servicemenus/scripts/convert-image.sh %f jpg
Icon=viewimage
[Desktop Action toico]
Name=To Ico
Exec=/home/myuser/.local/share/kio/servicemenus/scripts/convert-image.sh %f ico
Icon=viewimage
[Desktop Action towebp]
Name=To Webp
Exec=/home/myuser/.local/share/kio/servicemenus/scripts/convert-image.sh %f webp
Icon=viewimage
and the bash script coupled with it:
#!/bin/bash
FILE="${1}"
FORMAT="${2}"
# Check if magick is installed
if ! command -v magick &> /dev/null; then
echo "Error: magick command not found. Please install ImageMagick."
exit 1
fi
# Check if FILE exists
if [[ ! -f "$FILE" ]]; then
echo "File not found: $FILE"
exit 1
fi
DIRECTORY=$(dirname "$FILE")
# Get the file name by looking for the longest match starting from the beginning of the string up to the last dot.
FILENAME=$(basename "$FILE" .${FILE##*.})
# Convert the file format using magick
magick "$FILE" -format "$FORMAT" "$DIRECTORY/$FILENAME.$FORMAT"
If I understood correctly, I made the changes as you said like this:
Exec=sh -c "FILE=\"%f\"; DIRECTORY=\"$(dirname \"$FILE\")\"; FILENAME=\"${FILE%.*}\"; magick \"$FILE\" -format png \"$DIRECTORY/$FILENAME.png\""
Now when I click on the service menu option this error popup appears:
Syntax error in command sh -c "FILE=%f; DIRECTORY=$(dirname $FILE); FILENAME=${FILE%.*}; magick $FILE\ -format png $DIRECTORY/$FILENAME.png" coming from
It seems escaping the double quotes doesn’t actually escape the backlash with it?
I then tried escaping those new backlashes like this
Exec=sh -c "FILE=\\"%f\\"; DIRECTORY=\\"$(dirname \\"$FILE\\")\\"; FILENAME=\\"${FILE%.*}\\"; magick \\"$FILE\\" -format png \\"$DIRECTORY/$FILENAME.png\\""
and now Dolphin doesnt complain about syntax, but the new converted image doesn’t get made :(
For anyone wanting to relive the minecraft 7th gen console experience on PC, I suggest you give the Legacy4J mod a try, specially with the Re-Console Modpack. I had lots of fun revisiting the old tutorial worlds
That vimeo link of the spanish tv crew coverage doesn’t seem to work for me. Do you happen to have any mirror of it?
Tux is in need of a glass of wine to handle all those pesky windows households
Checking your battery percentage by using neofetch is wildd
Bingo bango bongo, bish bash bosh
Wouldn’t it put Firefox on a pickle? Say Chrome gets bought out of Google’s hands, would they still bother to pay half a billion to Firefox to stay as the default search engine? Could Firefox survive being financially independent?
I went into void as my first DIY distro, mainly because I wanted to mess around with window managers and it was a very good experience. Runit made my underpowered laptop boot into linux in like 4 seconds, crazy fast. XBPS package manager was always really really fast too. I like the fact that nearly everything you need is in the official repo, instead of having to delve into the depths of something like the AUR. I also managed to make a contribution to the repos with the help of the community on the IRC chat rooms which were very noob friendly. Overall just a solid experience.
Definitely overkill, but considering the chip is going into flagship phones it’s almost to be expected. Really going off topic here, but with this much performance, I really think the next step should be to make x86_64 apps compatible on these phones. Wine on ARM is getting pretty good with projects like FEX and Box64 being capable of getting console-like performance on full blown desktop games with these newer phones. Idk, I feel like features like Samsung Dex could actually become a serious desktop replacement if they could implement more office solutions from PC’s programs. We’re at the point where I think it would be feasible to do, imo.
Maybe using whatsapp web is worth a shot? I saw a while ago a webapp apk of it on f-droid
Super mario maker’s “x” bubbles that show where people died in the level really gives the game a nice touch. Makes you not feel as bad for dying in an easy obstacle lol.
When an app supports linux, it can do so by either:
or
These last ones are sandboxed environments. That means they have their own dependencies isolated from your system, so they dont have to deal with every distros pecularities at the cost of using more storage space. This is very useful for developers and in your case benefitial for the user because you can have both steam and zoom via flatpak on mint, arch or any obscure distro that has flatpak available, without any major problems.
Edit: Formatting
Oh yeah. My initial plan was to install termux on it and use it as a server for a simple webpage I wanted to make, but the official rom i had was 32bit and the newer termux releases only support 64bit os.
I was going to give up, but while digging for more info I found out that for some reason the chip on my moto g4 was 64bit but not the OS. So I searched in the depths of the xda forums for a 64bit rom, which resulted in way too many dead links and dubious sources. Ended up using some obscure anime themed custom rom that crashed whenever I wanted to open the camera or use the flashlight BUT, it installed and ran termux nicely.
Overall I got what I wanted, but there wasn’t any good quality rom I could find as they all had some sort of flaw. Hope you get better luck though! Those phones are still perfectly usable if not for lack of software support
For the moto E4, Motorola has a guide in their support site to unlock the bootloader. I used it to be able to flash a 64bit rom for my moto g4 plus and the process was pretty straightfoward, although you do need a pc to use the adb command line tool.
Kinky cazzu 😈
I’ve got to try #1