Update FredOS-Gaming.nix
This commit is contained in:
parent
30c3c615dd
commit
dcc452bf6b
1 changed files with 10 additions and 24 deletions
|
|
@ -33,27 +33,15 @@
|
||||||
DESKTOP_DIR="$HOME/.local/share/applications"
|
DESKTOP_DIR="$HOME/.local/share/applications"
|
||||||
ICON_DIR="$HOME/.local/share/icons/hicolor"
|
ICON_DIR="$HOME/.local/share/icons/hicolor"
|
||||||
|
|
||||||
# Wait a bit for Steam to create desktop files
|
# Create icon theme index if it doesn't exist
|
||||||
sleep 5
|
|
||||||
|
|
||||||
# Create icon theme directories
|
|
||||||
for size in 32x32 48x48 64x64 128x128 256x256; do
|
|
||||||
mkdir -p "$ICON_DIR/$size/apps"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create index.theme if it doesn't exist
|
|
||||||
if [ ! -f "$ICON_DIR/index.theme" ]; then
|
if [ ! -f "$ICON_DIR/index.theme" ]; then
|
||||||
|
mkdir -p "$ICON_DIR"
|
||||||
cat > "$ICON_DIR/index.theme" << 'EOF'
|
cat > "$ICON_DIR/index.theme" << 'EOF'
|
||||||
[Icon Theme]
|
[Icon Theme]
|
||||||
Name=Hicolor
|
Name=Hicolor
|
||||||
Comment=Fallback icon theme
|
Comment=Fallback icon theme
|
||||||
Hidden=true
|
Hidden=true
|
||||||
Directories=32x32/apps,48x48/apps,64x64/apps,128x128/apps,256x256/apps
|
Directories=48x48/apps,64x64/apps,128x128/apps,256x256/apps
|
||||||
|
|
||||||
[32x32/apps]
|
|
||||||
Size=32
|
|
||||||
Context=Applications
|
|
||||||
Type=Threshold
|
|
||||||
|
|
||||||
[48x48/apps]
|
[48x48/apps]
|
||||||
Size=48
|
Size=48
|
||||||
|
|
@ -77,6 +65,9 @@
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Wait a bit for Steam to create desktop files
|
||||||
|
sleep 5
|
||||||
|
|
||||||
# Search all desktop files for steam_icon references
|
# Search all desktop files for steam_icon references
|
||||||
${pkgs.gnugrep}/bin/grep -l "Icon=steam_icon_" "$DESKTOP_DIR"/*.desktop 2>/dev/null | while read desktop_file; do
|
${pkgs.gnugrep}/bin/grep -l "Icon=steam_icon_" "$DESKTOP_DIR"/*.desktop 2>/dev/null | while read desktop_file; do
|
||||||
# Extract the app_id from the Icon line
|
# Extract the app_id from the Icon line
|
||||||
|
|
@ -86,18 +77,13 @@
|
||||||
icon_file=$(find "$STEAM_DIR/appcache/librarycache/$app_id" -name "*.jpg" 2>/dev/null | head -n 1)
|
icon_file=$(find "$STEAM_DIR/appcache/librarycache/$app_id" -name "*.jpg" 2>/dev/null | head -n 1)
|
||||||
|
|
||||||
if [ -f "$icon_file" ]; then
|
if [ -f "$icon_file" ]; then
|
||||||
# Copy icon to all sizes for better quality
|
# Copy icon to multiple sizes for GNOME
|
||||||
for size in 32x32 48x48 64x64 128x128 256x256; do
|
for size in 48x48 64x64 128x128 256x256; do
|
||||||
|
mkdir -p "$ICON_DIR/$size/apps/"
|
||||||
cp "$icon_file" "$ICON_DIR/$size/apps/steam_icon_$app_id.png"
|
cp "$icon_file" "$ICON_DIR/$size/apps/steam_icon_$app_id.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Copied icons for App ID $app_id"
|
echo "Fixed icon for $(basename "$desktop_file"): App ID $app_id"
|
||||||
|
|
||||||
# Add StartupWMClass if not present
|
|
||||||
if ! ${pkgs.gnugrep}/bin/grep -q "StartupWMClass" "$desktop_file"; then
|
|
||||||
echo "StartupWMClass=steam_app_$app_id" >> "$desktop_file"
|
|
||||||
echo "Added StartupWMClass for $(basename "$desktop_file")"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue