This commit is contained in:
2025-12-09 21:23:12 +02:00
parent c70ad02033
commit 0dabe39be9
15 changed files with 191 additions and 14 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
cs2_benchmarks/
mobos/

View File

@@ -17,3 +17,4 @@ WantedBy=multi-user.target

View File

@@ -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}"

View File

@@ -220,17 +220,27 @@ bindsym $mod+Escape exec swaylock -f -c 000000
## Session // Sleep // <><Shift> 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 // <><Shift> 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 // <><Shift> 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)

View File

@@ -0,0 +1,5 @@
#!/bin/bash
FOCUSED=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .name')
echo "$FOCUSED"

View File

@@ -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]]

View File

@@ -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

View File

@@ -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

4
home_dotfiles/.profile Normal file
View File

@@ -0,0 +1,4 @@
if [ -d "$HOME/.local/bin" ]; then
PATH="$HOME/.local/bin:$PATH"
fi
export PATH

View File

@@ -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..."

0
install-arch-sway-requirements.sh Normal file → Executable file
View File

View File

@@ -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 ""

3
osrs-click.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
ydotool click 0xC0 # Left click

93
osrs-drop.sh Executable file
View File

@@ -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

6
swap.md Normal file
View File

@@ -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