hyprwm / contrib Goto Github PK
View Code? Open in Web Editor NEWCommunity scripts and utilities for Hypr projects
License: MIT License
Community scripts and utilities for Hypr projects
License: MIT License
I was gonna PR this, but very busy atm. Can someone please add a desktop entry to grimblast's nix home-manager module? wofi --show drun
doesnt allow running cli commands, only selecting a desktop entry.
shellevents
trippwill
Bug
Hello! Hope you're doing well.
It's not exactly a bug. I'm trying to use event_closewindow
but run into issues: how do I get the target window's WINDOWADDRESS
?
event_openwindow
provides WINDOWCLASS
so it's easy to do so:
event_openwindow() {
# WINDOWADDRESS WORKSPACENAME WINDOWCLASS WINDOWTITLE
case "$WINDOWCLASS" in "firefox")
bash "$HOME"/.config/zsh/scripts/enable-audio.sh
;;
esac
}
But I can't do the same for event_closewindow
because it only provides WINDOWADDRESS
:
event_closewindow() {
# WINDOWADDRESS
}
I tried the following:
event_closewindow() {
# WINDOWADDRESS
target_address=$(hyprctl --batch clients -j | jq -r '.[] | select(.class == "firefox") | .address')
if [[ "$WINDOWADDRESS" == "$target_address" ]]; then
bash "$HOME"/.config/zsh/scripts/disable-audio.sh
fi
}
But the window is already closed so target_address
is always null
.
Any input is much appreciated. Thank you.
Loving grimblast so far! Working exactly as expected, except that with grimblasht --freeze copy area
, my vertical monitor rotates back to landscape and squeezes the output into that form factor. Here's my hyprctl monitors
output:
Monitor DP-1 (ID 0):
[email protected] at 0x500
description: ASUSTek COMPUTER INC VG27AQ1A N8LMQS051510 (DP-1)
make: ASUSTek COMPUTER INC
model: VG27AQ1A
serial: N8LMQS051510
active workspace: 1 (1)
special workspace: 0 ()
reserved: 0 0 0 0
scale: 1.00
transform: 0
focused: no
dpmsStatus: 1
vrr: 0
Monitor DP-2 (ID 1):
[email protected] at 2560x0
description: Dell Inc. Dell S2417DG #ASMzgbd21FTd (DP-2)
make: Dell Inc.
model: Dell S2417DG
serial: #ASMzgbd21FTd
active workspace: 2 (2)
special workspace: 0 ()
reserved: 0 0 0 0
scale: 1.12
transform: 3
focused: yes
dpmsStatus: 1
vrr: 0
This is both what I see when the freeze is active and what grimblast captures:
grimblast
Bug
Grimblast tends to freeze my screen of I try to use the same command thru bindings but not when using terminal!!! (I still able to open/close windows, change workspace but nothing more than that, no typing, no cursor). Like I have to use grimblast 2 times in order for it to work properly. Slurp works fine too
Put a binding config in hyprland.conf
:
bind = $mainMod, S, exec, grimblast copy area
then use it to capture screen
The Grimblast log:
1 │ Checking if required tools are installed. If something is missing, install it to your system a
│ nd make it available in PATH...
2 │ grim: OK
3 │ slurp: OK
4 │ hyprctl: OK
5 │ hyprpicker: OK
6 │ wl-copy: OK
7 │ jq: OK
8 │ notify-send: OK
This is the demonstration
video
Hi, I found grimblast through the hyprland awesome list, and I had it installed through the AUR; however, I found that the behavior involving the wait flag and when the subject was 'output' or 'active' was rather unintuitive.
As is, the script grabs the active window, then waits 5 seconds before taking a screenshot. In the case of 'area' and 'screen' this is exactly how you would expect things to be; however, for the other 2 options, the active window/output often ends up being whatever window/output the command was run in, with output, it's fine, as you can switch workspaces, though it isn't ideal. In the case of window, it just ends up taking a picture of the terminal, which isn't super helpful.
I was able to modify the code to my satisfaction, by just moving around when the program calls the wait function, but I thought I'd open this issue up to bring this to the dev's attention/help anyone else who found the behavior odd.
Thank you for writing such an excellent script! It's not easy to write something that's legible + intuitive + powerful, so thanks!
try_swap_workspace
schievel1
Bug
If you disable a monitor in hyprland config's, try_swap_workspace will be buggy and not work at all.
If you change any monitor configuration in hyprland, you most likely will need a reboot/restart hyprland for it to work.
In my case, I have a monitor enabled that I sometimes turn on, and turning it on/off make me have to restart hyprland.
this works
but if i turn on my dp-3 (rarely used monitor), i need to restart hyprland
Currently running scratchpad -m 'wofi' -g
would list all applications installed.
I just added the packages to my flake.nix and only grimblast its compiling. At eny time I add one of others scripts Im getting this error:
error: path '/nix/store/phscma235mfx30d1dncgizls1rlmh7iz-bash-5.2-p15-dev' is not valid
Im using nix unstable channel
grimblast
Bug
There's no cursor in the screenshot (neither in the preview when selecting the area, nor in the final output) even if the --cursor
flag is passed.
grimblast --freeze --cursor copy area
No response
Can you add NixOS documentation to know how to use the flake?
I'm looking to switch to grimblast from my current grimshot setup. I'm looking for a way to both save the screenshot and copy it to the clipboard. I currently do this with a pretty long command that saves the screenshot to a file and then has wl-copy
read it into the clipboard, but it sometimes fails inexplicably and it would be much nicer if it were implemented within the screenshot utility.
Would it be possible to implement such a feature in grimblast? Having it run both save
and copy
actions in a single command.
Thanks!
slurp
provides some options such as -b
, -c
, -s
, -w
etc which can be used to customise the appearance of the area selector. Currently grimblast is using the defaults, it would be nice if the user had the ability to tweak this.
Is there a particular reason there no aur package? I'm specifically interesting in hdrop
, installing it manually is simple but keeping it up to date is a bit of a chore.
grimblast
Bug
grimblast save screen active -
prints out "screen"
it doesn't actually send the image output to stdout
i don't know if it's inteded or if i'm misusign this
but grimblast save [save|copy] screen active
works well
use the command above to reproduce the issue
No response
When I try using the --freeze argument with the area option, I get errors, then it freezes without the gray overlay. When I click it freezes on an image half a second later than the first freeze, and if I want to screenshot I have to keep pressing the left click and select the area with the right click.
grimblast check returns all OK.
errors when executing the command :
parse error: Invalid numeric literal at line 1, column 28
parse error: Invalid numeric literal at line 1, column 28
parse error: Invalid numeric literal at line 1, column 28
jq: invalid JSON text passed to --argjson
Use jq --help for help with command-line options,
or see the jq manpage, or online docs at https://stedolan.github.io/jq
error after taking the screenshot :
/usr/bin/grimblast: line 197: kill: (355954) - No such process
Grimblast
Bug
For this monitor configuration:
monitor=DP-3,3840x2160@144,0x0,1.25,bitdepth,10
# Sidebar spacing
monitor=DP-3,addreserved,0,0,44,0
monitor=DP-2,1920x1080@240,3072x0,1
monitor=DP-1,1920x1080@60,4992x0,1
monitor=DP-1,transform,1 # Rotate portrait right
The following occurs only when screenshotting DP-3 (which is 10bit)
❯ grimblast copy area
[destroyed object]: error 0: Unsupported format
failed to screenshoot all outputs
grimblast copy area
on a 10bit monitor
No response
It would be nice to have a command line flag to freeze the screen while selecting the area to screenshot, this is because it is very problematic to screenshot a moving thing with the current behavior.
I don't know if this is possible with how slurp/grim work, I'm opening this issue to see if there is a way to circumvent this anyway.
I would like to be able to take screenshots without scaling or with a custom scale applied, so it would be nice if this tool passed through grim's -s
option so I could control the scaling.
Currently when selecting a window target, it forces you to select a window instead of allowing an area selection.
This one's pretty straightforward to get working; it can be done by removing the -r
flag from slurp
in this line. I'm just wondering what would be the best way to include this functionality. The simplest idea I could think of is to have a combined windowarea
target, similar to the copysave
command.
I know this is just a bunch of shell scripts and package maintainers could just download a tar of the latest commit and call that a release, but the idiomatic way in distros is to have releases named after how upsteam calls them. (instead of giving them a date as version number of commit hash)
This would make things easier for maintainers and I will make a package for gentoo of this. Deal? ❤️
Maybe wait with the release until my PR #32 is merged :-)
grimblast
Bug
If you run grimblast copy area
, the window selection will not update until you move your cursor. Sometimes I have my hands on my keyboard/touchpad and I want to screenshot a window without dragging across the touchpad first.
grimblast copy area
or grimblast save area -
it would be nice if the grimblast area selection would be keyboard controllable.
here is what I imagine:
also potentially a good idea would be to switch between area and window selection by pressing space (that is how it works in the MacOS screenshot utility). I know it has just been combined, but in my opinion it is strictly speaking worse in terms of accessibility. multiple times now I screenshotted a tiny (like 2x2) area because my click got interpretted as a drag on a hidpi display. let me know what you think. I might just try and implement some of those suggestions myself.
https://github.com/hyprwm/contrib/blob/main/grimblast/grimblast
...
## - `wl-copy`: clipboard utility
...
As well as in the grimblast check
command.
wl-copy
doesn't seem to exist, shouldn't it be wl-clipboard
(which have wl-copy as command) ?
It may be obvious, but I still don't get it. Why not keep submodules for third-party projects in this repository that their maintainers will add. This will make it easier for developers to maintain utilities (they won't have to do a PR for every commit).
It will also make it easier for users to create issues, they will be distributed to the maintainer repositories.
In general, perhaps because of this there will be a problem with licenses, I do not rummage about it.
grimblast
Bug
When using grimblast <mode> area
, the screen flashes white for a second, and then I get the following output:
$ grimblast copy area
wl_pointer@22: error 0: Device already exists
selection cancelled
screen
and window
work fine, it's only area
that shows the behavior. The following produces the bug for me:
grimblast copy area
Hyprland version, installed from the nix flake:
Hyprland, built from branch at commit e400a288d0f8ef75672cb201203b857b65b782bb ().
Date: 2024-04-27
Tag: , commits: @COMMITS@
flags: (if any)
Grimblast check output:
Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH...
grim: OK
slurp: OK
hyprctl: OK
hyprpicker: OK
wl-copy: OK
jq: OK
notify-send: OK
I've attached the relevant hyprland logs that occur when I use my screenshot shortcut, which invokes
#!/usr/bin/env bash
mkdir -p ~/screenshots
timestamp="$(date +"%Y%m%d-%H%M%S-%N")"
grimblast --notify copysave "$1" ~/screenshots/"$timestamp".png
After latest update of hyprland (version 0.33.1-2) the scratchpad is not working as before. It appears to somewhat work for the first window being sent to the scratchpad, it does appear to move to a new workspace but that workspace is actually visible on the display and other workspaces are below (behind) the scratchpad workspace.
After adding 1 window to the scratchpad no other windows will get added.
I also think wayland was also updated but I'm not 100% sure on that.
Arch Linux
wayland 1.22.0-1
wlroots 0.17.0-1
hyprland 0.33.1-2
hyprland-scratchpad-git 51.93b6aba-2
The --freeze argument does freeze the screen, however when taking a screenshot it will not use the frozen screen, it will instead use the updated screen. This might be a limitation of hyprpicker -r -z
, so I'm not sure how this would be fixed unless a snapshot of the frozen screen is taken and that is used as the base of the screenshot.
grimblast --notify --cursor --freeze copy area
https://streamable.com/3olo8m
I am using NixOS and get the script by flake. However, the try_swap_workspace
script failed with "Make Sure Hyprland Session is running." notify. I install and run hyprland following its wiki and have no issue with it. So I assume there is something wrong with environment checks.
I manually disabled pgrep -x Hyprland &>/dev/null
check and it runs perfectly, so I just go with that. But it will be great if it can be fixed upstream so that I don't need to modify the script manually.
This would delay taking the screenshot by the given amount of seconds.
https://github.com/OctopusET/sway-contrib/blob/master/grimshot.1.scd?plain=1#L21-L24
Tried copying, saving the image. Also checked active/screen/output/area options. All give the same blank black image. Grimblast check also shows everything is fine. I'm currently using xdg-desktop-portal-hyprland.
When using try_swap_workspace, workspace_back_and_forth doesn't work
binds {
workspace_back_and_forth = true
}
Not having the --scale
option set gives the following error instead of the missing argument error:
It works with --scale 1
. I think having it default to 1
instead of having to manually type it would be nice. Also, the man page is outdated.
Running NixOS with Home Manager using flakes.
Screen recording with xdg-desktop-portal-wlr
would be cool cuz Kooha sucks on Hyprland lol
Add copy to clipboard from file - Ex. grimblast copy file inputfile.png
Currently we can only use area, output, active, screen for selections and I'd love to just copy some files to clipboard for ease of use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.