diff --git a/Home.md b/Home.md index a9e6cac..7f9f22b 100644 --- a/Home.md +++ b/Home.md @@ -16,7 +16,9 @@ Some login managers support Wayland, others don't. GDM is also known to have [a ## Configuration -```shell +The suggested location for the sway configuration file is ~/.config/sway/config. To begin configuring sway, create this directory and copy the default config. + +```bash mkdir -p ~/.config/sway cp /etc/sway/config ~/.config/sway/ $EDITOR ~/.config/sway/config @@ -30,7 +32,7 @@ Sway manages displays for you, **xrandr** should not be used. Run `swaymsg -t get_outputs` to get a list of output names. Then use the `output` command to arrange your displays. -For detailed information, check the manual. Run `man 5 sway` and look for `output` +For detailed information, check the manual. Run `man 5 sway` and search for `output`. #### Multihead @@ -45,13 +47,13 @@ output eDP1 pos 1920,0 res 1600x900 #### HiDPI -HiDPI can be enabled via `output` and its scale option. +HiDPI can be enabled via `output` and its **scale** option. `output scale ` \ is the integer scaling factor (usually 2 for HiDPI screens) -If scaling is active, this has to be considered for the output positions, e.g. if the scaling factor is 2, the values of the positions of a right-side output have to be devided by 2.: +If scaling is active, this has to be considered for the output positions, e.g. if the scaling factor is 2, the values of the positions of a right-side output have to be divided by 2. See the following example: ``` output HDMI1 scale 2 @@ -68,9 +70,11 @@ Rotation is not currently supported. This needs to be implemented in WLC. See ht #### Keyboard layout -You have to set the keyboard layout before starting sway, e.g. `XKB_DEFAULT_LAYOUT=de sway`. Using a script is recommended. It is also possible to set other options known from `setxkbmap` with the environment variables `XKB_DEFAULT_MODEL`, `XKB_DEFAULT_LAYOUT`, `XKB_DEFAULT_VARIANT`, `XKB_DEFAULT_OPTIONS`. This example enables switching between the american layout, and the german layout without dead keys with `Alt-Shift`: +You have to set the keyboard layout before starting sway, using environmental variables such as `XKB_DEFAULT_LAYOUT=de sway`. It is also possible to set other options known from `setxkbmap` with the environment variables `XKB_DEFAULT_MODEL`, `XKB_DEFAULT_LAYOUT`, `XKB_DEFAULT_VARIANT`, `XKB_DEFAULT_OPTIONS`. To set these options, it is best to use a script; conveniently, they can be included to the same script that is used to launch sway. -``` +See the following example of a script that, right before launching sway, sets environmental variables that enable switching between the american and german layouts, without dead keys, using the hotkey `Alt-Shift`: + +```bash export XKB_DEFAULT_LAYOUT=us,de export XKB_DEFAULT_VARIANT=,nodeadkeys export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle, @@ -90,7 +94,8 @@ Set the environment variables `WLC_REPEAT_DELAY`/`WLC_REPEAT_RATE` to the delay/ #### Input device configuration Run `swaymsg -t get_inputs` to find the name of the input device that you want to configure, then add an `input` section to your config. Example config: -``` + +```bash input { tap enabled natural_scroll disabled @@ -101,7 +106,7 @@ See `man sway-input` for all available options. ### Wallpapers -Feh and similar tools do not work on Wayland. Use the `output` command: +Feh and similar tools do not work on Wayland. Sway supports setting wallpapers through the `output` command, using the **bg** option: e.g., `output HDMI-A-1 bg ~/wallpaper.png stretch` @@ -109,7 +114,7 @@ See output configuration options in `man 5 sway`. ### swaybar configuration -Add a `bar` section to your config: +Swaybar follows a very similar configuration to the i3bar. Simply, add a `bar` section to your config: ```shell # swaybar bar {