add hyprland script for current window

This commit is contained in:
Lucas Barbieri 2023-11-18 05:25:05 -03:00
parent 4f87eb7f23
commit 4300c80526
2 changed files with 55 additions and 10 deletions

View File

@ -1,13 +1,46 @@
gamemode ################### File Generated by GOverlay ###################
wine toggle_fps_limit=F1
position=middle-left
cpu_temp
legacy_layout=false
gpu_stats
gpu_temp gpu_temp
ram gpu_load_change
custom_text_center=jabuxas-benchmark gpu_load_value=50,90
cpu_load_color=00FFFF,00FFFF,FF00FF gpu_load_color=FFFFFF,FFAA7F,CC0000
cpu_load_value=50,90 gpu_text=GPU
cpu_stats
cpu_temp
cpu_load_change
core_load_change core_load_change
engine_version cpu_load_value=50,90
swap cpu_load_color=FFFFFF,FFAA7F,CC0000
cpu_color=DE0835
cpu_text=CPU
io_color=D8D8D8
vram
vram_color=DE0835
ram
ram_color=DE0835
fps
engine_color=950524
gpu_color=DE0835
wine_color=950524
frame_timing=1
frametime_color=DE0835
media_player_color=950524
table_columns=3
background_alpha=0.4
font_size=24
font_file=/yang/.local/share/fonts/CartographCFNerdFont-DemiBold.ttf
background_color=020202
position=middle-left
text_color=D8D8D8
round_corners=5
#GOVERLAY_THEME=amdradeon
toggle_hud=Shift_R+F12
toggle_logging=Shift_L+F2
upload_log=F5
output_folder=/home/jab
media_player_name=spotify
font_scale=0.8 font_scale=0.8

View File

@ -3,7 +3,19 @@ if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -i $(xdotool getactivewindow) | xclip -sel clip -t image/png maim -i $(xdotool getactivewindow) | xclip -sel clip -t image/png
fi fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
if [[ $XDG_CURRENT_DESKTOP == "Hyprland" ]]; then
window_info=$(hyprctl activewindow)
coordinates=$(echo "$window_info" | grep -oP 'at: \K([0-9]+,[0-9]+)')
size=$(echo "$window_info" | grep -oP 'size: \K([0-9]+,[0-9]+)')
IFS=',' read -r x y <<< "$coordinates"
IFS=',' read -r width height <<< "$size"
grim -g "${x},${y} ${width}x${height}" ~/tmp/jabuxas.png
wl-copy < ~/tmp/jabuxas.png
fi
if [[ $XDG_CURRENT_DESKTOP == "sway" ]]; then
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" ~/tmp/jabuxas.png grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" ~/tmp/jabuxas.png
xclip -sel clip ~/tmp/jabuxas.png xclip -sel clip ~/tmp/jabuxas.png
wl-copy < ~/tmp/jabuxas.png wl-copy < ~/tmp/jabuxas.png
fi
fi fi