Compare commits

...

9 Commits

8 changed files with 101 additions and 10 deletions

View File

@ -47,6 +47,8 @@ Here you go!
![nanodesk_6](screenshots/nanodesk_6.png)
![nanodesk_7-n-i-gxm](screenshots/nanodesk_7-n-i-gxm.png)
![nanodesk_7](screenshots/nanodesk_7.png)
![nanodesk_7](screenshots/nanodesk_8.png)
@ -199,3 +201,4 @@ Download: [http://pub.la10cy.net/nanodesk/](http://pub.la10cy.net/nanodesk/)
- xdgmenumaker deb package: https://bgstack15.wordpress.com/2020/03/03/package-for-devuan-xdgmenumaker/
- How To debootstrap a small desktop system: https://git.la10cy.net/DeltaLima/devnull/src/branch/main/debootstrap_minimal_dekstop_from_scratch.md
- How To create a linux live cd: https://www.willhaley.com/blog/custom-debian-live-environment/
- Tux: https://archive.org/details/linuxmandrake7.2chipedition

View File

@ -128,6 +128,8 @@ apt install -y --no-install-recommends \
tango-icon-theme \
squashfs-tools \
synaptic \
imagemagick \
ifstat \
/tmp/xdgmenumaker*.deb || error
message "install nanodesk base packages with recommends"

View File

@ -114,20 +114,13 @@ done
message "copy build/nanodesk-files/ to build/chroot/"
sudo cp -r build/nanodesk-files/* build/chroot/
message "generate icon path list for jwm config"
find build/chroot/usr/share/icons/ -type d | sed 's/build\/chroot//g' > build/tmp/jwm.iconlist
sed -i -e 's/^/\ \ \ \ <IconPath>/g' -e 's/$/<\/IconPath>/g' build/tmp/jwm.iconlist
sudo cp build/tmp/jwm.iconlist build/chroot/tmp/ || error
message "putting generated icon path list to /etc/jwm/system.nanodesk.jwmrc"
$CHROOTCMD sed -i '/<\!-- GENERATED ICONLIST -->/r /tmp/jwm.iconlist' /etc/jwm/system.nanodesk.jwmrc || error
message "correct file permissions"
#$CHROOTCMD /usr/bin/chmod 440 /etc/sudoers || error
$CHROOTCMD /usr/bin/chmod 755 /usr/sbin/nanodesk-installer || error
$CHROOTCMD /usr/bin/chmod 755 /usr/bin/nanodesk-installer-gxm || error
$CHROOTCMD /usr/bin/chmod 755 /usr/bin/nanodesk || error
$CHROOTCMD /usr/bin/chmod 755 /usr/bin/nanodesk-first-start || error
$CHROOTCMD /usr/bin/chmod 755 /usr/bin/nanodesk-gen-iconlist || error
message "set x-terminal-emulator to lxterminal"
$CHROOTCMD /usr/bin/update-alternatives --set x-terminal-emulator /usr/bin/lxterminal

View File

@ -136,8 +136,8 @@
<IconPath>
/usr/local/share/jwm
</IconPath>
<!-- the comment below is important for nanodesk to put in the actual IconPaths of the system generated by makeanything.sh -->
<!-- GENERATED ICONLIST -->
<!-- List of IconPath gets generated by nanodesk-gen-iconlist helperscript -->
<Include>exec:nanodesk-gen-iconlist</Include>
<!-- Virtual Desktops -->

View File

@ -0,0 +1,4 @@
#!/bin/sh
echo "<JWM>"
find /usr/share/icons/ -type d | sed -e 's/^/\ \ \ \ <IconPath>/g' -e 's/$/<\/IconPath>/g'
echo "</JWM>"

View File

@ -0,0 +1,89 @@
#!/bin/bash
#
# nanodesk-menumaker - generate menu from .desktop files for jwm
#
# WORK IN PROGRESS
#
# DOES NOT WORK ATM
declare -A APPS_NAME
declare -A APPS_ICON
declare -A APPS_EXEC
declare -A CATEGORIES_APPS
# excluding 'Audio' and 'Video' because they are kind of redundant with 'AudioVideo'
FREEDESKTOP_CATEGORIES="AudioVideo Development Education Game Graphics Network Office Science Settings System Utility"
get_desktop_entry() {
# only get [Desktop Entry] section
# explanation https://stackoverflow.com/a/52957039
sed -n '/\[Desktop Entry\]/,/.*:\[.*\]/ {//!p}'
}
# Main freedesktop categories we iterate through later
# https://specifications.freedesktop.org/menu-spec/latest/apa.html
# put filename in front of its content with awk
# https://www.unix.com/302929136-post4.html?s=5d91d8bbc9c7a884772b0b84b3ca6c3f
#
# dumping all files into a variable is much faster then grepping each file by file
# sed for remove path from filename: sed 's/^\/.*\/\(.*\.desktop:\)/\1/'
# awk remove path from filename: https://stackoverflow.com/a/55149591
DESKTOPFILES="$(awk '{n=split(FILENAME,array,"/"); split(array[n],arraym,"."); print arraym[1]":" $0 }' /usr/share/applications/*.desktop $HOME/.local/share/applications/*.desktop | get_desktop_entry |grep -E ':Name=|:Icon=|:Categories=|:NoDisplay=|:Exec=' )"
APPS_NODISPLAY="$(echo "$DESKTOPFILES" | grep "NoDisplay=true" | cut -d : -f1 | xargs | tr ' ' '|')"
APPS="$(echo "$DESKTOPFILES" | grep -vE "$APPS_NODISPLAY" | cut -d : -f1 | uniq)"
# put the apps into the freedesktop categories
for category in $FREEDESKTOP_CATEGORIES
do
# echo === CATEGORY $category ===
CATEGORIES_APPS[$category]="$(echo "$DESKTOPFILES" | grep -i $category | cut -d : -f1 | uniq | xargs)"
# echo ${CATEGORIES_APPS[$category]}
done
for appname in $APPS
do
APPS_NAME[$appname]="$(echo "$DESKTOPFILES" | grep -E "^$appname.*Name=" | cut -d = -f2)"
APPS_ICON[$appname]="$(echo "$DESKTOPFILES" | grep -E "^$appname.*Icon=" | cut -d = -f2)"
APPS_EXEC[$appname]="$(echo "$DESKTOPFILES" | grep -E "^$appname.*Exec=" | cut -d = -f2)"
done
#
#echo "$APPS"
#echo ${!APPS_NAME[@]}
#echo ${APPS_NAME[xfce4-web-browser]}
#echo ${APPS_ICON[xfce4-web-browser]}
#echo ${APPS_EXEC[xfce4-web-browser]}
#echo ${APPS_CAT[xfce4-web-browser]}
#echo "$DESKTOPFILES"
# jwm config output
cat <<EOF
<?xml version="1.0"?>
<JWM>
EOF
for category in $FREEDESKTOP_CATEGORIES
do
# test "$category" == "AudioVideo" && category="Multimedia"
#echo -e "appname: $appname \nName: ${APPS_NAME[$appname]}\nIcon: ${APPS_ICON[$appname]}\nExec: ${APPS_EXEC[$appname]}\nCategories: ${APPS_CAT[$appname]}\n---"
test -n "${CATEGORIES_APPS[$category]}" && cat <<EOF
<Menu icon="applications-${category,,}" label="${category}">
EOF
for app in ${CATEGORIES_APPS[$category]}
do
echo " <Program icon=\""${APPS_ICON[$app]}"\" label=\""${APPS_NAME[$app]}"\">"${APPS_EXEC[$app]}"</Program>"
done
test -n "${CATEGORIES_APPS[$category]}" && echo "</Menu>"
done
echo "</JWM>"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB