Compare commits
8 Commits
383eb1a728
...
c2f746ecf7
| Author | SHA1 | Date | |
|---|---|---|---|
| c2f746ecf7 | |||
| c05183362d | |||
| c84b1481d8 | |||
| 9c5506f097 | |||
| 6389fb7ff3 | |||
| 45a99b283d | |||
| 406aeb2d8f | |||
| b62098c5b1 |
62
add-appimage-to-apps
Executable file
62
add-appimage-to-apps
Executable file
@@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Check if an AppImage path is provided
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Usage: $0 /path/to/AppImage"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Absolute path to the AppImage
|
||||||
|
APPIMAGE_PATH="$(realpath "$1")"
|
||||||
|
# Application destination dir
|
||||||
|
APPDIR="$HOME/.local/share/applications"
|
||||||
|
# A place to store application icons
|
||||||
|
ICONDIR="$HOME/.local/share/icons"
|
||||||
|
|
||||||
|
# Make a tempdir and cd into it
|
||||||
|
EXTRACT_DIR=$(mktemp -d)
|
||||||
|
cleanup() {
|
||||||
|
[ -z "$EXTRACT_DIR" ] && exit 2
|
||||||
|
rm -rf "$EXTRACT_DIR"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
pushd "$EXTRACT_DIR"
|
||||||
|
|
||||||
|
# Extract AppImage
|
||||||
|
"$APPIMAGE_PATH" --appimage-extract > /dev/null 2>&1
|
||||||
|
# Find the extracted desktop file and icon
|
||||||
|
DESKTOP_FILE=$(find "$EXTRACT_DIR/squashfs-root" -name "*.desktop" | head -n 1)
|
||||||
|
# GPT spat this out and I'm really not sure if it's correct. I don't think
|
||||||
|
# fd spec limits us to these two file formats
|
||||||
|
ICON_FILE=$(find "$EXTRACT_DIR/squashfs-root" -name "*.png" -o -name "*.svg" | head -n 1)
|
||||||
|
|
||||||
|
if [ -z "$DESKTOP_FILE" ]; then
|
||||||
|
echo "Error: No .desktop file found in AppImage."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Jump out of the tempdir. We now have absolute paths to the things we want
|
||||||
|
popd
|
||||||
|
|
||||||
|
APP_NAME=$(grep -m1 '^Name=' "$DESKTOP_FILE" | cut -d= -f2)
|
||||||
|
DESKTOP_TARGET="$APPDIR/$APP_NAME.desktop"
|
||||||
|
ICON_TARGET="$ICONDIR/$APP_NAME.${ICON_FILE##*.}"
|
||||||
|
# Copy the icon over
|
||||||
|
mkdir -p "$ICONDIR"
|
||||||
|
cp "$ICON_FILE" "$ICON_TARGET"
|
||||||
|
# Update paths in the .desktop file and copy it over
|
||||||
|
sed -e "s|^Exec=.*|Exec=$APPIMAGE_PATH|" \
|
||||||
|
-e "s|^Icon=.*|Icon=$ICON_TARGET|" \
|
||||||
|
"$DESKTOP_FILE" > "$DESKTOP_TARGET"
|
||||||
|
# Ensure the desktop file is executable
|
||||||
|
chmod +x "$DESKTOP_TARGET"
|
||||||
|
|
||||||
|
# Refresh application menu
|
||||||
|
update-desktop-database "$APPDIR"
|
||||||
|
|
||||||
|
echo "Desktop entry created: $DESKTOP_TARGET"
|
||||||
|
echo "Icon saved at: $ICON_TARGET"
|
||||||
|
echo "You can now launch '$APP_NAME' from your application menu."
|
||||||
|
|
||||||
10
switchsession
Executable file
10
switchsession
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
which busctl > /dev/null 2>&1
|
||||||
|
# Get the current Seat
|
||||||
|
SEAT=$(busctl get-property org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session Seat | awk '{print $2}' | tr -d '"' | sed 's/^./\U&/')
|
||||||
|
# Call out to switch the current session
|
||||||
|
busctl call org.freedesktop.DisplayManager "/org/freedesktop/DisplayManager/${SEAT}" org.freedesktop.DisplayManager.Seat SwitchToGreeter
|
||||||
|
# Lock
|
||||||
|
loginctl lock-session
|
||||||
53
wfinfo-ng
Executable file
53
wfinfo-ng
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Quick-launch script for wfinfo-ng
|
||||||
|
# https://github.com/knoellle/wfinfo-ng
|
||||||
|
#
|
||||||
|
# Quick setup for a toolbox on Fedora:
|
||||||
|
# toolbox create wfinfo-ng
|
||||||
|
# toolbox enter wfinfo-ng
|
||||||
|
# sudo dnf install -y cargo clang cmake curl fontconfig-devel g++ jq leptonica-devel libXi-devel libXtst-devel openssl-devel rust tesseract-devel xrandr
|
||||||
|
#
|
||||||
|
# After this, CD into the repo and run:
|
||||||
|
# cargo install --path . --bin wfinfo
|
||||||
|
#
|
||||||
|
# This'll put it in ~/.cargo/bin, which we exec directly
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Assumes Flatpak Steam
|
||||||
|
wfinfo="$HOME/.cargo/bin/wfinfo"
|
||||||
|
update="$HOME/Projects/wfinfo-ng/update.sh"
|
||||||
|
logfile="$HOME/.var/app/com.valvesoftware.Steam/.steam/steam/steamapps/compatdata/230410/pfx/drive_c/users/steamuser/AppData/Local/Warframe/EE.log"
|
||||||
|
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
pushd "$tmpdir" >/dev/null 2>&1
|
||||||
|
echo "Running in $tmpdir"
|
||||||
|
|
||||||
|
# Basline tests
|
||||||
|
if ! [ -e "$logfile" ]; then
|
||||||
|
echo "Could not find logfile: $logfile"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! [ -e "$wfinfo" ]; then
|
||||||
|
echo "Could not find wfinfo -- is it installed?"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
if ! [ -e "$update" ]; then
|
||||||
|
echo "Update script doesn't exist: $update"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$update"
|
||||||
|
|
||||||
|
toolbox run \
|
||||||
|
--container wfinfo-ng \
|
||||||
|
"$wfinfo" \
|
||||||
|
--window-name "Warframe" \
|
||||||
|
"$logfile" \
|
||||||
|
|| true
|
||||||
|
|
||||||
|
popd >/dev/null 2>&1
|
||||||
|
echo "Cleaning up $tmpdir"
|
||||||
|
rm -rf "$tmpdir"
|
||||||
|
echo "All wrapped up"
|
||||||
Reference in New Issue
Block a user