xlunch new gui

pull/129/head
Botspot 4 years ago
parent 7c54fb875d
commit 25f5234b5a

@ -0,0 +1,3 @@
#Pi-Apps may use a new dialog program for tue app list in the future. To preview this feature now, switch to 'xlunch'.
yad
xlunch

87
gui

@ -76,8 +76,15 @@ uninstall() {
motd="$(echo -e "$(wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps-announcements/main/message | shuf -n 1)")"
#app list mode. Allowed values: 'yad', 'xlunch'
guimode="$(cat "${DIRECTORY}/data/settings/App List Style")"
[ -z "$guimode" ] && guimode=yad
#mode=yad
while true;do
LIST="$("${DIRECTORY}/preload")"
LIST="$("${DIRECTORY}/preload" $guimode)"
#LIST="$(cat "${DIRECTORY}/data/preload/LIST")"
#echo "$LIST"
@ -86,31 +93,67 @@ while true;do
while [ -z "$output" ];do
output="$(echo -e "$LIST" | yad --center --title='Pi-Apps' --width=310 --height=400 --no-headers \
--text="$motd" --image="${DIRECTORY}/icons/logo-64.png" --image-on-top \
--list --multiple --separator='\n' --window-icon="${DIRECTORY}/icons/logo.png" \
--column=:IMG --column=:IMG --column=Name --column=tip:HD --print-column=3 --tooltip-column=4 \
--button=Install!"${DIRECTORY}/icons/install.png":4 \
--button=Uninstall!"${DIRECTORY}/icons/uninstall.png":2 \
--button=Details!"${DIRECTORY}/icons/info.png"!'View more about the selected software:0' \
)"
button=$? #get exit code to determine which button was pressed
echo "Button: ${button}"
if [ $button -eq 252 ];then #if window manager x was pressed
exit 0
if [ $guimode == yad ];then
output="$(echo -e "$LIST" | yad --center --title='Pi-Apps' --width=310 --height=400 --no-headers \
--text="$motd" --image="${DIRECTORY}/icons/logo-64.png" --image-on-top \
--list --multiple --separator='\n' --window-icon="${DIRECTORY}/icons/logo.png" \
--column=:IMG --column=:IMG --column=Name --column=tip:HD --print-column=3 --tooltip-column=4 \
--button=Install!"${DIRECTORY}/icons/install.png":4 \
--button=Uninstall!"${DIRECTORY}/icons/uninstall.png":2 \
--button=Details!"${DIRECTORY}/icons/info.png"!'View more about the selected software:0' \
)"
button=$? #get exit code to determine which button was pressed
echo "Button: ${button}"
if [ $button -eq 252 ];then #if window manager x was pressed
exit 0
fi
if [ -z "$output" ];then
echo "output variable empty!"
yad --center --title='Pi-Apps' --width=310 \
--window-icon="${DIRECTORY}/icons/logo.png" \
--text="Mind reading is not supported.
(You didn"\'"t select an App)" \
--button=OK:0
fi
elif [ $guimode == xlunch ];then
if [ ! -d "${DIRECTORY}/xlunch" ] || [ ! -f /usr/bin/xlunch ];then
sudo rm -f /usr/bin/xlunch 2>/dev/null
cd "$DIRECTORY"
git clone https://github.com/Tomas-M/xlunch
cd "$DIRECTORY/xlunch"
make -j8
sudo make install
sudo rm -f /usr/share/applications/genentries.desktop
cd $HOME
if [ ! -f /usr/bin/xlunch ];then
error "xlunch should be installed now, but /usr/bin/xlunch does not exist!"
fi
fi
screen_width="$(xdpyinfo | grep 'dimensions:' | tr 'x' '\n' | tr ' ' '\n' | sed -n 7p)"
screen_height="$(xdpyinfo | grep 'dimensions:' | tr 'x' '\n' | tr ' ' '\n' | sed -n 8p)"
height=700
width=800
xposition=$(((screen_width/2)-(width/2)))
yposition=$(((screen_height/2)-(height/2)))
scrot -a "$((xposition+1)),$((yposition+33)),${width},${height}" blur.png #blur_init.png
convert -blur 10x5 ~/blur.png ~/blur.png
output="$(echo -e "$LIST" | xlunch -WoCS -s 64 --bc 000000A0 --tc ffffffff --pc 6060ffff --hc 60606010 \
-p "Search: " -a -c 2 --title "Pi-Apps: Raspberry Pi app store" \
--icon "${DIRECTORY}/icons/logo.png" --scrollbarcolor ffffff40 --scrollindicatorcolor 0000ff80\
--width $width --height $height --xposition $xposition --yposition $yposition \
--button "${DIRECTORY}/icons/logo-128.png;;$((($width/2)-(128/2))),0;"
-g ~/blur.png)"
button=0
if [ -z "$output" ];then
exit 0
fi
fi
output="$(echo "$output" | sed '/^$/d')"
echo "Output: ${output}EOO"
if [ -z "$output" ];then
echo "output variable empty!"
yad --center --title='Pi-Apps' --width=310 \
--window-icon="${DIRECTORY}/icons/logo.png" \
--text="Mind reading is not supported.
(You didn"\'"t select an App)" \
--button=OK:0
fi
done
case $button in

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="layer" x="0px" y="0px" viewBox="0 0 652 652" style="enable-background:new 0 0 652 652;" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
.st0{fill:#020203;}
.st1{fill:#6ABF4B;}
.st2{fill:#C31C4A;}
</style>
<rect width="652" height="652" style="fill: rgba(0, 0, 0, 0.627);"/>
<g transform="matrix(1.398839, 0, 0, 1.398839, -121.936714, -102.788345)" style="">
<path class="st0" d="M 230.4 73.8 C 235.3 73.7 238 76.8 242.5 78.2 C 253.6 74.6 256.1 79.5 261.5 81.5 C 273.6 79 277.2 84.5 283 90.2 L 283.1 90.1 C 285 89.1 287.4 89 289.4 89.9 L 289.7 90.1 C 307.8 100.6 316.8 122 320 133.1 C 323.1 122.1 332.1 100.7 350.3 90.1 C 352.3 89.1 354.6 89 356.6 90 L 357 90.2 C 362.8 84.5 366.5 79 378.5 81.5 C 383.9 79.5 386.5 74.6 397.8 78.1 C 404.6 76 410.7 70.3 419.8 77.4 C 427.5 74.5 435 73.4 441.6 79.4 C 451.8 78.1 455.2 80.9 457.7 84 C 460 84 474.6 81.8 481.3 91.6 C 498.1 89.6 503.5 101.3 497.4 112.3 C 500.9 117.5 504.5 122.7 496.4 132.7 C 499.3 138.3 497.5 144.4 490.8 151.7 C 492.5 159.6 489 165.1 482.8 169.4 C 483.9 180.1 472.8 186.3 469.5 188.6 C 468.2 194.9 465.6 200.8 452.8 204 C 450.7 213.3 443 215 435.6 216.9 C 455.374 228.199 472.933 242.43 478.867 271.317 L 161.551 271.317 C 167.492 242.363 185.003 228.112 204.8 216.8 C 197.4 214.8 189.7 213.2 187.6 203.9 C 174.9 200.6 172.2 194.7 170.9 188.5 C 167.6 186.2 156.5 180 157.6 169.3 C 151.3 165 147.8 159.4 149.6 151.6 C 143 144.2 141.2 138.2 144 132.6 C 136 122.6 139.5 117.4 143 112.2 C 136.9 101.3 142.2 89.6 159.1 91.5 C 165.8 81.7 180.4 83.9 182.7 84 C 185.2 80.8 188.6 78.1 198.8 79.4 C 205.5 73.4 212.9 74.5 220.6 77.4 C 223.8 75 226.5 73.9 229.1 73.8 Z"/>
<path class="st1" d="M193.3,120.4c48.2,24.5,76.2,44.2,91.5,61.1c-7.8,31-48.8,32.4-63.8,31.6c3.1-1.4,5.6-3.1,6.5-5.6 c-3.8-2.7-17.1-0.2-26.4-5.4c3.6-0.7,5.2-1.5,6.9-4c-8.8-2.7-18.2-5.2-23.8-9.7c3,0,5.8,0.6,9.8-2c-7.9-4.3-16.3-7.6-22.8-14 c4-0.1,8.5,0,9.8-1.5c-7.2-4.4-13.3-9.3-18.3-14.6c5.7,0.6,8.1,0.1,9.5-0.9c-5.5-5.5-12.3-10.2-15.7-16.9c4.2,1.5,8.1,2,10.9-0.2 c-1.9-4.1-9.8-6.5-14.4-16.1c4.4,0.4,9.2,1,10.1,0c-2.1-8.3-5.6-13-9.1-17.8c9.5-0.2,24,0,23.3-0.7l-5.9-6 c9.3-2.5,18.8,0.4,25.7,2.5c3.1-2.4-0.1-5.5-3.9-8.6c7.9,1,15.1,2.8,21.5,5.3c3.5-3.1-2.3-6.1-5-9.2c12.3,2.3,17.4,5.5,22.6,8.7 c3.7-3.6,0.2-6.5-2.3-9.6c9.2,3.4,14,7.7,19,12c1.7-2.3,4.3-3.9,1.1-9.4c6.5,3.7,11.5,8.1,15.1,13c4-2.5,2.4-6.1,2.4-9.2 c6.8,5.5,11.1,11.2,16.4,16.9c1-0.7,2-3.4,2.8-7.4c16.2,15.5,39.1,54.6,5.9,70C264.6,149.6,230.8,132.9,193.3,120.4L193.3,120.4z"/>
<path class="st1" d="M448.5,120.4c-48.2,24.5-76.2,44.2-91.5,61.1c7.8,31,48.8,32.4,63.8,31.6c-3.1-1.4-5.6-3.1-6.5-5.6 c3.8-2.7,17.1-0.2,26.4-5.4c-3.6-0.7-5.2-1.5-6.9-4c8.8-2.7,18.2-5.2,23.8-9.7c-3,0-5.8,0.6-9.8-2c7.9-4.2,16.3-7.5,22.8-13.9 c-4-0.1-8.5,0-9.8-1.5c7.2-4.4,13.3-9.3,18.3-14.6c-5.7,0.6-8.1,0.1-9.5-0.9c5.5-5.5,12.3-10.2,15.7-16.9c-4.2,1.5-8.1,2-10.9-0.2 c1.9-4.1,9.8-6.5,14.4-16.1c-4.4,0.4-9.2,1-10.1,0c2.1-8.3,5.6-13,9.1-17.8c-9.5-0.2-24,0-23.3-0.7l5.9-6 c-9.3-2.5-18.9,0.4-25.7,2.5c-3.1-2.4,0.1-5.5,3.9-8.6c-7.9,1-15.1,2.8-21.5,5.3c-3.5-3.1,2.3-6.1,5-9.2 c-12.3,2.3-17.4,5.5-22.6,8.7c-3.7-3.6-0.2-6.5,2.3-9.6c-9.2,3.4-14,7.7-19,12c-1.7-2.3-4.3-3.9-1.1-9.4c-6.5,3.7-11.5,8.1-15.1,13 c-4-2.5-2.4-6.1-2.4-9.2c-6.8,5.5-11.1,11.2-16.4,16.9c-1-0.7-2-3.4-2.8-7.4c-16.2,15.5-39.1,54.6-5.9,70 C377.2,149.6,411,132.9,448.5,120.4L448.5,120.4z" style=""/>
<g style="visibility: hidden;">
<path class="st2" d="M379.2,436.2c0.2,29-25.5,52.5-57.4,52.7s-57.9-23.2-58-52.1c0-0.2,0-0.4,0-0.6c-0.2-29,25.5-52.5,57.4-52.7 s57.9,23.2,58,52.1C379.2,435.8,379.2,436,379.2,436.2z"/>
<g>
<path class="st2" d="M289.2,286.4c23.9,15.4,28.2,50.4,9.6,78.1c-18.6,27.7-53,37.7-77,22.3l0,0c-23.9-15.4-28.2-50.4-9.6-78.1 S265.3,271,289.2,286.4L289.2,286.4z"/>
<path class="st2" d="M353.7,283.7c-23.9,15.4-28.2,50.4-9.6,78.1c18.6,27.7,53,37.7,77,22.3l0,0c23.9-15.4,28.2-50.4,9.6-78.1 C412.1,278.2,377.6,268.3,353.7,283.7L353.7,283.7z"/>
</g>
<g>
<path class="st2" d="M171.2,311.9c25.8-6.8,8.7,105.1-12.3,96C135.8,389.6,128.3,335.9,171.2,311.9z"/>
<path class="st2" d="M469.5,310.5c-25.8-6.8-8.7,105.1,12.3,96C504.9,388.1,512.3,334.5,469.5,310.5L469.5,310.5z"/>
</g>
<path class="st2" d="M382.9,226.9c44.5-7.4,81.6,18.6,80.1,66.3C461.5,311.4,366.5,229.6,382.9,226.9z"/>
<path class="st2" d="M259.8,225.5c-44.5-7.4-81.6,18.6-80.1,66.3C181.2,310,276.3,228.2,259.8,225.5z"/>
<path class="st2" d="M321.2,214.4c-26.5-0.6-52.1,19.4-52.1,31.1c-0.1,14.2,21,28.7,52.4,29.1c32,0.2,52.4-11.6,52.5-26.2 C374,231.7,344.8,214.1,321.2,214.4L321.2,214.4z"/>
<path class="st2" d="M323.2,505.1c23.2-1,54.3,7.3,54.3,18.4c0.4,10.7-28.2,35-55.8,34.6c-28.6,1.2-56.7-23.2-56.4-31.6 C264.9,514.2,300.2,504.6,323.2,505.1L323.2,505.1z"/>
<g>
<path class="st2" d="M237.5,439.5c16.5,19.6,24,54,10.2,64.2c-13,7.7-44.7,4.5-67.1-27.3c-15.2-26.7-13.2-53.9-2.6-61.9 C194,404.9,218.5,417.8,237.5,439.5L237.5,439.5z"/>
<path class="st2" d="M403.6,433.3c-17.8,20.6-27.8,58.2-14.8,70.3c12.4,9.4,45.9,8.1,70.6-25.7c17.9-22.7,11.9-60.5,1.7-70.6 C445.9,395.7,424,410.5,403.6,433.3L403.6,433.3z"/>
</g>
</g>
</g>
<rect x="103.874" y="202.742" width="444.251" height="444.251" style="" rx="62.1" ry="62.1"/>
<g transform="matrix(1.250353, 0, 0, 1.250353, -76.902557, -70.615715)" style="">
<rect x="167.679" y="241.723" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="277.266" y="241.723" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="386.825" y="241.723" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="167.679" y="350.4" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="277.252" y="351.296" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="386.825" y="350.4" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="167.679" y="460.869" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="277.266" y="460.869" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
<rect x="386.825" y="460.869" width="89.958" height="89.958" style="fill: rgb(195, 28, 74);" rx="28.994" ry="28.994"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 127 KiB

@ -19,6 +19,12 @@ else
error "Failed to detect OS CPU architecture! Something is very wrong."
fi
#yad or xlunch format
format="$1"
if [ -z "$format" ];then
format=yad
fi
mkdir -p "${DIRECTORY}/data/preload"
@ -92,18 +98,30 @@ if [ $reloadlist == 1 ];then
APPS="$(echo "$APPS" | shuf)"
fi
PREIFS="$IFS"
IFS=$'\n'
LIST=''
for i in $APPS
do
LIST="$LIST$(echo "${DIRECTORY}/icons/$(cat "${DIRECTORY}/data/status/${i}" 2>/dev/null || echo "none").png")
if [ "$format" == yad ];then
PREIFS="$IFS"
IFS=$'\n'
LIST=''
for i in $APPS
do
LIST="$LIST$(echo "${DIRECTORY}/icons/$(cat "${DIRECTORY}/data/status/${i}" 2>/dev/null || echo "none").png")
${DIRECTORY}/apps/${i}/icon-24.png
$i
"\("$(cat "${DIRECTORY}/data/status/${i}" 2>/dev/null || echo "uninstalled")"\)" $(echo "$(cat "${DIRECTORY}/apps/${i}/description" || echo "Description unavailable")" | head -n1)
"
done
IFS="$PREIFS"
done
IFS="$PREIFS"
elif [ "$format" == xlunch ];then
PREIFS="$IFS"
IFS=$'\n'
LIST=''
for i in $APPS
do
LIST="$LIST
${i} "\("$(cat "${DIRECTORY}/data/status/${i}" 2>/dev/null || echo "uninstalled")"\)";${DIRECTORY}/apps/${i}/icon-64.png;${i}"
done
IFS="$PREIFS"
fi
LIST="$(echo -e "$LIST")"
#save entire list string to file for future use

@ -15,7 +15,7 @@ while [ -z $exitloop ];do
#create default files inside
echo '' > "${DIRECTORY}/data/settings/reinstall-after-update"
fi
#$1 is usually left blank. If it equals 'refresh', then empty settings will be created and then the script will exit.
if [ "$1" == 'refresh' ];then
#set default settings, if they don't exist
@ -46,7 +46,6 @@ while [ -z $exitloop ];do
exit 0
fi
if [ ! -f ~/.local/share/applications/pi-apps-settings.desktop ];then
echo "Creating Settings menu button"
echo "[Desktop Entry]

Loading…
Cancel
Save