logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git

Sway-1.0-highlights.md (6467B)


  1. ---
  2. date: 2018-10-20
  3. layout: post
  4. title: Sway 1.0-beta.1 release highlights
  5. tags: ["announcement", "wayland", "sway"]
  6. ---
  7. 1,173 days ago, I wrote sway's [initial commit][commit], and 8,269 commits
  8. followed[^1], written by hundreds of contributors. What started as a side
  9. project became the most fully featured and stable Wayland desktop available, and
  10. drove the development of what has become the dominant solution for building
  11. Wayland compositors - [wlroots](https://github.com/swaywm/wlroots), now the
  12. basis of 10 Wayland compositors.
  13. [commit]: https://github.com/swaywm/sway/commit/6a33e1e3cddac31b762e4376e29c03ccf8f92107
  14. [^1]: 5,044 sway commits and 3,225 wlroots commits at the time of writing.
  15. Sway 1.0-beta.1 was just released and is 100% compatible with the [i3 X11 window
  16. manager](https://i3wm.org/). It's faster, prettier, sips your battery, and
  17. supports [Wayland](https://wayland.freedesktop.org/) clients. When we started, I
  18. honestly didn't think we'd get here. When I decided we'd rewrite our internals
  19. and build wlroots over a year ago, I didn't think we'd get here. It's only
  20. thanks to an amazing team of talented contributors that we did. So what can
  21. users expect from this release? The difference between sway 0.15 and sway 1.0 is
  22. like night and day. The annoying bugs which plauged sway 0.15 are gone, and in
  23. their place is a rock solid Wayland compositor with loads of features you've
  24. been asking after for years. The [official release
  25. notes](https://github.com/swaywm/sway/releases/tag/1.0-beta.1) are a bit thick,
  26. so let me give you a guided tour.
  27. ## New output features
  28. Outputs, or displays, grew a lot of cool features in sway 1.0. As a reminder,
  29. you can get the names of your outputs for use in your config file by using
  30. `swaymsg -t get_outputs`. What can you do with them?
  31. To rotate your display 90 degrees, use:
  32. output DP-1 transform 90
  33. To enable our improved HiDPI support[^2], use:
  34. output DP-1 scale 2
  35. [^2]: Sway now has the best HiDPI support on Linux, period.
  36. Or to enable fractional scaling (see man page for warnings about this):
  37. output DP-1 scale 1.5
  38. You can also now run sway on multiple GPUs. It will pick a primary GPU
  39. automatically, but you can override this by specifying a list of card names at
  40. startup with `WLR_DRM_DEVICES=card0:card1:...`. The first one will do all of the
  41. rendering and any displays connected to subsequent cards will have their buffers
  42. copied over.
  43. Other cool features include support for daisy-chained DisplayPort configurations
  44. and improved Redshift support. Also, the long annoying single-output limitation
  45. of wlc is behind us: you can now drag windows between outputs with the mouse.
  46. See `man 5 sway-output` for more details on configuring these features.
  47. ## New input features
  48. Input devices have also matured a lot. You can get a list of their identifiers
  49. with `swaymsg -t get_inputs`. One oft requested feature was a better way of
  50. configuring your keyboard layout, which you can now do in your config file:
  51. ```
  52. input "9456:320:Metadot_-_Das_Keyboard_Das_Keyboard" {
  53. xkb_options caps:escape
  54. xkb_numlock enabled
  55. }
  56. ```
  57. We also now support drawing tablets, which you can bind to a specific output:
  58. ```
  59. input "1386:827:Wacom_Intuos_S_2_Pen" {
  60. map_to_output DP-3
  61. }
  62. ```
  63. You can also now do crazy stuff like having multiple mice with multiple cursors,
  64. and linking keyboards, mice, drawing tablets, and touchscreens to each other
  65. arbitrarily. You can now have your dvorak keyboard for normal use and a second
  66. qwerty keyboard for when your coworker comes over for a pair programming
  67. session. You can even give your coworker the ability to focus and type into
  68. *separate* windows from what you're working on.
  69. ## Third-party panels, lockscreens, and more
  70. Our new layer-shell protcol is starting to take hold in the community, and
  71. enables the use of even more third-party software on sway. One of our main
  72. commitments to you for sway 1.0 and wlroots is to break the boundaries between
  73. Wayland compositors and encourange standard interopable protocols - and we've
  74. done so. Here are some interesting third-party layer-shell clients in the wild:
  75. - [Waybar](https://github.com/Alexays/Waybar), a new panel
  76. - [mako](https://github.com/emersion/mako), a notification daemon
  77. - [virtboard](https://source.puri.sm/Librem5/virtboard), an on-screen keyboard
  78. - [slurp](https://github.com/emersion/slurp), a tool to interactively select a
  79. region of the screen
  80. - [Phosh](https://source.puri.sm/Librem5/phosh), the [Purism](https://puri.sm/)
  81. team's shell for their [Librem 5](https://puri.sm/shop/librem-5/) phone
  82. We also added two new protocols for capturing your screen: screencopy and
  83. dmabuf-export, respectively these are useful for screenshots and real-time
  84. screen capture, for example to live stream on Twitch. Some third-party software
  85. exists for these, too:
  86. - [grim](https://github.com/emersion/grim), for taking screenshots
  87. - [wlstream](https://github.com/atomnuker/wlstream), for recording video
  88. ## DPMS, auto-locking, and idle management
  89. Our new `swayidle` tool adds support for all of these features, and even works
  90. on other Wayland compositors. To configure it, start by running the daemon in
  91. your sway config file:
  92. ```
  93. exec swayidle \
  94. timeout 300 'swaylock -c 000000' \
  95. timeout 600 'swaymsg "output * dpms off"' \
  96. resume 'swaymsg "output * dpms on"' \
  97. before-sleep 'swaylock -c 000000'
  98. ```
  99. This example will, after 300 seconds of inactivity, lock your screen. Then after
  100. 600 seconds, it will turn off all of your outputs (and turn them back on when
  101. you wiggle the mouse). This configuration also locks your screen before your
  102. system goes to sleep. None of this will happen if you're watching a video on a
  103. supported media player (mpv, for example). For more details check out `man
  104. swayidle`.
  105. ## Miscellaneous bits
  106. There are a few other cool features I think are worth briefly mentioning:
  107. - `bindsym --locked`
  108. - swaylock has a config file now
  109. - Drag and drop is supported
  110. - Rich content (like images) is synced between the Wayland and X11 clipboards
  111. - The layout is updated atomically, meaning that you'll never see an in-progress
  112. frame when resizing windows
  113. - Primary selection is implemented and synced with X11
  114. - Pretty much every long-standing bug has been fixed
  115. For the full run-down see the [release
  116. notes](https://github.com/swaywm/sway/releases/tag/1.0-beta.1). Give the beta a
  117. try, and we're all looking forward to sway 1.0!