Skip to content

Commit

Permalink
fix manjaro chrome icons
Browse files Browse the repository at this point in the history
  • Loading branch information
justmiles committed Sep 14, 2022
1 parent cf07929 commit acd680d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .chezmoiscripts/run_after_install_crontab_chrome_icons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# from: https://gist.github.com/ninogresenz/868d806723fe0ece9ad70f395f19619e

set -e

OS=$(cat /etc/os-release | grep "^ID=" | awk -F '=' '{print $2}')

# limit this to manjaro
if [ ! "$OS" = "manjaro" ]; then
exit 0
fi

DIR="$HOME/.local/share/applications"
PATTERN="chrome-*.desktop"

if ! command -v xdotool > /dev/null; then
echo "installing xdotool..."
yes | sudo pacman -S xdotool
fi

for file in $(ls $DIR/$PATTERN); do
echo "$file:"
ID=$(grep -m 1 Exec $file | sed -E 's/^(.*)--app-id=(\w*).*$/\2/g')
CMD=" \&\& xdotool search --sync --classname $ID set_window --class $ID"
if grep -q "$CMD" $file; then
echo " skip file"
continue
fi
echo " changing file"
sed -E -i 's!^(Exec=)(.*)$!\1\2'"${CMD}"'!g' $file
done

echo "updating desktop database"
update-desktop-database $DIR
echo "done"
2 changes: 1 addition & 1 deletion dot_local/share/bootstrapping/executable_2_meld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ exit_if_installed meld
set -e

if [ "$OS" = "manjaro" ]; then
sudo pacman -S meld
yes y | sudo pacman -S meld
fi

0 comments on commit acd680d

Please sign in to comment.