From 07f82e9520f2a49ee823ac03506a40c231142821 Mon Sep 17 00:00:00 2001 From: Joren Date: Thu, 9 Jan 2025 14:19:37 +0100 Subject: [PATCH] aaa --- ChromiumApps/element | 2 ++ ChromiumApps/qobuz | 2 ++ ChromiumApps/tidal | 2 ++ Misc/usbbench.sh | 58 ++++++++++++++++++++++++++++++++++++++++++ ScreenShot/screengrab_ | 40 +++++++++++++++++++++++++++++ Sway/way.sh | 7 +++++ 6 files changed, 111 insertions(+) create mode 100755 ChromiumApps/element create mode 100755 ChromiumApps/qobuz create mode 100755 ChromiumApps/tidal create mode 100755 Misc/usbbench.sh create mode 100755 ScreenShot/screengrab_ create mode 100755 Sway/way.sh diff --git a/ChromiumApps/element b/ChromiumApps/element new file mode 100755 index 0000000..40d773c --- /dev/null +++ b/ChromiumApps/element @@ -0,0 +1,2 @@ +#!/bin/bash +chromium --app=https://app.element.io diff --git a/ChromiumApps/qobuz b/ChromiumApps/qobuz new file mode 100755 index 0000000..a0a32f9 --- /dev/null +++ b/ChromiumApps/qobuz @@ -0,0 +1,2 @@ +#!/bin/bash +chromium --app=https://play.qobuz.com diff --git a/ChromiumApps/tidal b/ChromiumApps/tidal new file mode 100755 index 0000000..3c50d56 --- /dev/null +++ b/ChromiumApps/tidal @@ -0,0 +1,2 @@ +#!/bin/bash +chromium --app=https://listen.tidal.com diff --git a/Misc/usbbench.sh b/Misc/usbbench.sh new file mode 100755 index 0000000..11c0c9b --- /dev/null +++ b/Misc/usbbench.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# Check if the device argument is provided +if [ -z "$1" ]; then + echo "Usage: $0 /dev/sda1" + exit 1 +fi + +# Set the path to your USB mount point +USB_PATH="$1" + +# Set different file sizes (in MB) +FILE_SIZES=(10 100 1000 10000) + +# Set block size (1M block size for testing) +BLOCK_SIZE="1M" + +# Set the number of iterations for each file size +ITERATIONS=3 + +# Start benchmarking +echo "Starting USB performance benchmark for device: $USB_PATH" + +# Loop through the different file sizes +for SIZE in "${FILE_SIZES[@]}"; do + echo "-------------------------------------------" + echo "Testing with file size: $SIZE MB" + + # Convert size from MB to bytes for dd + SIZE_IN_BYTES=$((SIZE * 1024 * 1024)) + + # Loop for the specified number of iterations + for i in $(seq 1 $ITERATIONS); do + echo "Iteration $i: Testing write speed..." + + # Test write speed + WRITE_SPEED=$(sudo dd if=/dev/zero of="$USB_PATH/testfile" bs=$BLOCK_SIZE count=$SIZE oflag=direct 2>&1 | grep -o '[0-9\.]* MB/s' | tail -n 1) + + echo "Iteration $i: Write speed = $WRITE_SPEED" + + echo "Iteration $i: Testing read speed..." + + # Test read speed + READ_SPEED=$(sudo dd if="$USB_PATH/testfile" of=/dev/null bs=$BLOCK_SIZE 2>&1 | grep -o '[0-9\.]* MB/s' | tail -n 1) + + echo "Iteration $i: Read speed = $READ_SPEED" + echo "-------------------------------------------" + + # Sleep for 1 second between iterations to prevent overload + sleep 1 + done + + # Clean up the test file after benchmarking + sudo rm -f "$USB_PATH/testfile" +done + +echo "Benchmarking complete!" + diff --git a/ScreenShot/screengrab_ b/ScreenShot/screengrab_ new file mode 100755 index 0000000..cedbeae --- /dev/null +++ b/ScreenShot/screengrab_ @@ -0,0 +1,40 @@ +#!/bin/bash + +SAVE_DIR="$HOME/Pictures/Screenshots" + +mkdir -p "$SAVE_DIR" + +FILENAME="$SAVE_DIR/screenshot_$(date +"%Y-%m-%d_%H-%M-%S").png" + +capture_full_screen() { + grim "$FILENAME" +} + +capture_selection() { + region=$(slurp) + grim -g "$region" "$FILENAME" +} + +capture_window() { + window_geometry=$(swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"') + grim -g "$window_geometry" "$FILENAME" +} + +case "$1" in + --full) + capture_full_screen + ;; + --select) + capture_selection + ;; + --window) + capture_window + ;; + *) + echo "Invalid option. Usage: screengrab [--full|--select|--window]" + exit 1 + ;; +esac + +wl-copy < "$FILENAME" && notify-send "Screengrab" "Screenshot copied to clipboard" + diff --git a/Sway/way.sh b/Sway/way.sh new file mode 100755 index 0000000..6914f14 --- /dev/null +++ b/Sway/way.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Fix some wayland shite + +export QT_QPA_PLATFORM=wayland +export SDL_VIDEODRIVER=wayland +export _JAVA_AWT_WM_NONREPARENTING=1