Skip Navigation
swaywm

dedicated to the Sway window manager, a drop-in replacement for the i3 window manager, but for Wayland instead of X11.

Members
59
Posts
9
Active Today
3
Created
1 mo. ago
  • swaywm @programming.dev
    cm0002 @lemmy.world

    How to do screen recordings in Sway

    Author @[email protected]

    The following two key bindings will add simple screen recording hotkeys:

    • Mod+Shift+Alt+F11 records a region or the full screen to ~/Videos/screen_capture.mp4
    • Mod+Shift+Alt+F12 records a region or the full screen to ~/Videos/screen_capture.mp4 with the audio output.
     undefined
        
    bindsym $mod+Shift+Alt+F11 exec pkill wf-recorder && notify-send "Video captured in ~/Videos/screen_capture.mp4" || wf-recorder -y -g "$(slurp)" -f ~/Videos/screen_capture.mp4
    bindsym $mod+Shift+Alt+F12 exec pkill wf-recorder && notify-send "Video with audio output captured in ~/Videos/screen_capture.mp4" || wf-recorder -y -g "$(slurp)" -f ~/Videos/screen_capture.mp4 -a=alsa_output.platform-analog-sound.stereo-fallback.monitor
    
      

    Hit the key combo, select the whole screen or the region you want to record, then hit the key combo again to stop the recording.

    You need to install wf-recorder, slurp and `

  • swaywm @programming.dev
    cm0002 @lemmy.world

    Making KDEConnect work in Sway

    Author: @[email protected]

    KDEConnect is a fantastic tool to integrate your cellphone with your desktop. But while it generally works well, it has a few issues in Sway.

    Here's a quick overview of how to make it work correctly.

    First of all, you need to start the KDEConnect daemon when the session opens. No biggie, it's just a regular config line:

    exec QT_QPA_PLATFORM=xcb kdeconnectd

    The KDEConnect runs silently in the background. You can tell if it's working properly by trying to list devices it sees around on the network:

     undefined
        
    $ kdeconnect-cli -l
    - Fairphone4:  (paired and reachable)
    - lloyd@november: _24be2fd9_7c47_47de_a454_618bb6e0e016_ (reachable)
    - rosco@alfa: _508af911_1c83_4b3b_af01_7e2ca78c776a_ (reachable)
    3 devices found
    
      

    Then you want to run the KDEConnect indicator in the system tray. You can try to run the KDEConnect-supplied indicator program from the Sway config file by

  • swaywm @programming.dev
    cm0002 @lemmy.world

    Making Flameshot work in Sway

    Author: @[email protected]

    Flameshot is arguably the best Linux screenshot utility out there. Unfortunately, it has a really annoying issue: copy-to-clipboard doesn't work in Wayland. Everything else works just great, but only being able to save screenshots to files totally breaks my workflow.

    Fortunately, there's a way around this: Flameshot also has a --raw command line argument that makes it send whatever it captures to stdout. That means it's really easy to pipe it to wl-copy to send the content to the Wayland clipboard.

    Here are a couple of key bindings that exploit this and make Flameshot work great in Sway:

     undefined
        
    bindsym $mod+Alt+F11 exec bash -c 'flameshot gui --raw 2> >(grep aborted || notify-send "Screenshot copied to the clipboard") | wl-copy'
    bindsym $mod+Alt+F12 exec flameshot screen --raw | wl-copy && notify-send 
      
  • swaywm @programming.dev
    cm0002 @lemmy.world

    Make swaynag less naggy

    Author: @[email protected]

    The typical Sway config file has a key binding to pop a nagging message to exit the session, like this one:

    bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'

    But it's annoying because if you hit mod+shift+e accidentally, you have to go and click on the X to dismiss the nag. Weirdly, it happens to me a lot more than it should.

    Here's a slightly jazzed up keybinding you might like:

    bindsym $mod+Shift+e exec pkill swaynag || (swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' & sleep 5 && pkill swaynag)

    This adds two things:

    • If you hit mod+shift+e accidentally, hit it again to dismiss the nag.
    • Wait 5 seconds and the nag will disa
  • swaywm @programming.dev
    cm0002 @lemmy.world

    A quick guide to setting session-wide environment variables in Sway

    Author: @[email protected]

    If you're new to Wayland as I am, you haven't failed to be frustrated by the greeter / Sway not sourcing any of the usual X or profile configuration files. In i3, you export your variables in .profile and they're set everywhere for the whole session. Not so in Sway.

    That means if you have a custom PATH or some exported variable you would like to define session-wide - setting QT_QPA_PLATFORMTHEME so all QT apps use the correct theme in Gnome for instance - you can't. Not the usual way anyway.

    Those variables are set if you run a terminal with the shell in login mode, if they're defined in /etc/profile or .profile, but not if you run the program directly in Sway, such as wofi / rofi for example, or any program that needs an environment variable that isn't set.

    Here's how to set environment variables for the entire session in Sway:

    • Choose a greeter that understands systemd's [environm
  • swaywm @programming.dev
    cm0002 @lemmy.world

    Some Sway desktop porn

    OC by @[email protected]

    This is Sway running on my ARM64 laptop. It took some effort to get everything going just right in Wayland but now that it\s all setup, I really like it.

    The one thing I miss in Sway / Waybar is the ability to bind mouse and scroll events to commands when they happen in the empty parts of the bar like in i3 / i3blocks. If anybody knows how to achieve that, I'd be extremely grateful!

  • swaywm @programming.dev
    cm0002 @lemmy.world

    Sway 1.11 Released

    github.com Release 1.11 路 swaywm/sway

    Sway 1.11 contains 189 changes from 53 contributors. This release depends on wlroots 0.19.0. See the wlroots release notes. New features All of the enhancements from wlroots 0.19.0. Add support fo...

    Release 1.11 路 swaywm/sway
  • swaywm @programming.dev
    cm0002 @lemmy.world

    (Mostly) Monochrome Nixos

  • swaywm @programming.dev
    cm0002 @lemmy.world

    wlroots 0.19.0 released