test
This commit is contained in:
19
amd-gpu-performance.service
Normal file
19
amd-gpu-performance.service
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=AMD GPU High Performance Mode
|
||||||
|
After=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/bash -c 'echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level'
|
||||||
|
ExecStart=/bin/bash -c 'echo 2 > /sys/class/drm/card0/device/pp_dpm_sclk'
|
||||||
|
ExecStart=/bin/bash -c 'echo 3 > /sys/class/drm/card0/device/pp_dpm_mclk'
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
12
autoclicker-stop.sh
Executable file
12
autoclicker-stop.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to stop the autoclicker
|
||||||
|
STATE_FILE="/tmp/autoclicker_running"
|
||||||
|
|
||||||
|
if [ -f "$STATE_FILE" ]; then
|
||||||
|
rm -f "$STATE_FILE"
|
||||||
|
echo "Autoclicker stop signal sent!"
|
||||||
|
else
|
||||||
|
echo "Autoclicker is not running."
|
||||||
|
fi
|
||||||
|
|
||||||
136
autoclicker.sh
Executable file
136
autoclicker.sh
Executable file
@@ -0,0 +1,136 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Autoclicker script for Sway
|
||||||
|
# Clicks continuously with random delays and periodic breaks
|
||||||
|
# Press ESC to stop
|
||||||
|
# Requires ydotool and ydotoold daemon running
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
MIN_DELAY=51 # Minimum delay in milliseconds
|
||||||
|
MAX_DELAY=689 # Maximum delay in milliseconds
|
||||||
|
MIN_CLICKS_BEFORE_BREAK=50 # Minimum clicks before break
|
||||||
|
MAX_CLICKS_BEFORE_BREAK=300 # Maximum clicks before break
|
||||||
|
MIN_BREAK=5 # Minimum break duration in seconds
|
||||||
|
MAX_BREAK=10 # Maximum break duration in seconds
|
||||||
|
|
||||||
|
STATE_FILE="/tmp/autoclicker_running"
|
||||||
|
LOCK_FILE="/tmp/autoclicker_lock"
|
||||||
|
|
||||||
|
# Check if ydotool is available
|
||||||
|
if ! command -v ydotool &> /dev/null; then
|
||||||
|
echo "Error: ydotool is not installed. Install it with: sudo pacman -S ydotool"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if bc is available (needed for random delay calculation)
|
||||||
|
if ! command -v bc &> /dev/null; then
|
||||||
|
echo "Error: bc is not installed. Install it with: sudo pacman -S bc"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if script is already running (prevent multiple instances)
|
||||||
|
if [ -f "$LOCK_FILE" ]; then
|
||||||
|
echo "Autoclicker is already running!"
|
||||||
|
echo "Press ESC to stop it."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create lock file
|
||||||
|
echo $$ > "$LOCK_FILE"
|
||||||
|
|
||||||
|
# Clean up lock file on exit
|
||||||
|
cleanup() {
|
||||||
|
rm -f "$LOCK_FILE"
|
||||||
|
rm -f "$STATE_FILE"
|
||||||
|
echo ""
|
||||||
|
echo "Autoclicker stopped."
|
||||||
|
}
|
||||||
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
|
# Check if ydotoold daemon is running
|
||||||
|
if ! pgrep -x "ydotoold" > /dev/null; then
|
||||||
|
echo "Starting ydotoold daemon..."
|
||||||
|
sudo ydotoold &
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create state file to indicate running
|
||||||
|
echo "running" > "$STATE_FILE"
|
||||||
|
|
||||||
|
# Function to generate random delay in seconds
|
||||||
|
get_random_delay() {
|
||||||
|
local min=$1
|
||||||
|
local max=$2
|
||||||
|
local range=$((max - min))
|
||||||
|
local random_ms=$((min + RANDOM % (range + 1)))
|
||||||
|
echo "scale=3; $random_ms / 1000" | bc
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to generate random number of clicks before break
|
||||||
|
get_random_clicks() {
|
||||||
|
local min=$1
|
||||||
|
local max=$2
|
||||||
|
local range=$((max - min))
|
||||||
|
echo $((min + RANDOM % (range + 1)))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to check if ESC key was pressed (by checking if state file was removed)
|
||||||
|
check_exit() {
|
||||||
|
if [ ! -f "$STATE_FILE" ]; then
|
||||||
|
echo "Exit signal received!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "=========================================="
|
||||||
|
echo "Autoclicker started!"
|
||||||
|
echo "=========================================="
|
||||||
|
echo "Configuration:"
|
||||||
|
echo " - Click delay: ${MIN_DELAY}-${MAX_DELAY}ms"
|
||||||
|
echo " - Break every: ${MIN_CLICKS_BEFORE_BREAK}-${MAX_CLICKS_BEFORE_BREAK} clicks (random)"
|
||||||
|
echo " - Break duration: ${MIN_BREAK}-${MAX_BREAK}s"
|
||||||
|
echo ""
|
||||||
|
echo "Press ESC or run: rm $STATE_FILE"
|
||||||
|
echo "=========================================="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
click_count=0
|
||||||
|
total_clicks=0
|
||||||
|
clicks_before_break=$(get_random_clicks $MIN_CLICKS_BEFORE_BREAK $MAX_CLICKS_BEFORE_BREAK)
|
||||||
|
echo "Next break will be after $clicks_before_break clicks"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
check_exit
|
||||||
|
|
||||||
|
# Generate random delay before this click
|
||||||
|
delay=$(get_random_delay $MIN_DELAY $MAX_DELAY)
|
||||||
|
|
||||||
|
# Perform click (suppress ydotool output)
|
||||||
|
ydotool click 0xC0 2>/dev/null
|
||||||
|
click_count=$((click_count + 1))
|
||||||
|
total_clicks=$((total_clicks + 1))
|
||||||
|
|
||||||
|
# Convert delay to milliseconds for display
|
||||||
|
delay_ms=$(echo "$delay * 1000" | bc | cut -d'.' -f1)
|
||||||
|
|
||||||
|
# Show each click with its delay
|
||||||
|
echo "Click #$total_clicks (delay: ${delay_ms}ms, next break in $((clicks_before_break - click_count)) clicks)"
|
||||||
|
|
||||||
|
# Check if it's time for a break
|
||||||
|
if [ $click_count -ge $clicks_before_break ]; then
|
||||||
|
break_duration=$(get_random_delay $((MIN_BREAK * 1000)) $((MAX_BREAK * 1000)))
|
||||||
|
echo ""
|
||||||
|
echo "[Break] Completed $clicks_before_break clicks (total: $total_clicks). Taking a break for ${break_duration}s..."
|
||||||
|
sleep "$break_duration"
|
||||||
|
click_count=0
|
||||||
|
# Generate new random click count for next cycle
|
||||||
|
clicks_before_break=$(get_random_clicks $MIN_CLICKS_BEFORE_BREAK $MAX_CLICKS_BEFORE_BREAK)
|
||||||
|
echo "[Resumed] Next break will be after $clicks_before_break clicks"
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
# Wait the random delay before next click
|
||||||
|
sleep "$delay"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
10
git-commit-sign-prepare-gpg.sh
Normal file
10
git-commit-sign-prepare-gpg.sh
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#gpg --full-generate-key
|
||||||
|
|
||||||
|
#gpg --list-secret-keys --keyid-format=long
|
||||||
|
|
||||||
|
#gpg --armor --export ..
|
||||||
|
|
||||||
|
#git config --global commit.gpgsign true
|
||||||
|
|
||||||
90
gpu-benchmark-fix.sh
Executable file
90
gpu-benchmark-fix.sh
Executable file
@@ -0,0 +1,90 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Comprehensive AMD GPU Performance Fix for Benchmarking
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0:31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
echo -e "${GREEN}=== AMD RX 6900 XT Benchmark Performance Fix ===${NC}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Find the AMD GPU
|
||||||
|
GPU_PATH=""
|
||||||
|
for card in /sys/class/drm/card[0-9]; do
|
||||||
|
if [ -f "$card/device/power_dpm_force_performance_level" ]; then
|
||||||
|
GPU_PATH="$card/device"
|
||||||
|
GPU_CARD=$(basename $(dirname $GPU_PATH))
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$GPU_PATH" ]; then
|
||||||
|
echo -e "${RED}ERROR: Could not find AMD GPU!${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN}Found GPU at: $GPU_PATH${NC}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Show current state
|
||||||
|
echo "=== BEFORE ==="
|
||||||
|
echo "Performance Level: $(cat $GPU_PATH/power_dpm_force_performance_level)"
|
||||||
|
echo "Core Clock:"
|
||||||
|
cat $GPU_PATH/pp_dpm_sclk | grep "\*"
|
||||||
|
echo "Memory Clock:"
|
||||||
|
cat $GPU_PATH/pp_dpm_mclk | grep "\*"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Apply fixes
|
||||||
|
echo -e "${YELLOW}Applying performance fixes...${NC}"
|
||||||
|
|
||||||
|
# 1. Set performance level to high
|
||||||
|
echo "high" | sudo tee $GPU_PATH/power_dpm_force_performance_level > /dev/null
|
||||||
|
echo "✓ Set performance level to HIGH"
|
||||||
|
|
||||||
|
# 2. Force highest core clock
|
||||||
|
echo "2" | sudo tee $GPU_PATH/pp_dpm_sclk > /dev/null
|
||||||
|
echo "✓ Forced highest core clock (2600MHz)"
|
||||||
|
|
||||||
|
# 3. Force highest memory clock
|
||||||
|
echo "3" | sudo tee $GPU_PATH/pp_dpm_mclk > /dev/null
|
||||||
|
echo "✓ Forced highest memory clock (2000MHz effective)"
|
||||||
|
|
||||||
|
# 4. Set power limit to maximum if available
|
||||||
|
if [ -f "$GPU_PATH/hwmon/hwmon*/power1_cap_max" ]; then
|
||||||
|
MAX_POWER=$(cat $GPU_PATH/hwmon/hwmon*/power1_cap_max)
|
||||||
|
echo "$MAX_POWER" | sudo tee $GPU_PATH/hwmon/hwmon*/power1_cap > /dev/null 2>&1
|
||||||
|
echo "✓ Set power limit to maximum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== AFTER ==="
|
||||||
|
echo "Performance Level: $(cat $GPU_PATH/power_dpm_force_performance_level)"
|
||||||
|
echo "Core Clock:"
|
||||||
|
cat $GPU_PATH/pp_dpm_sclk | grep "\*"
|
||||||
|
echo "Memory Clock:"
|
||||||
|
cat $GPU_PATH/pp_dpm_mclk | grep "\*"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo -e "${GREEN}GPU is now at maximum performance!${NC}"
|
||||||
|
echo ""
|
||||||
|
echo -e "${YELLOW}Additional tips:${NC}"
|
||||||
|
echo "1. Close all background applications"
|
||||||
|
echo "2. Make sure Sway compositor isn't limiting FPS"
|
||||||
|
echo "3. Run benchmark in fullscreen mode"
|
||||||
|
echo "4. Check CPU governor is set to 'performance'"
|
||||||
|
echo ""
|
||||||
|
echo "To check CPU governor:"
|
||||||
|
echo " cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | head -1"
|
||||||
|
echo ""
|
||||||
|
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}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
59
gpu-performance-mode.sh
Executable file
59
gpu-performance-mode.sh
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Force AMD GPU to high performance mode for gaming/benchmarking
|
||||||
|
|
||||||
|
# Find the AMD GPU card (not integrated graphics)
|
||||||
|
GPU_PATH=""
|
||||||
|
for card in /sys/class/drm/card[0-9]; do
|
||||||
|
if [ -f "$card/device/power_dpm_force_performance_level" ]; then
|
||||||
|
GPU_PATH="$card/device"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$GPU_PATH" ]; then
|
||||||
|
echo "ERROR: Could not find AMD GPU!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Found GPU at: $GPU_PATH"
|
||||||
|
|
||||||
|
echo "=== AMD GPU Performance Mode Script ==="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check current state
|
||||||
|
echo "Current settings:"
|
||||||
|
echo "Performance Level: $(cat $GPU_PATH/power_dpm_force_performance_level)"
|
||||||
|
echo ""
|
||||||
|
echo "Core Clock States:"
|
||||||
|
cat $GPU_PATH/pp_dpm_sclk
|
||||||
|
echo ""
|
||||||
|
echo "Memory Clock States:"
|
||||||
|
cat $GPU_PATH/pp_dpm_mclk
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Force high performance
|
||||||
|
echo "Forcing high performance mode..."
|
||||||
|
echo "high" | sudo tee $GPU_PATH/power_dpm_force_performance_level
|
||||||
|
|
||||||
|
# Force highest clock states
|
||||||
|
echo "Forcing maximum clock states..."
|
||||||
|
echo "2" | sudo tee $GPU_PATH/pp_dpm_sclk
|
||||||
|
echo "3" | sudo tee $GPU_PATH/pp_dpm_mclk
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "=== New settings ==="
|
||||||
|
echo "Performance Level: $(cat $GPU_PATH/power_dpm_force_performance_level)"
|
||||||
|
echo ""
|
||||||
|
echo "Core Clock States:"
|
||||||
|
cat $GPU_PATH/pp_dpm_sclk
|
||||||
|
echo ""
|
||||||
|
echo "Memory Clock States:"
|
||||||
|
cat $GPU_PATH/pp_dpm_mclk
|
||||||
|
echo ""
|
||||||
|
echo "GPU should now run at maximum performance!"
|
||||||
|
echo "Run your benchmark now."
|
||||||
|
echo ""
|
||||||
|
echo "To revert to auto mode, run:"
|
||||||
|
echo "echo 'auto' | sudo tee $GPU_PATH/power_dpm_force_performance_level"
|
||||||
|
|
||||||
|
|
||||||
@@ -75,15 +75,23 @@ output * bg /home/raga/.config/sway/wallpaper.jpg fill
|
|||||||
# You can get your output names by running: swaymsg -t get_outputs
|
# You can get your output names by running: swaymsg -t get_outputs
|
||||||
# DP-2 is the primary monitor on the left, and DP-1 is on the right.
|
# DP-2 is the primary monitor on the left, and DP-1 is on the right.
|
||||||
output HDMI-A-1 {
|
output HDMI-A-1 {
|
||||||
#output DP-2 {
|
|
||||||
# mode 2560x1440@60Hz
|
|
||||||
mode 2560x1440@120Hz
|
|
||||||
position 0 0
|
position 0 0
|
||||||
|
|
||||||
|
# ECO
|
||||||
|
# mode 2560x1440@60Hz
|
||||||
|
|
||||||
|
# FULL
|
||||||
|
mode 2560x1440@120Hz
|
||||||
}
|
}
|
||||||
|
|
||||||
output DP-1 {
|
output DP-1 {
|
||||||
modeline 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync
|
|
||||||
position 2560 0
|
position 2560 0
|
||||||
|
|
||||||
|
# ECO
|
||||||
|
# mode 2560x1440@60Hz
|
||||||
|
|
||||||
|
# FULL
|
||||||
|
modeline 586.59 2560 2568 2600 2640 1440 1529 1537 1543 +hsync -vsync
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -106,9 +114,13 @@ exec swayidle -w \
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Estonian keyboard layout configuration
|
# Estonian keyboard layout configuration
|
||||||
input type:keyboard {
|
# input type:keyboard {
|
||||||
xkb_layout "ee"
|
# xkb_layout "ee"
|
||||||
xkb_variant "nodeadkeys"
|
# xkb_variant "nodeadkeys"
|
||||||
|
# }
|
||||||
|
input * {
|
||||||
|
xkb_layout "ee,it"
|
||||||
|
# xkb_options "grp:alt_shift_toggle"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Enable touchpad tap, natural scroll
|
# Enable touchpad tap, natural scroll
|
||||||
@@ -159,6 +171,9 @@ floating_modifier $mod normal
|
|||||||
# Launcher dialogs
|
# Launcher dialogs
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
## Keyboard // Toggle Layout // <Alt><Shift> l ##
|
||||||
|
bindsym $alt+Shift+L input * xkb_switch_layout next
|
||||||
|
|
||||||
## Launch // Terminal // <> Enter ##
|
## Launch // Terminal // <> Enter ##
|
||||||
bindsym $mod+Return exec $term
|
bindsym $mod+Return exec $term
|
||||||
|
|
||||||
@@ -211,6 +226,12 @@ bindsym $mod+Shift+s exec systemctl suspend
|
|||||||
## Mouse // Enable/Disable Toggle // <><Shift> o ##
|
## Mouse // Enable/Disable Toggle // <><Shift> o ##
|
||||||
bindsym $mod+Shift+o exec /home/raga/repos/linux/sway-new-config/mouse-toggle.sh toggle
|
bindsym $mod+Shift+o exec /home/raga/repos/linux/sway-new-config/mouse-toggle.sh toggle
|
||||||
|
|
||||||
|
## Mouse // Start Autoclicker // <><Shift> a ##
|
||||||
|
bindsym $mod+Shift+a exec kitty -e /home/raga/repos/linux/sway-new-config/autoclicker.sh
|
||||||
|
|
||||||
|
## Mouse // Stop Autoclicker // <> Escape ##
|
||||||
|
#bindsym Escape exec /home/raga/repos/linux/sway-new-config/autoclicker-stop.sh
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# System Management (Arch Linux alternatives)
|
# System Management (Arch Linux alternatives)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -465,6 +486,7 @@ bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
|
|||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
bindsym Print exec grim - | swappy -f -
|
bindsym Print exec grim - | swappy -f -
|
||||||
|
|
||||||
bindsym $mod+Print exec grim -g "$(slurp)" - | swappy -f -
|
bindsym $mod+Print exec grim -g "$(slurp)" - | swappy -f -
|
||||||
|
|
||||||
## Modify // Toggle Bar // <> i ##
|
## Modify // Toggle Bar // <> i ##
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ RANDOM_DELAY_LEFT=0.05
|
|||||||
#RANDOM_DELAY_LEFT=0.3
|
#RANDOM_DELAY_LEFT=0.3
|
||||||
|
|
||||||
### PRAYER BONES
|
### PRAYER BONES
|
||||||
MOVE_DISTANCE=90
|
MOVE_DISTANCE=120
|
||||||
#RANDOM_NUM=$((RANDOM % 101)) # Generate 0-100
|
#RANDOM_NUM=$((RANDOM % 101)) # Generate 0-100
|
||||||
#RANDOM_DELAY=$(echo "scale=3; 0.5 + $RANDOM_NUM / 1000" | bc)
|
#RANDOM_DELAY=$(echo "scale=3; 0.5 + $RANDOM_NUM / 1000" | bc)
|
||||||
RANDOM_DELAY=0.100
|
RANDOM_DELAY=0.100
|
||||||
|
|||||||
Reference in New Issue
Block a user