Scripts and tips

How about a general scripts & tips thread with ideas and little helpers which can make our Arch/EndeavourOS live easier?

To go by example here’s one I find quite helpful:

Integration of Virustotal into Dolphin file manager

  1. Create account on Virustotal to get access to the API
  2. Install virustotal CLI tool
  3. Add your new API key to /etc/virustotal.conf file
  4. Add script and desktop file to provide easy access to virustotal

This script can be run via CLI and with a Desktop file also from Dolphin

#!/bin/bash
# Prerequisits:
# - virustotal CLI app installed: "yay -S virustotal"
# - Create virustotal API key via registring on their website: https://www.virustotal.com/gui/join-us
# - Virustotal API key added to /etc/virustotal.conf
# - Optional: Corresponding KDE service menu copied to ~/.local/share/kservices5/ServiceMenus/

Divider1="##############################################################################"
Divider2="------------------------------------------------------------------------------"
version="1.0.0"

echo $Divider1
echo "Virustotal file checker v. $version"
if [ "$1" == "" ]; then 
    echo "No file name given"
	echo "Usage: virustotal <filename>"
    if (( SHLVL < 2 )) ; then
        read -p "Press any key to close window" answer
    fi
else
    echo "Uploading $1 to Virustotal website..."
    echo $Divider2
    virustotal "$1"
    echo $Divider2
    if (( SHLVL < 2 )) ; then
        read -p "Press any key to close window" answer
    fi
fi

The desktop file needs to go to ~/.local/share/kservices5/ServiceMenus/
Make sure you adjust the path and name of the script in this line

Exec=konsole -e ~/scripts/virustotal.sh %F

to fit your requirements as far as the name and location of the bash script is concerned.

Here’s my viruscheck.desktop:

[Desktop Entry]
Actions=virustotal
MimeType=all/all;
ServiceTypes=KonqPopupMenu/Plugin
Type=Service
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false
X-KDE-Submenu=Virus check


[Desktop Action virustotal]
Exec=konsole -e ~/scripts/virustotal.sh %F
Icon=scanner
Name=Send to Virustotal

Here’s the result:

5 Likes

I just stumbled over this thread here: Share your alias AND/OR function and think this post would fit well there. Can a administrator possibly move this post over to the alias/function thread?

A post was merged into an existing topic: Share your alias AND/OR function

Done as you asked.

Make sure you edit out any necessary changes in context of that thread.

1 Like