Fedora - Setting up the sway window manager on Fedora - Printable Version +- Sick Gaming (https://www.sickgaming.net) +-- Forum: Computers (https://www.sickgaming.net/forum-86.html) +--- Forum: Linux, FreeBSD, and Unix types (https://www.sickgaming.net/forum-88.html) +--- Thread: Fedora - Setting up the sway window manager on Fedora (/thread-92803.html) |
Fedora - Setting up the sway window manager on Fedora - xSicKxBot - 12-17-2019 Setting up the sway window manager on Fedora <div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/12/setting-up-the-sway-window-manager-on-fedora.png" width="1024" height="522" title="" alt="" /></div><div><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> <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> <p> <span id="more-29623"></span> </p> <h2>Installing sway</h2> <p>To setup sway, open a new terminal and type the following command</p> <pre class="wp-block-preformatted">sudo dnf install sway</pre> <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> <div class="wp-block-image"> <figure class="aligncenter size-large is-resized"><img 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> </div> <p>After login, your desktop looks like this:</p> <figure class="wp-block-image size-large is-resized"><img 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> <h2>Configuration</h2> <p>To begin configuration, copy the default config into your user directory. Do that using the following commands.</p> <pre class="wp-block-preformatted">mkdir -p .config/sway cp /etc/sway/config ~/.config/sway/</pre> <p>Sway is highly configurable. It’s suggested you read the project’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> <pre class="wp-block-preformatted">$ <strong>swaymsg -t get_inputs</strong> [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> <p>Copy the identifier keyboard code. Open your <em>~/.config/sway/config file</em> with your text editor and edit the configuration accordingly:</p> <pre class="wp-block-preformatted">## Input configuration input "1:1:AT_Translated_Set_2_keyboard" { xkb_layout br }</pre> <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> <h2>Waybar</h2> <p>Sway’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> <pre class="wp-block-preformatted">sudo dnf copr enable alebastr/waybar sudo dnf install waybar </pre> <p>Open your <em>~/.config/sway/config</em> file. Edit the bar configuration like this:</p> <pre class="wp-block-preformatted">bar { swaybar_command waybar }</pre> <p>Reload the configuration and you’ll now see the waybar in action, as shown below. </p> <figure class="wp-block-image size-large is-resized"><img 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> <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> <h2>Alacritty</h2> <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> <pre class="wp-block-preformatted">sudo dnf copr enable pschyska/alacritty<br />sudo dnf install alacritty</pre> <p>To enable it as default terminal emulator edit your <em>~/.config/sway/config</em>. Change this line:</p> <pre class="wp-block-preformatted">set $term urxvt256c-ml</pre> <p>To:</p> <pre class="wp-block-preformatted">set $term alacritty</pre> <p>Reload your configuration. </p> <p>When you open a new terminal with <strong>Super+C</strong>, alacritty will be open as seen in the following image:</p> <figure class="wp-block-image size-large is-resized"><img 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> <hr class="wp-block-separator" /> <p><em>Photo by <a href="https://unsplash.com/@hvranic?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Ivan Vranić</a> on <a href="https://unsplash.com/s/photos/sway?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>.</em></p> </div> https://www.sickgaming.net/blog/2019/12/16/setting-up-the-sway-window-manager-on-fedora/ |