33# set variables
44MODE=${1}
55scrDir=$( dirname " $( realpath " $0 " ) " )
6- thumbName=" library_600x900.jpg"
76source $scrDir /globalcontrol.sh
87# ThemeSet="${confDir}/hypr/themes/theme.conf"
98
@@ -20,6 +19,11 @@ icon_border=$((elem_border - 3))
2019r_override=" element{border-radius:${elem_border} px;} element-icon{border-radius:${icon_border} px;}"
2120
2221fn_steam () {
22+
23+ notify-send -a " HyDE Alert" " Please wait... " -t 4000
24+
25+ libraryThumbName=" library_600x900.jpg"
26+ libraryHeaderName=" header.jpg"
2327 # Get all manifests found within steam libs
2428 # SteamLib might contain more than one path
2529 ManifestList=$( grep ' "path"' $SteamLib | awk -F ' "' ' {print $4}' | while read sp; do
@@ -28,6 +32,9 @@ fn_steam() {
2832 find " ${sp} /steamapps" -type f -name " appmanifest_*.acf" 2> /dev/null
2933 done)
3034
35+ if [ -z " ${ManifestList} " ]; then
36+ notify-send -a " HyDE Alert" " Cannot Fetch Steam Games!" && exit 1
37+ fi
3138
3239 # read installed games
3340 GameList=$( echo " $ManifestList " | while read acf; do
@@ -47,9 +54,8 @@ fn_steam() {
4754 echo " $GameList " | while read acf; do
4855 appid=$( echo " ${acf} " | cut -d ' |' -f 2)
4956 game=$( echo " ${acf} " | cut -d ' |' -f 1)
50-
5157 # find the lib image
52- libImage=$( find " ${SteamThumb} /${appid} /" -type f -name " ${thumbName} " )
58+ libImage=$( find " ${SteamThumb} /${appid} /" -type f -name " ${libraryThumbName} " | head -1 )
5359 printf " %s\x00icon\x1f${libImage} \n" " ${game} " >&2
5460 printf " %s\x00icon\x1f${libImage} \n" " ${game} "
5561 done | rofi -dmenu \
@@ -58,12 +64,13 @@ fn_steam() {
5864 )
5965
6066 # launch game
61- if [ -n " $RofiSel " ]; then
67+ if [ -n " $RofiSel " ]; then
6268 launchid=$( echo " $GameList " | grep " $RofiSel " | cut -d ' |' -f 2)
69+
70+ headerImage=$( find " ${SteamThumb} /${launchid} /" -type f -name " *${libraryHeaderName} " )
6371 ${steamlaunch} -applaunch " ${launchid} [gamemoderun %command%]" &
6472 # dunstify "HyDE Alert" -a "Launching ${RofiSel}..." -i ${SteamThumb}/${launchid}_header.jpg -r 91190 -t 2200
65- notify-send -a " HyDE Alert" -i " ${SteamThumb} /${launchid} _header.jpg" " Launching ${RofiSel} ..."
66-
73+ notify-send -a " HyDE Alert" -i " $headerImage " " Launching ${RofiSel} ..."
6774 fi
6875}
6976
0 commit comments