Skip to content

Instantly share code, notes, and snippets.

@davidar
davidar / fix-app-icons.sh
Created August 13, 2016 06:03
Fix Chrome App icons in the KDE launcher
#!/bin/bash
# http://superuser.com/a/1068709/55113
for file in ~/.local/share/applications/*.desktop; do
CLASS="`grep '^StartupWMClass=' "$file" | cut -d= -f2`"
if [ -n "$CLASS" ] && ! grep -q xdotool "$file"; then
EXEC="`grep '^Exec=' "$file"`"
EXEC="$EXEC \\&\\& xdotool search --sync --classname $CLASS set_window --class $CLASS"
sed -i~ "s!^Exec=.*!$EXEC!" "$file"
fi
done
@larsch
larsch / create-arch-image-raspberry-pi-2.sh
Last active March 11, 2024 13:55
Shell script that creates a Arch Linux image for the Raspberry Pi 2. Downloads the latest distribution from archlinuxarm.org and creates the flash filesystems including boot partition. Partitions are aligned for typical SD cards and ext filesystem tuned accordingly.
#!/bin/sh -ex
losetup /dev/loop0 && exit 1 || true
image=arch-linux-$(date +%Y%m%d).img
wget -q -N http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
truncate -s 1G $image
losetup /dev/loop0 $image
parted -s /dev/loop0 mklabel msdos
parted -s /dev/loop0 unit s mkpart primary fat32 -- 1 65535
parted -s /dev/loop0 set 1 boot on
parted -s /dev/loop0 unit s mkpart primary ext2 -- 65536 -1