{"id":105644,"date":"2019-12-16T08:00:00","date_gmt":"2019-12-16T08:00:00","guid":{"rendered":"https:\/\/fedoramagazine.org\/?p=29623"},"modified":"2019-12-16T08:00:00","modified_gmt":"2019-12-16T08:00:00","slug":"setting-up-the-sway-window-manager-on-fedora","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2019\/12\/16\/setting-up-the-sway-window-manager-on-fedora\/","title":{"rendered":"Setting up the sway window manager on Fedora"},"content":{"rendered":"<p>Sometimes during a critical activity, working with overlapping windows becomes counterproductive. You might find a tiled window manager like sway to be a good alternative.<\/p>\n<p>Sway is a tiling Wayland compositor. It has the advantage of compatibility with an existing <a href=\"https:\/\/fedoramagazine.org\/getting-started-i3-window-manager\/\">i3 configuration<\/a>, so you can use it to replace i3 and use Wayland as the display protocol.<\/p>\n<p> <span id=\"more-29623\"><\/span> <\/p>\n<h2>Installing sway<\/h2>\n<p>To setup sway, open a new terminal and type the following command<\/p>\n<pre class=\"wp-block-preformatted\">sudo dnf install sway<\/pre>\n<p>Once the installation is completed, log out of your user session. At the login screen, select your user account. Before you enter your password, choose <em>Sway<\/em> from the menu, as shown in the following image.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2019\/12\/setting-up-the-sway-window-manager-on-fedora.png\" alt=\"\" class=\"wp-image-29776\" width=\"610\" height=\"310\" \/><\/figure>\n<\/div>\n<p>After login, your desktop looks like this:<\/p>\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2019\/12\/setting-up-the-sway-window-manager-on-fedora-1.png\" alt=\"\" class=\"wp-image-29777\" width=\"613\" height=\"312\" \/><\/figure>\n<h2>Configuration<\/h2>\n<p>To begin configuration, copy the default config into your user directory. Do that using the following commands.<\/p>\n<pre class=\"wp-block-preformatted\">mkdir -p .config\/sway\ncp \/etc\/sway\/config ~\/.config\/sway\/<\/pre>\n<p>Sway is highly configurable. It&#8217;s suggested you read the project&#8217;s <a href=\"https:\/\/github.com\/swaywm\/sway\/wiki\">wiki page<\/a> to fine tune your settings. For example, to change the keyboard layout, open a new terminal and run this command:<\/p>\n<pre class=\"wp-block-preformatted\">$ <strong>swaymsg -t get_inputs<\/strong>\n[george@mrwhite ~]$ swaymsg -t get_inputs Input device: VirtualPS\/2 VMware VMMouse Type: Mouse Identifier: 2:19:VirtualPS\/2_VMware_VMMouse Product ID: 19 Vendor ID: 2 Libinput Send Events: enabled Input device: VirtualPS\/2 VMware VMMouse Type: Mouse Identifier: 2:19:VirtualPS\/2_VMware_VMMouse Product ID: 19 Vendor ID: 2 Libinput Send Events: enabled Input device: AT Translated Set 2 keyboard Type: Keyboard Identifier: 1:1:AT_Translated_Set_2_keyboard Product ID: 1 Vendor ID: 1 Active Keyboard Layout: Portuguese (Brazil) Libinput Send Events: enabled<\/pre>\n<p>Copy the identifier keyboard code. Open your <em>~\/.config\/sway\/config file<\/em> with your text editor and edit the configuration accordingly:<\/p>\n<pre class=\"wp-block-preformatted\">## Input configuration\ninput \"1:1:AT_Translated_Set_2_keyboard\" { xkb_layout br\n}<\/pre>\n<p>Save the settings. To reload the configurations, press <strong>Super+Shift+c<\/strong>. (Typically the <strong>Super<\/strong> key is mapped to the logo key on a PC.)<\/p>\n<h2>Waybar<\/h2>\n<p>Sway&#8217;s default status bar may not have all the functions you want. Fortunately Waybar is a good replacement. To install, run the follow commands. <em>(Note, however, that COPR is not an official Fedora repository and not supported by the Fedora Project.)<\/em><\/p>\n<pre class=\"wp-block-preformatted\">sudo dnf copr enable alebastr\/waybar sudo dnf install waybar <\/pre>\n<p>Open your <em>~\/.config\/sway\/config<\/em> file. Edit the bar configuration like this:<\/p>\n<pre class=\"wp-block-preformatted\">bar { swaybar_command waybar\n}<\/pre>\n<p>Reload the configuration and you&#8217;ll now see the waybar in action, as shown below. <\/p>\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2019\/12\/setting-up-the-sway-window-manager-on-fedora-2.png\" alt=\"\" class=\"wp-image-29780\" width=\"595\" height=\"303\" \/><\/figure>\n<p>To customize the waybar, you can visit this <a href=\"https:\/\/github.com\/Alexays\/Waybar\/wiki\/Configuration\">wiki page<\/a> for more details and ideas.<\/p>\n<h2>Alacritty<\/h2>\n<p>Alacritty is a terminal emulator that uses the GPU for rendering, and a good replacement for <em>urxvt<\/em>. To install run the following lines<\/p>\n<pre class=\"wp-block-preformatted\">sudo dnf copr enable pschyska\/alacritty<br \/>sudo dnf install alacritty<\/pre>\n<p>To enable it as default terminal emulator edit your <em>~\/.config\/sway\/config<\/em>. Change this line:<\/p>\n<pre class=\"wp-block-preformatted\">set $term urxvt256c-ml<\/pre>\n<p>To:<\/p>\n<pre class=\"wp-block-preformatted\">set $term alacritty<\/pre>\n<p>Reload your configuration. <\/p>\n<p>When you open a new terminal with <strong>Super+C<\/strong>, alacritty will be open as seen in the following image:<\/p>\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2019\/12\/setting-up-the-sway-window-manager-on-fedora-3.png\" alt=\"\" class=\"wp-image-29781\" width=\"594\" height=\"302\" \/><\/figure>\n<hr class=\"wp-block-separator\" \/>\n<p><em>Photo by\u00a0<a href=\"https:\/\/unsplash.com\/@hvranic?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Ivan Vrani\u0107<\/a>\u00a0on\u00a0<a href=\"https:\/\/unsplash.com\/s\/photos\/sway?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Unsplash<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes during a critical activity, working with overlapping windows becomes counterproductive. You might find a tiled window manager like sway to be a good alternative. Sway is a tiling Wayland compositor. It has the advantage of compatibility with an existing i3 configuration, so you can use it to replace i3 and use Wayland as the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":105645,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[319,214,700,45,520,521,837,46,47,838,839,44,530],"class_list":["post-105644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fedora-os","tag-alternative","tag-desktop","tag-desktop-environment","tag-fedora","tag-i3","tag-i3wm","tag-lightweight","tag-magazine","tag-news","tag-sway","tag-tiling","tag-using-software","tag-window-manager"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/105644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=105644"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/105644\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/105645"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=105644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=105644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=105644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}