{"id":25249434,"url":"https://github.com/whysobad/hyprland-preview-share-picker","last_synced_at":"2025-08-21T16:02:55.793Z","repository":{"id":277013559,"uuid":"926265293","full_name":"WhySoBad/hyprland-preview-share-picker","owner":"WhySoBad","description":"an alternative share picker for hyprland with window and monitor previews written in rust","archived":false,"fork":false,"pushed_at":"2025-03-19T13:12:43.000Z","size":240,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T14:25:22.982Z","etag":null,"topics":["gtk","hyprland","rust","wayland"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhySoBad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-02T23:18:34.000Z","updated_at":"2025-03-17T07:50:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"02eecc9f-3e9d-42f1-9649-e2dcec96d987","html_url":"https://github.com/WhySoBad/hyprland-preview-share-picker","commit_stats":null,"previous_names":["whysobad/hyprland-preview-share-picker"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Fhyprland-preview-share-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Fhyprland-preview-share-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Fhyprland-preview-share-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhySoBad%2Fhyprland-preview-share-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhySoBad","download_url":"https://codeload.github.com/WhySoBad/hyprland-preview-share-picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406071,"owners_count":20933802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gtk","hyprland","rust","wayland"],"created_at":"2025-02-12T03:21:52.976Z","updated_at":"2025-08-21T16:02:55.755Z","avatar_url":"https://github.com/WhySoBad.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hyprland-preview-share-picker\n\n\u003cdiv align=\"center\" justify=\"center\"\u003e\n  \u003cimg width=\"90%\" src=\"https://github.com/user-attachments/assets/0172f531-08b5-48c7-b167-32c6ce6535e8\" /\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ci\u003ethe screenshot was made using a custom stylesheet, the widgets use the gtk theme per default \u003csup\u003e\u003ca href=\"#customization\"\u003e[1]\u003c/a\u003e\u003c/sup\u003e\u003c/i\u003e\n\u003c/div\u003e\n\n## Installation\n\n### Using pacman\n\nOn Arch-based systems, the easiest and recommended way to install the share picker is using the offical [hyprland-preview-share-picker-git](https://aur.archlinux.org/packages/hyprland-preview-share-picker-git) AUR-package.\n\nAlternatively, the following `PKGBUILD` can be used to build and install the package locally. Simply copy the `PKGBUILD` source to an empty directory on your system and install the package and all it's dependencies using `makepkg -si`\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003ePKGBUILD source\u003c/b\u003e\u003c/summary\u003e\n\n```bash\npkgname=\"hyprland-preview-share-picker-git\"\npkgver=v0.1.0\npkgrel=1\npkgdesc=\"An alternative share picker for hyprland with window and monitor previews\"\narch=(x86_64)\nurl=\"https://github.com/WhySoBad/hyprland-preview-share-picker\"\nlicense=(MIT)\ndepends=('gtk4' 'gtk4-layer-shell' 'xdg-desktop-portal-hyprland' 'hyprland')\nmakedepends=(cargo-nightly)\noptdepends=(\n  'slurp: default tool for selecting share regions'\n)\nsource=(\"$pkgname::git+https://github.com/WhySoBad/hyprland-preview-share-picker\")\nmd5sums=('SKIP')\n\npkgver() {\n    cd \"$pkgname\"\n    git describe --long --abbrev=7 --tags | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\\1/;s/-/./g'\n}\n\nprepare() {\n    cd \"$pkgname\"\n    git submodule init\n    git config submodule.subprojects/lib.url \"$srcdir/lib\"\n    git -c protocol.file.allow=always submodule update\n\n    export RUSTUP_TOOLCHAIN=nightly\n    cargo fetch --locked --target \"$(rustc -vV | sed -n 's/host: //p')\"\n}\n\nbuild() {\n    cd \"$pkgname\"\n\n    export RUSTUP_TOOLCHAIN=nightly\n    export CARGO_TARGET_DIR=target\n\n    cargo build --frozen --release\n\n    ./target/release/hyprland-preview-share-picker schema \u003e schema.json\n}\n\npackage() {\n    cd \"$pkgname\"\n\n    install -Dm0755 -T \"target/release/hyprland-preview-share-picker\" \"$pkgdir/usr/bin/hyprland-preview-share-picker\"\n\n    install -dm0755 \"$pkgdir/usr/share/hyprland-preview-share-picker\"\n    install -Dm0644 \"schema.json\" \"$pkgdir/usr/share/hyprland-preview-share-picker\"\n}\n```\n\n\u003c/details\u003e\n\n### Building yourself\n\nThe following dependencies are needed:\n- gtk4\n- gtk4-layer-shell\n- xdg-desktop-portal-hyprland (xdg-desktop-portal-hyprland-git)\n- hyprland (hyprland-git)\n\n\u003e Depending on your distribution the names may differ, the above names are for the Arch and AUR packages\n\nThe project is built using the rust nightly toolchain, make sure you're using it for this build.\n\n```bash\n# clone the repository with it's submodules\ngit clone --recursive https://github.com/WhySoBad/hyprland-preview-share-picker\n\ncd ./hyprland-preview-share-picker\n\n# build the optimized release binary\ncargo build --release\n```\nThe built binary is now available in the `target/release/hyprland-preview-share-picker` directory. If you want to install it directly using\ncargo you can use the following command. However, make sure the cargo binary directory is added to your path:\n\n```bash\n# install the package into your cargo binary directory\ncargo install --path .\n```\n\n## Usage\n\nOnce installed, you need to change the [xdg-desktop-portal-hyprland screencopy configuration](https://wiki.hyprland.org/Hypr-Ecosystem/xdg-desktop-portal-hyprland/#category-screencopy) to use the `hyprland-preview-share-picker` binary as picker:\n\n```ini\n# ~/.config/hypr/xdph.conf\nscreencopy {\n  custom_picker_binary = hyprland-preview-share-picker\n}\n```\n\nAfter changing the config the portal needs to be restarted.\n\n## Configuration\n\nThe default configuration path is `$XDG_CONFIG_DIR/hyprland-preview-share-picker/config.yaml` with a fallback to `~/.config/hyprland-preview-share-picker/config.yaml`.\nThe configuration path can be overwritten using the `-c/--config` cli argument.\n\nBelow is a configuration file with all fields and their default values:\n\n```yaml\n# paths to stylesheets on the filesystem which should be applied to the application\n#\n# relative paths are resolved relative to the location of the config file\nstylesheets: []\n# default page selected when the picker is opened\ndefault_page: windows\n\nwindow:\n  # height of the application window\n  height: 500\n  # width of the application window\n  width: 1000\n\nimage:\n  # size to which the images should be internally resized to reduce the memory footprint\n  resize_size: 200\n  # target size of the longer side of the image widget\n  widget_size: 150\n\nclasses:\n  # css classname of the window\n  window: window\n  # css classname of the card containing an image and a label\n  image_card: card\n  # css classname of the card containing an image and a label when the image is still being loaded\n  image_card_loading: card-loading\n  # css classname of the image inside the card\n  image: image\n  # css classname of the label inside the card\n  image_label: image-label\n  # css classname of the notebook containing all pages\n  notebook: notebook\n  # css classname of a label of the notebook\n  tab_label: tab-label\n  # css classname of a notebook page (e.g. windows container)\n  notebook_page: page\n  # css classname of the region selection button\n  region_button: region-button\n  # css classname of the button containing the session restore checkbox and label\n  restore_button: restore-button\n\nwindows:\n  # minimum amount of image cards per row on the windows page\n  min_per_row: 3\n  # maximum amount of image cards per row on the windows page\n  max_per_row: 999\n  # number of clicks needed to select a window\n  clicks: 2\n  # spacing in pixels between the window cards\n  spacing: 12\n\noutputs:\n  # number of clicks needed to select an output\n  clicks: 2\n  # spacing in pixels between the outputs in the layout\n  # note: the spacing is applied from both sides (the gap is `spacing * 2`)\n  spacing: 6\n  # show the label with the output name\n  show_label: false\n  # size the output cards respectively to their scaling\n  respect_output_scaling: true\n\nregion:\n  # command to run for region selection\n  # the output needs to be in the \u003coutput\u003e@\u003cx\u003e,\u003cy\u003e,\u003cw\u003e,\u003ch\u003e (e.g. DP-3@2789,436,756,576) format\n  command: slurp -f '%o@%x,%y,%w,%h'\n\n# hide the token restore checkbox and use the default value instead\nhide_token_restore: false\n# enable debug logs by default\ndebug: false\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eSchema for config file\u003c/b\u003e\u003c/summary\u003e\n\nA JSON schema for the configuration file can be generated using the `schema` subcommand.\nFor editor support you need to configure your YAML language server to apply this schema to the config file.\n\n\u003c/details\u003e\n\n## Customization\n\nThe widgets use their default gtk style out of the box. Using the `stylesheets` config field an array of paths to CSS/SCSS stylesheets\ncan be provided which then are applied to the application.\n\nIt's possible to override most of the CSS classnames of the widgets used with the `classes` config field.\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003cb\u003eExample stylesheet from the screenshot\u003c/b\u003e\u003c/summary\u003e\n\n```css\n* {\n  all: unset;\n  font-family: JetBrains Mono NF;\n  color: #ECF2F8;\n  font-weight: bold;\n  font-size: 16px;\n}\n\n.window {\n  border-radius: 5px;\n  background-color: #0D1117;\n  border: solid 2px #21262D;\n  margin: 2px;\n}\n\ntabs {\n    padding: 0.5rem 1rem;\n}\n\ntabs \u003e tab {\n    margin-right: 1rem;\n}\n\n.tab-label {\n    color: #89929B;\n    transition: all 0.2s ease;\n}\n\ntabs \u003e tab:checked \u003e .tab-label, tabs \u003e tab:active \u003e .tab-label {\n    text-decoration: underline currentColor;\n    color: #ECF2F8;\n}\n\ntabs \u003e tab:focus \u003e .tab-label {\n    color: #ECF2F8;\n}\n\n.page {\n    padding: 1rem;\n}\n\n.image-label {\n    font-size: 12px;\n    padding: 0.25rem;\n}\n\nflowboxchild \u003e .card, button \u003e .card {\n    transition: all 0.2s ease;\n    border: solid 2px transparent;\n    border-color: #161B22;\n    border-radius: 5px;\n    background-color: #161B22;\n    padding: 5px;\n}\n\nflowboxchild:active \u003e .card, flowboxchild:selected \u003e .card, button:active \u003e .card, button:selected \u003e .card, button:focus \u003e .card {\n    border: solid 2px #61AFEF;\n}\n\n.image {\n    border-radius: 5px;\n}\n\n.region-button {\n    padding: 0.5rem 1rem;\n    border-radius: 5px;\n    background-color: #61AFEF;\n    color: #161B22;\n    transition: all 0.2s ease;\n}\n\n.region-button:not(:disabled):hover, .region-button:not(:disabled):focus {\n    background-color: #2472C8;\n}\n\n.region-button:disabled {\n    background-color: #89929B;\n    color: #21262D;\n}\n```\n\n\u003c/details\u003e\n\n### Custom frontend\n\nIf you prefer to have a frontend in the ui toolkit of your choice or you dislike the layout of this frontend, it should be pretty straightforward to\ncreate your own frontend in rust. All of the toolkit independent logic (mostly wayland logic) is located in the `lib` subproject. By adding this as git dependency\nto your project, most of the application logic should be taken care of.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhysobad%2Fhyprland-preview-share-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhysobad%2Fhyprland-preview-share-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhysobad%2Fhyprland-preview-share-picker/lists"}