mirror of
https://github.com/byReqz/blackmate.git
synced 2024-11-01 11:33:13 +00:00
Add files via upload
This commit is contained in:
parent
9134d1af28
commit
83d68df719
4
BlackArch-Misc.directory
Normal file
4
BlackArch-Misc.directory
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=Misc
|
||||||
|
Icon=BlackArch-Websites
|
||||||
|
Type=Directory
|
BIN
blackmate.png
Normal file
BIN
blackmate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 290 KiB |
8
dfdesk
Normal file
8
dfdesk
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=default
|
||||||
|
Icon=utilities-terminal
|
||||||
|
Comment=default
|
||||||
|
Exec=default
|
||||||
|
Terminal=True
|
||||||
|
Type=Application
|
||||||
|
Categories=default
|
46
generator.sh
46
generator.sh
@ -2,16 +2,31 @@
|
|||||||
#
|
#
|
||||||
# First shot, considering this as an alpha version
|
# First shot, considering this as an alpha version
|
||||||
#
|
#
|
||||||
# Description : Tools menu generator for gtk based desktop, tested on xfce4 and mate-desktop
|
# Description : BlackMate is a generator menu of the BlackArch tools for the window manager Mate
|
||||||
# This will create new .desktop base on the tools list of BlackArch, those shall be move to /usr/share/applications/
|
# This will create a new entry for the menu and generate for each categories, the .desktop launcher of the tools list.
|
||||||
|
# Make sure mate-terminal is available on your system
|
||||||
|
# This script need to be start as root
|
||||||
#
|
#
|
||||||
# Author : Dimitri Mader -> dimitri@linux.com
|
# Author : Dimitri Mader -> dimitri@linux.com
|
||||||
# Gnu / GPL v3
|
# Gnu / GPL v3
|
||||||
|
|
||||||
|
#Check if the script is launch with root
|
||||||
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
echo "This script must be run as root"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
for u in $( ls categories/ | sort ); do
|
#Clean any previous ba-*.desktop
|
||||||
|
rm /usr/share/applications/ba-*.desktop 2> /dev/null || true
|
||||||
|
|
||||||
cntools=`wc -l < categories/$u`;
|
#Delete the entry Website and add the entry Misc
|
||||||
|
rm /usr/share/desktop-directories/BlackArch-Websites.directory 2> /dev/null || true
|
||||||
|
cp BlackArch-Misc.directory /usr/share/applications/
|
||||||
|
|
||||||
|
#Start to loop each categories
|
||||||
|
for u in $( ls categories/ | sort ); do
|
||||||
|
|
||||||
|
#Set namecat var to his right categorie name
|
||||||
|
|
||||||
if [[ "$u" == 'reversing ' ]] || [[ "$u" == 'disassembler' ]] || [[ "$u" == 'binary' ]] || [[ "$u" == 'code-audit' ]] || [[ "$u" == 'analysis' ]] ||
|
if [[ "$u" == 'reversing ' ]] || [[ "$u" == 'disassembler' ]] || [[ "$u" == 'binary' ]] || [[ "$u" == 'code-audit' ]] || [[ "$u" == 'analysis' ]] ||
|
||||||
[[ "$u" == 'debugger' ]] || [[ "$u" == 'decompiler' ]]; then
|
[[ "$u" == 'debugger' ]] || [[ "$u" == 'decompiler' ]]; then
|
||||||
@ -61,15 +76,26 @@
|
|||||||
else
|
else
|
||||||
|
|
||||||
namecat=`echo X-BlackArch-Misc;`;
|
namecat=`echo X-BlackArch-Misc;`;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
a=`cat categories/$u | sed 's/|/\n/g' | sed 's/http.*//' | sed '/^$/d' | sort -r | head -n $cntools`;
|
#Extract name of the tools
|
||||||
|
a=`cat categories/$u | awk -F '|' '{ print $1 }'`;
|
||||||
|
|
||||||
for i in $a; do
|
#For each tools of the target categorie
|
||||||
|
for i in $a; do
|
||||||
|
|
||||||
cat gendesk | sed -e 's/Name=.*/Name='$i'/' | sed -e 's/TryExec=.*/TryExec=\/usr\/bin\/'$i'/' |
|
#Parse the default launcher and set his name
|
||||||
sed 's/Exec=.*/Exec=sh -c '\''\/usr\/bin\/'$i' -Help;$SHELL'\''/' |
|
cat dfdesk | sed 's/^Name=.*/Name='$i'/' |
|
||||||
sed -e 's/Categories=.*/Categories='$namecat'/' > ba-$i.desktop
|
#Set the bash command to execute
|
||||||
|
sed 's/^Exec=.*/Exec=mate-terminal -e "bash -ic \\"\/usr\/bin\/'$i'; exec bash"\\"/' |
|
||||||
|
#Set the categorie to the launcher && Set the name file to ba-`toolsname`.desktop
|
||||||
|
sed 's/Categories=.*/Categories='$namecat';/' > ba-$i.desktop
|
||||||
|
|
||||||
|
#End of the current tool
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#End of the current categorie
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#Move the .desktop to the right directory
|
||||||
|
mv ba-*.desktop /usr/share/applications
|
||||||
|
Loading…
Reference in New Issue
Block a user