Skip to content

Instantly share code, notes, and snippets.

View sheepymeh's full-sized avatar

Jiayang Wu sheepymeh

View GitHub Profile
@sheepymeh
sheepymeh / generate_desktop.sh
Created November 11, 2021 11:13
Bash script to generate .desktop files for the Legendary launcher
#!/bin/bash
INSTALLED_GAMES="$(legendary list-installed | grep -oP '(?<=\* ).*?(?= \()')"
while :; do
read -p "Name of game: " GAME_NAME
if echo "$INSTALLED_GAMES" | grep -xq "$GAME_NAME"; then break; fi
echo "The game $GAME_NAME is not installed"
done
GAME_ID=$(legendary list-installed | grep "* $GAME_NAME (" | grep -oP '(?<=App name: ).*?(?= \|)')
wget -qO "$HOME/.config/legendary/metadata/$GAME_ID.thumb" "$(jq -r '.metadata.keyImages[1].url' $HOME/.config/legendary/metadata/$GAME_ID.json)"
@sheepymeh
sheepymeh / README.md
Last active March 4, 2022 06:11
google-drive-restricted-download

Downloads restricted PDFs from Google Drive that cannot normally be downloaded. Uses A4 paper size and scales accordingly. Copy and paste script.js into the console and press Enter.

Ensure that your system has enough RAM before starting.
Thanks to this comment for zoom-in code.

@sheepymeh
sheepymeh / README.md
Last active September 4, 2021 07:43
pacman hook for electron on wayland

Electron 12 introduced early Wayland support behind the flags --enable-features=UseOzonePlatform --ozone-platform=wayland.

This gist adds these flags to the .desktop files of the selected Electron packages after every upgrade, so that they can be started from a launcher with Wayland enabled.

Will be deprecated after Electron eventually starts with Wayland by default without needing these flags.

Usage

  1. Copy electron-wayland.sh to /usr/local/sbin/electron-wayland.sh
  2. Add execution permissions to /usr/local/sbin/electron-wayland.sh (sudo chmod a+x /usr/local/sbin/electron-wayland.sh)