diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4adfa97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +cs2_benchmarks/ +mobos/ diff --git a/amd-gpu-performance.service b/amd-gpu-performance.service index 092035f..62306c5 100644 --- a/amd-gpu-performance.service +++ b/amd-gpu-performance.service @@ -17,3 +17,4 @@ WantedBy=multi-user.target + diff --git a/gpu-benchmark-fix.sh b/gpu-benchmark-fix.sh index ba3e066..d2dc857 100755 --- a/gpu-benchmark-fix.sh +++ b/gpu-benchmark-fix.sh @@ -83,8 +83,3 @@ echo "To set CPU to performance mode:" echo " echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor" echo "" echo -e "${GREEN}Now run your benchmark!${NC}" - - - - - diff --git a/home_dotfiles/.config/sway/config b/home_dotfiles/.config/sway/config index a58c160..7e66c41 100644 --- a/home_dotfiles/.config/sway/config +++ b/home_dotfiles/.config/sway/config @@ -220,17 +220,27 @@ bindsym $mod+Escape exec swaylock -f -c 000000 ## Session // Sleep // <> s ## bindsym $mod+Shift+s exec systemctl suspend -## Mouse // Toggle Position // <> q ## -#bindsym q exec /home/raga/repos/linux/sway-new-config/mouse-toggle.sh +############################################################################### +# Custom scripts (OSRS mode) +############################################################################### -## Mouse // Enable/Disable Toggle // <> o ## -bindsym $mod+Shift+o exec /home/raga/repos/linux/sway-new-config/mouse-toggle.sh toggle +set $osrs_scripts /home/raga/repos/linux/sway-new-config +set $osrs_mode OSRS -## Mouse // Start Autoclicker // <> a ## -bindsym $mod+Shift+a exec kitty -e /home/raga/repos/linux/sway-new-config/autoclicker.sh +bindsym f12 mode "$osrs_mode" -## Mouse // Stop Autoclicker // <> Escape ## -#bindsym Escape exec /home/raga/repos/linux/sway-new-config/autoclicker-stop.sh +mode "$osrs_mode" { + bindsym q exec $osrs_scripts/osrs-drop.sh + bindsym w exec $osrs_scripts/osrs-click.sh + bindsym o exec $osrs_scripts/mouse-toggle.sh toggle + bindsym a exec kitty -e $osrs_scripts/autoclicker.sh + #bindsym Escape exec $osrs_scripts/autoclicker-stop.sh + + ## Resize // Exit OSRS Mode // Escape or Enter ## + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym f12 mode "default" +} ############################################################################### # System Management (Arch Linux alternatives) diff --git a/home_dotfiles/.config/sway/get-focused-window.sh b/home_dotfiles/.config/sway/get-focused-window.sh new file mode 100755 index 0000000..95d6e01 --- /dev/null +++ b/home_dotfiles/.config/sway/get-focused-window.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +FOCUSED=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .name') + +echo "$FOCUSED" diff --git a/home_dotfiles/.config/sway/i3status-rust.toml b/home_dotfiles/.config/sway/i3status-rust.toml index ac40f44..f48d615 100644 --- a/home_dotfiles/.config/sway/i3status-rust.toml +++ b/home_dotfiles/.config/sway/i3status-rust.toml @@ -1,9 +1,24 @@ # Advanced i3status-rust configuration # Based on the i3xrocks blocks from your i3 setup +[[block]] +block = "custom" +command = "~/.config/sway/osrs-mode-status.sh" +format = " $text " +interval = 1 +click = [ + {button = "left", cmd = "~/.config/sway/osrs-mode-toggle.sh", update = true} +] + +#[[block]] +#block = "custom" +#command = "~/.config/sway/get-focused-window.sh" +#format = " $text " +#interval = 5 + [[block]] block = "net" -format = " $icon {$signal_strength $ssid $frequency|Wired connection} via $device " +format = " $icon {$signal_strength $ssid $frequency|Wired} @ $device " interval = 1 [[block]] diff --git a/home_dotfiles/.config/sway/osrs-mode-status.sh b/home_dotfiles/.config/sway/osrs-mode-status.sh new file mode 100755 index 0000000..57e9fdc --- /dev/null +++ b/home_dotfiles/.config/sway/osrs-mode-status.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +MODE=$(swaymsg -r -t get_binding_state 2>/dev/null | jq -r '.name // "default"') +ICON="" + +if [ "$MODE" = "OSRS" ]; then + echo "$ICON ON" +else + echo "$ICON OFF" +fi diff --git a/home_dotfiles/.config/sway/osrs-mode-toggle.sh b/home_dotfiles/.config/sway/osrs-mode-toggle.sh new file mode 100755 index 0000000..620cbe1 --- /dev/null +++ b/home_dotfiles/.config/sway/osrs-mode-toggle.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +MODE_NAME="OSRS" +CURRENT=$(swaymsg -r -t get_binding_state 2>/dev/null | jq -r '.name // "default"') + +if [ "$CURRENT" = "$MODE_NAME" ]; then + swaymsg mode default >/dev/null +else + swaymsg mode "$MODE_NAME" >/dev/null +fi diff --git a/home_dotfiles/.profile b/home_dotfiles/.profile new file mode 100644 index 0000000..044ef41 --- /dev/null +++ b/home_dotfiles/.profile @@ -0,0 +1,4 @@ +if [ -d "$HOME/.local/bin" ]; then + PATH="$HOME/.local/bin:$PATH" +fi +export PATH diff --git a/home_dotfiles/install-arch-dotfiles.sh b/home_dotfiles/install-arch-dotfiles.sh index c5f74e7..cbc65f7 100755 --- a/home_dotfiles/install-arch-dotfiles.sh +++ b/home_dotfiles/install-arch-dotfiles.sh @@ -52,6 +52,16 @@ else exit 1 fi +# Copy .profile to home directory +echo "" +print_status "Installing .profile configuration..." +if cp "$SCRIPT_DIR/.profile" ~/.profile; then + print_success ".profile installed to ~/.profile" +else + print_error "Failed to copy .profile" + exit 1 +fi + # Copy .aliases to home directory echo "" print_status "Installing .aliases configuration..." diff --git a/install-arch-sway-requirements.sh b/install-arch-sway-requirements.sh old mode 100644 new mode 100755 diff --git a/install-arch-sway.sh b/install-arch-sway.sh index e3b6379..18cc1f0 100755 --- a/install-arch-sway.sh +++ b/install-arch-sway.sh @@ -47,6 +47,19 @@ echo "Installing i3status-rust config..." cp $SCRIPT_DIR/home_dotfiles/.config/sway/i3status-rust.toml ~/.config/sway/i3status-rust.toml echo "✓ i3status-rust config installed to ~/.config/sway/i3status-rust.toml" +# === OSRS MODE SCRIPTS === +echo "" +echo "Installing OSRS mode helper scripts..." +for script in osrs-mode-status.sh osrs-mode-toggle.sh get-focused-window.sh; do + if [ -f "$SCRIPT_DIR/home_dotfiles/.config/sway/$script" ]; then + cp "$SCRIPT_DIR/home_dotfiles/.config/sway/$script" ~/.config/sway/$script + chmod +x ~/.config/sway/$script + echo "✓ Installed ~/.config/sway/$script" + else + echo "⚠ $script not found, skipping..." + fi +done + # === WEATHER SCRIPT === # Comment out this section if you don't want the weather script echo "" diff --git a/osrs-click.sh b/osrs-click.sh new file mode 100755 index 0000000..1e3f3bf --- /dev/null +++ b/osrs-click.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ydotool click 0xC0 # Left click diff --git a/osrs-drop.sh b/osrs-drop.sh new file mode 100755 index 0000000..ae40cf0 --- /dev/null +++ b/osrs-drop.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +# Mouse toggle script for Sway +# Toggles mouse position 60 (MOVE_DISTANCE) pixels upwards on each execution +# Requires ydotool and ydotoold daemon running + +# Configuration + +MOVE_DISTANCE=70 +BOTTOM_MARGIN=190 + +RANDOM_DELAY_MIN=0 +RANDOM_DELAY_MAX=0.25 +RANDOM_DELAY=$(awk -v min=$RANDOM_DELAY_MIN -v max=$RANDOM_DELAY_MAX 'BEGIN { srand(); printf "%.2f\n", min + rand() * (max - min) }') +#WL_FIND_CURSOR_BIN="${WL_FIND_CURSOR_BIN:-wl-find-cursor}" +WL_FIND_CURSOR_BIN="/home/raga/repos/linux/wl-find-cursor/wl-find-cursor" + +ENABLED_FILE="/tmp/osrs_drop__enabled" +LOCK_FILE="/tmp/osrs_drop__lock" + +# Verify dependencies +if ! command -v ydotool &> /dev/null; then + echo "Error: ydotool is not installed. Install it with: sudo pacman -S ydotool" + exit 1 +fi +if ! command -v bc &> /dev/null; then + echo "Error: bc is not installed. Install it with: sudo pacman -S bc" + exit 1 +fi +if ! command -v jq &> /dev/null; then + echo "Error: jq is not installed. Install it with: sudo pacman -S jq" + exit 1 +fi +if ! command -v "$WL_FIND_CURSOR_BIN" &> /dev/null; then + echo "Error: wl-find-cursor is not installed or not in PATH (looked for '$WL_FIND_CURSOR_BIN')." + exit 1 +fi + +# Verify lock file +if [ -f "$LOCK_FILE" ]; then + echo "Script is already running, skipping..." + exit 0 +fi +echo $$ > "$LOCK_FILE" +trap 'rm -f "$LOCK_FILE"' EXIT + +# Check if script should toggle on/off or execute +if [ "$1" = "toggle" ]; then + if [ -f "$ENABLED_FILE" ]; then + rm "$ENABLED_FILE" + echo "Mouse toggle script DISABLED" + else + echo "enabled" > "$ENABLED_FILE" + echo "Mouse toggle script ENABLED" + fi + exit 0 +fi + +# Verify script is enabled +if [ ! -f "$ENABLED_FILE" ]; then + echo "Mouse toggle script is DISABLED. Use '$0 toggle' to enable." + exit 0 +fi + +# Verify ydotoold daemon is running +if ! pgrep -x "ydotoold" > /dev/null; then + echo "Starting ydotoold daemon..." + sudo ydotoold & + sleep 1 +fi + +CURSOR_POS=$("$WL_FIND_CURSOR_BIN" -p) +if [ -z "$CURSOR_POS" ]; then + echo "Error: Unable to determine cursor position." + exit 1 +fi +read -r CURSOR_X CURSOR_Y <<< "$CURSOR_POS" + +BOTTOM_LIMIT=$(swaymsg -r -t get_outputs | jq --argjson cx "$CURSOR_X" --argjson cy "$CURSOR_Y" --argjson margin "$BOTTOM_MARGIN" ' + .[] | select(.active == true) | + select($cx >= .rect.x and $cx < (.rect.x + .rect.width) and + $cy >= .rect.y and $cy < (.rect.y + .rect.height)) | + (.rect.y + .rect.height - $margin) +' | head -n 1) + +if [ -n "$BOTTOM_LIMIT" ]; then + if [ "$(printf "%.0f" "$CURSOR_Y")" -ge "$(printf "%.0f" "$BOTTOM_LIMIT")" ]; then + echo "Cursor is already within ${BOTTOM_MARGIN}px of the bottom, skipping move." + exit 0 + fi +fi + +ydotool mousemove -- 0 $MOVE_DISTANCE diff --git a/swap.md b/swap.md new file mode 100644 index 0000000..fd73e30 --- /dev/null +++ b/swap.md @@ -0,0 +1,6 @@ +In case of zram swap: + +Make changes persistent by adding to /etc/sysctl.conf or a new file in /etc/sysctl.d/: + +vm.swappiness=100 +vm.admin_reserve_kbytes=32768