Skip to content

Commit 4bd06fa

Browse files
committed
Prep for GUI refresh?
1 parent cc76f7c commit 4bd06fa

4 files changed

Lines changed: 28 additions & 11 deletions

File tree

api

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
if [[ $(xrandr --current) =~ "connected primary" ]]; then
4+
resolution=$(xrandr --current | grep " connected primary" | awk '{print $4}' | cut -d'+' -f1)
5+
else
6+
resolution=$(xrandr --current | grep " connected" | awk '{print $3}' | cut -d'+' -f1)
7+
fi
8+
9+
horizontal=$(echo $resolution | cut -d'x' -f1)
10+
vertical=$(echo $resolution | cut -d'x' -f2)
311

412
theme_get() {
513
website_file="etc/theme"
@@ -116,6 +124,9 @@ uninstall_app() {
116124

117125
# Function to search for apps
118126
search_apps() {
127+
x2=$((horizontal / 2 - 65))
128+
y2=$((vertical / 2 - 320))
129+
119130
query=$(GTK_THEME="${theme}" yad --title="Search Apps" --borders=10 --center --text="Enter query:" --entry \
120131
--button="Cancel!gtk-cancel":1 --button="Search!edit-find":0)
121132
if [ -n "$query" ]; then
@@ -136,15 +147,16 @@ search_apps() {
136147
done
137148

138149
if [ ${#apps_found[@]} -gt 0 ]; then
139-
selected_category2=$(GTK_THEME="${theme}" yad --center --title="Search Results" --width=400 --height=300 \
140-
--list --text="<big><b>Search Results for '${query}'</b></big>" --column="Icon:IMG" --column="App Name" --column="in" --column="Category" --no-headers "${apps_found[@]}" --borders=10 --button="Exit!gtk-cancel":1 --button="View App!edit-find":0)
150+
selected_category2=$(GTK_THEME="${theme}" yad --center --title="Search Results" --geometry=450x600+${x2}+${y2} \
151+
--list --text="<big><b>Search Results for '${query}'</b></big>" --column="Icon:IMG" --column="App Name" \
152+
--column="in" --column="Category" --no-headers "${apps_found[@]}" --button="Exit!gtk-cancel":1 --button="View App!edit-find":0 &)
141153
if [ -n "$selected_category2" ]; then
142154
echo "$(echo ${selected_category2} | awk -F"|" '{print $2}' | sed 's/|//g')" > /tmp/tmpname
143-
./gui showdetails
155+
./gui showdetails &
144156
fi
145157
else
146-
GTK_THEME="${theme}" yad --center --title="Search Results" --width=300 --height=100 \
147-
--text="<big><b>No apps found for '${query}'.</b></big>\nPlease try another query." --borders=10 --center \
158+
GTK_THEME="${theme}" yad --center --title="Search Results" --geometry=450x600+${x2}+${y2} \
159+
--text="<big><b>No apps found for '${query}'.</b></big>\nPlease try another query." --center \
148160
--button="Retry!edit-find":1 --button="Exit!gtk-cancel":0
149161
response=$?
150162
if [ $response -eq 1 ]; then

apps/way11/install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ VERSION="02a5fddf88669d7e513527d9b336df54853d9bbc"
44
sudo apt update
55
sudo apt install weston yad wmctrl x11-utils -y
66

7+
rm -rf "$HOME/.techguy16/way11"
78
git clone https://github.com/techguy16/way11 "$HOME/.techguy16/way11"
89
chmod +x "$HOME/.techguy16/way11/way11"
910
chmod +x "$HOME/.techguy16/way11/way11-gui"

gui

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ app_details_page() {
273273
GDK_BACKEND=x11 $YAD_COMMAND --class LinStore --title="App Details" --geometry=450x${APP_STORE_HEIGHT}+${x2}+${categoryPosY} --form --class="LinStore" \
274274
--text "<big>${displayName}</big>\nBy <b>${creator}</b> (<a href='${website}'>App Website</a>)\n${donate}" \
275275
--field="<b>Description</b>:TXT" --no-edit "$description" --image="$app_icon" --window-icon="images/logo/logo-64.png" --image-on-top \
276-
--button="$buttonText!$buttonImage:$buttonCommand" "${buttons[@]}" --skip-taskbar --noclose
276+
--button="$buttonText!$buttonImage:$buttonCommand" "${buttons[@]}" --skip-taskbar --noclose &
277277
)
278278

279279
rm -f /tmp/description.tmp
@@ -316,7 +316,7 @@ show_apps_in_category() {
316316
GTK_THEME="${theme}" GDK_BACKEND=x11 $YAD_COMMAND --text "<big><b>$title</b></big>" --geometry=${APP_STORE_WIDTH}x${APP_STORE_HEIGHT}+${categoryPos}+${categoryPosY} --center --columns="2" \
317317
--list --image="images/logo/logo-64.png" --window-icon="images/logo/logo-64.png" --image-on-top --title "LinStore" --column "Icon:IMG" --column "Apps" --class="LinStore" \
318318
--button="Back"!images/button/back.png!:4 --separator="\n" --markup "${formatted_apps[@]}" --no-headers \
319-
--css="span{fgcolor:green;}" --select-action='bash -c "./gui showdetails \"%s\""'#> /dev/null 2>&1
319+
--css="span{fgcolor:green;}" --select-action='bash -c "./gui showdetails \"%s\"" &'#> /dev/null 2>&1
320320

321321
button_clicked=$?
322322
if [ $button_clicked -eq 4 ]; then
@@ -351,9 +351,13 @@ show_app_store() {
351351

352352
# Search function
353353

354-
selected_category_raw=$(GTK_THEME="${theme}" GDK_BACKEND=x11 $YAD_COMMAND --text "$random_announcement" --geometry=${APP_STORE_WIDTH}x${APP_STORE_HEIGHT}+${categoryPos}+${categoryPosY} --center --columns="3" \
354+
selected_category_raw=$(GTK_THEME="${theme}" GDK_BACKEND=x11 $YAD_COMMAND --text "$random_announcement" \
355+
--geometry=${APP_STORE_WIDTH}x${APP_STORE_HEIGHT}+${categoryPos}+${categoryPosY} --center --columns="3" \
355356
"${list_items[@]}" --class="LinStore" \
356-
--list --image="images/logo/logo-64.png" --window-icon="images/logo/logo-64.png" --image-on-top --title "$APP_STORE_NAME" --column "Icon:IMG" --column "Category" --button "!images/button/search.png"!"Search":"bash -c './api search'" --button "!images/button/update.png"!"Updates":"bash -c './update'" --button "!images/button/settings.png"!"Settings":"bash -c './settings'" --no-headers --item-height="$welcome_height" --timeout=0 --no-close)
357+
--list --image="images/logo/logo-64.png" --window-icon="images/logo/logo-64.png" --image-on-top --title "$APP_STORE_NAME" --column "Icon:IMG" \
358+
--column "Category" --button "!images/button/search.png"!"Search":"bash -c './api search' &" \
359+
--button "!images/button/update.png"!"Updates":"bash -c './update' &" --button "!images/button/settings.png"!"Settings":"bash -c './settings' &" \
360+
--no-headers --item-height="$welcome_height" --timeout=0 --no-close)
357361
exval=$?
358362
./api info "Exit value: ${exval}"
359363
selected_category="${selected_category_raw//|/}"
@@ -365,7 +369,7 @@ show_app_store() {
365369
elif [ "$exval" -eq "252" ]; then
366370
pkill -f "yad*" > /dev/null 2>&1
367371
elif [ -n "$selected_category" ]; then
368-
show_apps_in_category "$selected_category"
372+
show_apps_in_category "$selected_category" &
369373
fi
370374
}
371375

update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ check_for_updates() {
114114
else
115115
kill $(pgrep -f "title=App Details") > /dev/null 2>&1
116116
updates_list=$(GDK_BACKEND=x11 yad --list --class="LinStore" --title="LinStore Updates" --column="Select":CHK --column="Icon":IMG --column="App" \
117-
"${updates[@]}" --checklist --geometry=450x600+${x2}+${y2} --hide-header "${buttons[@]}")
117+
"${updates[@]}" --checklist --geometry=450x600+${x2}+${y2} --no-header "${buttons[@]}") #i regret programming
118118
response=$?
119119
fi
120120

0 commit comments

Comments
 (0)