nakedSway -- sway on nakedeb
to discover sway in a preconfigured session, i propose nakedsway
.
this package contains
all configuration files
you need to get to grips with sway/wayland quickly, in the same way as nakedfluxbox
and nakedi3wm
.
nakedsway
is available in
nakedeb repository since version 1.5.5.
sway
session isn't included in nakedeb by default yet but nakedtools
package is already adapted to a wayland type session.
this page is not a sway initiation, the official website takes care of that. you can still consult the debian wiki. to put it simply, sway is the equivalent of i3 for wayland, the successor to x11.
Contents:
- essential man pages
- nakedsway: installation
- nakedsway: configuration
- waybar: statusbar configuration
- swaylock: screen lock configuration
- foot: default terminal for sway/wayland
- sway: launch session
- sway: use and keyboard shortcuts
- wayland vs x11: different tools for different sessions
- reset user configuration
- links & resources
sway & waybar: essentials man pages
sway is very well documented from its numerous man pages:
man sway
: the general sway/wayland composer's manualman 5 sway
: configuration file and commands manualman 5 sway-bar
: swaybar configurationman 5 sway-input
: inputs configuration (keyboard, touchpad...)man 7 sway-ipc
: IPC protocol manual for swayman 5 sway-output
: outputs configuration (screens)man 7 swaybar-protocol
: JSON protocol manual for swayman swaybg
: wallpaper configurationman swayidle
: wayland screensaver configurationman swaylock
: wayland screen locker configurationman swaymsg
: send messages to a sway instanceman swaynag
: manual for the notification/action bar on swayman 5 swaynag
: manual for configuring swaynag
the sway session uses waybar
to display workspaces and information
by default. an alternative using a bash script (infosbar
) is available in the
package. you can also use i3status
as a generator.
like sway, waybar is fully documented via its man pages. man waybar
will tell you
about the status bar and its configuration. at the end of the manual you'll find a list of the
manuals dedicated to each module (+25 modules).
nakedsway: installation
nakeDeb runs on Debian, installation uses the classical protocol:
sudo apt update && sudo apt install nakedsway
this command will install:
sway
: the composer,swaybg
: the wallpaper tool,swayidle
: the screen saver tool,swaylock
: the screen locker tool,grim
: the screenshot tool,foot
: default terminal emulator,xwayland
: for x11 applications support,waybar
: statusbar tool,wlsunset
: screen color tool,btop
: system monitoring,dex
: or system and user autostart support- and their dependencies...
the various configuration files, scripts and other themes are placed in
/usr/share/nakedsway/
and /etc/skel/.config/
so that
they can be added to the personal folder of any new user.
once nakedsway has been installed, and before starting your session, copy the
appropriate files to your personal folder:
mkdir -p ~/.config/sway ~/.config/swaylock ~/.config/waybar ~/.config/foot
cp -u -R /etc/skel/.config/sway/* ~/.config/sway/
cp -u -R /etc/skel/.config/swaylock/* ~/.config/swaylock/
cp -u -R /etc/skel/.config/waybar/* ~/.config/waybar/
cp -u -R /etc/skel/.config/foot/* ~/.config/foot/
note: you can also download the nakedsway package without installing it and dig into the various files after unpacking the package like a traditional archive.
nakedsway: sway configuration
sway is configured by editing its main file ~/.config/sway/config
and its appendices, usually located in ~/.config/sway/config.d/
.
if you edit appendices, be sure to include them (using
include /path/to/file
) in the main file, as is the default on nakedsway.
if you choose the option of a single configuration file, consider each appended conf
file described here as a section of the sway/config file.
here is the list of built-in files for sway:
tree ~/.config/sway/
sway/
├── config > the main configuration file
├── config.d
│ ├── 00-vars.conf > determine the variables used in the other files
│ ├── 01-outputs.conf > screen management
│ ├── 02-inputs.conf > keyboard/mouse/touchpad management
│ ├── 03-statusbar.conf > configuring the status bar, managed by waybar on nakedsway
│ ├── 04-autostart.conf > start services/apps on session startup
│ ├── 05-scratchpad.conf > set floating terminal to pop-up
│ ├── 06-theme.conf > look & feel
│ ├── 07-window-rules.conf > special rules for special clients
│ ├── 08-launchers.conf > keyboard shortcuts for applications
│ ├── 09-controls.conf > keyboard shortcuts for sway
│ └── 10-modess.conf > mode configuration for sway
├── fr
│ ├── fr-kbd.conf > configuration for an azerty/fr keyboard
│ ├── fr-bepo-kbd.conf > configuration for a bepo/fr keyboard
│ └── fr-apple-kbd.conf > configuration for an apple/fr keyboard
└── scripts
├── import-gsettings > import GTK preferences
├── inactive-windows-transparency.py > inactives windows opacity configuration
├── infosbar > statusbar bash script (optional)
├── screentemp > screen color script
├── wallrdm > random wallpaper script
└── window-switcher > windows switcher script
a brief explanation of the role of each file/section. don't forget to consult them and modify them according to your preferences before launching your session:
- sway/config: the main file contains almost nothing of nakedsway,
but integrates the associated files using the command
include /path-to-file
(a single target file) orinclude /path-to-directory/*
(all files contained in the target directory).
example:include $HOME/.config/sway/config.d/*
will read and include all files in~/.config/sway/config.d/*
. - sway/config.d/00-vars.conf: this file declares the variables which
will be used in the other configuration files. the declaration is made in the form
set $var value|command
.
example:set $mod Mod1
will define the Alt key as the main modifier key, whileset $term "footclient"
will definefootclient
as the default terminal in other files mentioning$term
. - sway/config.d/01-outputs.conf: declaration of the screen(s). the declaration is
made in the form of
output <identifiant écran> resolution <résolution> position <x,y>
example:output LVDS-1 resolution 1280x800 position 0,0
- sway/config.d/02-inputs.conf: declaration of input peripherals
(keyboard/mouse/pad). on nakedsway, auto-detection is activated but it is preferable
to declare your inputs directly. the dedicated file includes examples and support for
default
evdev
drivers. - sway/config.d/03-statusbar.conf: on nakedsway,
waybar
manages the display of the statusbar but other options are available: a bash script (sway/scripts/infosbar
) to generate a rendering of information. a simple command to display the minimum. you can also usei3status
, which is already available on nakedeb, to display the statusbar. be sure to edit these files before using them, to choose which information is displayed and which modules are activated. the dedicated file contains all the options, so all you have to do is un-comment the sections you want. - sway/config.d/04-autostart.conf: services or applications to be launched at
session start in the form
exec|exec_always (--no-startup-id) "command [options]"
.exec
to launch at the start of the session,exec_always
to launch each time the sway configuration is reloaded,--no-startup-id
to desactivate the startup notification (option), and finallycommand
which will be processed bysh -c
and can therefore contain several commands and/or options.
example:exec --no-startup-id "sleep 30s; $HOME/.config/sway/scripts/screentemp toggle; pkill -RTMIN+5 waybar"
will launch "screentemp" in "toggle" mode after a 30-second delay, then relaunch the dedicated module inwaybar
. - sway/config.d/05-scratchpad.conf: sway has a hide/show function, which allows
you to send a window to scratchpad (not visible) using the shortcut
Super+Shift+Enter then unhide it with
Super+Enter. if several windows are in the scratchpad, they will be displayed
in turn.
on nakedsway, a terminal instance is opened at the start of the session and then sent directly to scratchpad, allowing access to a pop-up terminal with Super+Enter. - sway/config.d/06-theme.conf: sway's graphic configuration, border colour, font used,
margins, screen background, etc.
sway does not support your GTK preferences by default, so you need to declare them or import them. on nakedsway, theimport-gsettings
script does this (see below). - sway/config.d/07-window-rules.conf: some rules can be applied, subject to conditions,
to be declared in this file in the form
for_window [condition] properties
.
example :for_window [app_id="file-roller"] floating enable, move absolute position center
declares that thefile-roller
application will be free (no paving) and positioned at the centre of the screen.
ce fis file also assigns certain clients to a dedicated workspace. this assignment takes the form ofassign [condition] workspace
.
example:assign [app_id="firefox-esr"] $ws2
assignsFirefox
to the$ws2
workspace.
to findcondition
, here for "firefox", open the application then launchswaymsg -t get_tree | grep -i firefox
. - sway/config.d/08-launchers.conf: application launchers are declared in the form of
bindsym <[modifier]+touche> exec (--no-startup-id) "command [options]"
example:bindsym $mod+Shift+m exec "$term --title=htop --app-id=htop htop"
will launch a teminal instance executinghtop
with the shortcut Alt+Shift+m. - sway/config.d/09-controls.conf: keyboard shortcuts to control sway, window layout,
navigation between clients or workspaces, etc. these are declared in the same way as for launchers:
bindsym <[modifier]+touche> fonction [options]"
example:bindsym $mod+Ctrl+Right workspace next
will display next occupied workspace with Alt+Control+→ whilebindsym $mod+Ctrl+Left workspace prev
will display the previous occupied workspace with Alt+Control+←. - sway/config.d/10-modes.conf: the different modes for sway. like i3, sway supports modes, a kind of built-in action menu triggered by a shortcut and giving access to additional functions.
- sway/fr/fr-[bepo|apple]kbd.conf: bonus files to replace part of
09-controls.conf
in order to adapt sway to french/azerty/bepo keyboard. - sway/scripts/import-gsettings: as mentioned above, sway does not support GTK preferences by default. this script allows them to be imported at the start of each session and each time sway is reloaded. the script also provides a fallback theme in case the preferences cannot be found.
- sway/scripts/inactive-windows-transparency.py: a little python script that does what it says,
it applies an opacity (passed as an argument) to inactive windows. this script is launched from the
06-theme.conf
configuration file. - sway/scripts/infosbar: an example of a bash script that can be used to generate the
statusbar, an alternative to
waybar
which supports this aspect by default on nakedsway. to test the rendering directly in your terminal, go to the scripts folder and run./infosbar
. - sway/scripts/screentemp : nakeDeb uses
redshift
by default to manage screen colour on i3 & fluxbox. but for wayland session, this feature is handled bywlsunset
. thescreentemp
script allows to check screen color activation (screentemp check
) or toggle screen color state (screentemp toggle
). a notification will be displayed on each state modification. - sway/scripts/wallrdm: a random wallpaper from
/usr/share/backgrounds/
or the folder passed as an argument. - sway/scripts/window-switcher: the return of Alt+Tab to navigate
between active windows by choosing form a menu generated by
rofi
.
nakedsway: waybar configuration
waybar
supports the status bar on sway as polybar
does on i3wm by default.
waybar
works in a modular way: a series of modules that can be activated to display the
information you want. configuration involves a module declaration file (~/.config/waybar/config) and
a CSS style file (~/.config/waybar/style.css). you can create your modules using scripts
(~/.config/waybar/scripts) and use JSON syntax to change the colour, tooltip or click actions.
nakedsway
includes everything you need to easily discover waybar
and its
various possibilities: most of the common modules are activated and should work out-of-the-box.
you just need to un/comment (with //) and/or move the desired modules in the configuration file,
in the "Modules order" section.
the modules then unroll their properties in the same file, listed in alphabetical order on nakedsway,
but this is to make it easier to find what you're looking for. however, remember to follow the syntax
carefully, because waybar will crash at the slightest missing comma.
to test and confirm, you can run pkill -9 waybar && waybar
without restarting
your sway session. when you are happy with the result, close your terminal and restart sway with
Alt+Shit+r.
as with sway, waybar is particularly well documented via its man pages: man waybar
is your friend :)
nakedsway: swaylock configuration
swaylock
is the native tool for locking your screen. it is graphically similar
to i3lock
, with a coloured disk to show the keys pressed when entering the password.
this tool accepts command line options (man swaylock
for an exhaustive list) but
can also be configured from a file present by default on nakedsway.
to configure swaylock
, edit the dedicated file ~/.config/swaylock/config
.
the options are fairly intuitive except for the disk colours, which are in #RRGGBBAA format...
but you can consult a conversion table
to help you customise your lock screen.
nakedsway: foot configuration
foot
is the default terminal on nakedsway. it can run in server/client mode to
save memory. it is configured via the dedicated ~/.config/foot/foot.ini
file.
by default, the NordTheme colorscheme
is used, with a slight transparency. for high resolutions, i recommend changing the font size
(Hack 7) and the default window size, which determines the size of the terminal opened in
the scratchpad
at the start of the session.
nakedsway: launching session
the sway/wayland session is recognised by lightdm, your connection manager on nakedeb. once nakedsway has been installed and your files configured, quit your session and choose "sway" from the list of lightdm sessions. cf wiki nakedeb.
to quit sway, use the default shortcut Alt+Shift+e,
which will launch nakedquit
as for other sessions.
nakedsway: using sway
important: using sway depends on your configuration. the instructions listed here are based on the default configuration supplied with nakedsway.
to begin with, the shortcuts are almost identical to those used on the i3wm session:
you won't feel out of place if you're already using a tiling.
here are the main shortcuts used to control sway or launch applications on a
nakedsway session:
- sway-control:
- Alt+Shift+r > relaunch sway
- Alt+Shift+e > quit sway
- Alt+e > cycle through tiling layout
- Alt+t/s > tabs ou stack layout
- Alt+b/v > horizontal/vertical tiling
- Alt+f > fullscreen
- Alt+r > resize mode (quit with Esc)
- Alt+Shift+c > edit sway configuration files
- Alt+N[1,2,3...] > display workspace N
- Super+←/→ > jump to previous/next occupied workspace
- Alt+Shift+q > close focused window
- Alt+h/j/k/l > focus to direction
- Alt+←/↑/→/↓ > focus to direction
- Alt+Shift+Space > free/tile a window
- Alt+Shift+h/j/k/l > move to direction
- Alt+Shift+←/↑/→/↓ > move to direction
- Ctrl+Alt+w > set wallpaper with
nakedwalls
- Print > screenshot
- sway-apps:
- Super+Enter > show/hide scratchpad
- Super+Shift+Enter > send to scratchpad
- Alt+Enter > open terminal
- Alt+p > open applications menu
- Alt+d > open executables menu
- Super+w > launch defaul browser
- Super+r > launch
lf
- Super+Shift+r > launch pcmanfm
- Alt+x > open weechat IRC client
- Super+v > open volume control
- Super+m > launch htop
- Super+i > display neofetch
- Super+Shift+i > display system infos with
btop
- Super+BackSpace > launch the dotcleaner
wayland vs x11
a brief summary of the tools used in the various sessions:
┌─────────────────┬───────────────────┬────────────────┐
│ tools/sessions │ sway/wayland │ i3/fluxbox/x11 │
├─────────────────┼───────────────────┼────────────────┤
│autostart │ dex │ fbautostart │
│terminal │ foot │ rxvt-unicode │
│screensaver │ swayidle │ acpi/dpms │
│screenlocker │ swaylock │ i3lock │
│composite │ natif │ picom/eyecandy │
│wallpaper │ swaybg/nakedwalls │ feh/nakedwalls │
│screen color │ wlsunset │ redshift │
│screenshot │ grim │ scrot │
│image viewer │ nsxiv │ nsxiv │
│applications menu│ rofi │ rofi/fluxmenu │
└─────────────────┴───────────────────┴────────────────┘
reset user configuration
if you have modified your configuration and wish to return to the default Debian or nakeDeb configuration, follow these methods.
- back to Debian default configuration:
- backup your existing configuration:
mv $HOME/.config/sway $HOME/.config/sway.back
- quit sway from its dedicated shortcut: Alt+Shift+e then click on 'Exit'
- when you restart your session, you will use the package's default configuration.
- back to nakeDeb default configuration:
- backup your existing configuration:
mv $HOME/.config/sway $HOME/.config/sway.back
- copy the nakeDeb defult configuration:
cp -R /etc/skel/.config/sway $HOME/.config/sway
- quit sway from its dedicated shortcut: Alt+Shift+e then click on 'Exit'
- when you restart your session, you will use the nakeDeb's default configuration.
default configuration files are located in /etc/sway
for Debian
and in /etc/skel/.config/sway
for nakeDeb.
all nakedsway
files are located in /usr/share/nakedsway
.