From a07b3e6f6395a997fb4cb1448bb46a08a4a9f2ce Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 24 Mar 2020 14:11:38 -0500 Subject: [PATCH] Wayland clipshot? --- apps/de/sway/init | 1 + apps/de/waybar/config | 2 +- bin/clipshot | 22 +++++++++++-------- bin/is_wayland | 3 +++ .../arch-linux/provisioning/2-essentials.bash | 1 + readme.md | 6 ++++- 6 files changed, 24 insertions(+), 11 deletions(-) create mode 100755 bin/is_wayland diff --git a/apps/de/sway/init b/apps/de/sway/init index 42e4018..2fb090b 100755 --- a/apps/de/sway/init +++ b/apps/de/sway/init @@ -19,6 +19,7 @@ export WLC_REPEAT_RATE=60 export QT_QPA_PLATFORM=wayland-egl export CLUTTER_BACKEND=wayland export SDL_VIDEODRIVER=wayland +# export GDK_BACKEND=wayland # DON'T SET THIS ONE export MOZ_ENABLE_WAYLAND=1 # configuration flag for some of my dotfiles scripts diff --git a/apps/de/waybar/config b/apps/de/waybar/config index 39ec4bf..b767369 100644 --- a/apps/de/waybar/config +++ b/apps/de/waybar/config @@ -98,7 +98,7 @@ //"format-bluetooth-muted": " {icon} {format_source}", //"format-muted": " {format_source}", "format-muted": " {format_source}", - "format-source": "", + "format-source": "", "format-source-muted": "", "format-icons": { "headphones": "", diff --git a/bin/clipshot b/bin/clipshot index 35347e5..abc0ddc 100755 --- a/bin/clipshot +++ b/bin/clipshot @@ -1,11 +1,15 @@ #!/usr/bin/env bash -pkill unclutter -sleep 0.1 -import ~/.ss.png -chmod 700 ~/.ss.png -< ~/.ss.png xclip -t image/png -i -selection clipboard -< ~/.ss.png xclip -t image/png -i -selection primary -< ~/.ss.png xclip -t image/png -i -selection secondary -< ~/.ss.png xclip -t image/png -i -selection buffer-cut -unclutter & +if is_wayland; then + grim -g "$(slurp -d)" - | wl-copy +else + pkill unclutter + sleep 0.1 + import ~/.ss.png + chmod 700 ~/.ss.png + < ~/.ss.png xclip -t image/png -i -selection clipboard + < ~/.ss.png xclip -t image/png -i -selection primary + < ~/.ss.png xclip -t image/png -i -selection secondary + < ~/.ss.png xclip -t image/png -i -selection buffer-cut + unclutter & +fi diff --git a/bin/is_wayland b/bin/is_wayland new file mode 100755 index 0000000..e69c45d --- /dev/null +++ b/bin/is_wayland @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +(test -z "$DISPLAY" || test -n "$WAYLAND_DISPLAY" || test -n "$SWAYSOCK" || test "$IS_WAYLAND" -eq 1) diff --git a/bin/lib/arch-linux/provisioning/2-essentials.bash b/bin/lib/arch-linux/provisioning/2-essentials.bash index d9c1d8d..8f3a2f8 100755 --- a/bin/lib/arch-linux/provisioning/2-essentials.bash +++ b/bin/lib/arch-linux/provisioning/2-essentials.bash @@ -40,6 +40,7 @@ pacaur --needed -S \ wlroots-git sway-git `# Wayland Compositor` \ swaylock `# Wayland Compositor` \ waybar mako `# Wayland Bar & Notifications` \ + slurp grim `# Wayland Screen Selection & Clipping` \ wl-clipboard `# Wayland Clipboard CLI` \ terminus-font ttf-iosevka-type ttf-iosevka-term `# Primary Fonts` \ ttf-font-awesome `# Icon Font` \ diff --git a/readme.md b/readme.md index b550d95..423604a 100644 --- a/readme.md +++ b/readme.md @@ -75,14 +75,18 @@ Here are some bullet points on my workflow: ## To Do and Improvements ++ Wayland stuff + + Sway hotkey parity (as much as is possible) with sxhkd/bspwm + + Clean out all the X11 cruft? * Add vim in the terminal as the handler for many MIME types (xdg-open and such) for the rare time I'm in a file manager or for opening easily from the browser. * Unify all the common variables... somehow? (and use templates and `envsubst`?) * Makefile instead of setup script * [Vimux](https://github.com/benmills/vimux)? -* Nerd Fonts with ligatures and icons for Kitty +* Custom Iosevka font with kitty-compatible ligatures * Setup network file sharing directory ++ Investigate some systemd services (homed, [upstream]: https://git.faceless.lytedev.io/lytedev/dotfiles