From 4300c80526732ab46c929ed1ba0174cc507d05ca Mon Sep 17 00:00:00 2001 From: Lucas Barbieri Date: Sat, 18 Nov 2023 05:25:05 -0300 Subject: [PATCH] add hyprland script for current window --- desktop/configs/MangoHud/wine-ffxiv_dx11.conf | 53 +++++++++++++++---- desktop/scripts/print-window.sh | 12 +++++ 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/desktop/configs/MangoHud/wine-ffxiv_dx11.conf b/desktop/configs/MangoHud/wine-ffxiv_dx11.conf index 5f66025..25df159 100644 --- a/desktop/configs/MangoHud/wine-ffxiv_dx11.conf +++ b/desktop/configs/MangoHud/wine-ffxiv_dx11.conf @@ -1,13 +1,46 @@ -gamemode -wine -position=middle-left -cpu_temp +################### File Generated by GOverlay ################### +toggle_fps_limit=F1 + + +legacy_layout=false +gpu_stats gpu_temp -ram -custom_text_center=jabuxas-benchmark -cpu_load_color=00FFFF,00FFFF,FF00FF -cpu_load_value=50,90 +gpu_load_change +gpu_load_value=50,90 +gpu_load_color=FFFFFF,FFAA7F,CC0000 +gpu_text=GPU +cpu_stats +cpu_temp +cpu_load_change core_load_change -engine_version -swap +cpu_load_value=50,90 +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 diff --git a/desktop/scripts/print-window.sh b/desktop/scripts/print-window.sh index 14cecb9..395cd30 100755 --- a/desktop/scripts/print-window.sh +++ b/desktop/scripts/print-window.sh @@ -3,7 +3,19 @@ if [[ $XDG_SESSION_TYPE == "x11" ]]; then maim -i $(xdotool getactivewindow) | xclip -sel clip -t image/png fi 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 xclip -sel clip ~/tmp/jabuxas.png wl-copy < ~/tmp/jabuxas.png + fi fi