Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Add path for screenshots #139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .config/sway/config.d/50-openSUSE.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,27 @@ bindsym --no-warn XF86AudioNext exec playerctl next
bindsym --no-warn XF86AudioPrev exec playerctl previous

# Screenshots
## Screenshot file path
set $screenshot_dir $(xdg-user-dir PICTURES)/$(date +%Y-%m-%d_%H-%M-%S).png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdden@stdlen:~> xdg-user-dir PICTURES

The program 'xdg-user-dir' can be found in the following package:
  * xdg-user-dirs [ path: /usr/bin/xdg-user-dir, repository: download.opensuse.org-oss ]

Try installing with:
    sudo zypper install xdg-user-dirs

this needs additional dependency - please also add to the spec file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW - how to set those dirs to some defaults?

stdden@stdlen:~> xdg-user-dir PICTURES
/home/stdden

## Area selection shortcuts
set $selected_window swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp
set $focused_window swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"'
set $focused_output swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name'
## Screenshot commands
### Full
set $screenshot_full grim
set $screenshot_full grim $screenshot_dir
set $screenshot_full_clipboard grim - | wl-copy
### Selected window
set $screenshot_selected_window $selected_window | grim -g-
set $screenshot_selected_window $selected_window | grim -g- $screenshot_dir
set $screenshot_selected_window_clipboard $selected_window | grim -g- - | wl-copy
### Selected area
set $screenshot_selected_area slurp | grim -g-
set $screenshot_selected_area slurp | grim -g- $screenshot_dir
set $screenshot_selected_area_clipboard slurp | grim -g- - | wl-copy
### Focused window
set $screenshot_focused_window $focused_window | grim -g-
set $screenshot_focused_window $focused_window | grim -g- $screenshot_dir
set $screenshot_focused_window_clipboard $focused_window | grim -g- - | wl-copy
### Focused output
set $screenshot_focused_output grim -o $($focused_output)
set $screenshot_focused_output grim -o $($focused_output) $screenshot_dir
set $screenshot_focused_output_clipboard grim -o $($focused_output) - | wl-copy

## Screenshot mode menu
Expand Down