diff --git a/config b/config index 5b13f8f..54adc14 100644 --- a/config +++ b/config @@ -1,2 +1 @@ -include /etc/sway/config.d/* include ~/.config/sway/config.d/* diff --git a/config.d/00-variables.conf b/config.d/00-variables.conf new file mode 100644 index 0000000..b3553ba --- /dev/null +++ b/config.d/00-variables.conf @@ -0,0 +1,15 @@ +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +# Your preferred application launcher +# Note: it's recommended that you pass the final command to sway +set $menu /usr/bin/fuzzel +set $exedir /home/vladanpopovic/.local/bin diff --git a/config.d/10-systemd-cgroups.conf b/config.d/10-systemd-cgroups.conf new file mode 100644 index 0000000..9e60e7a --- /dev/null +++ b/config.d/10-systemd-cgroups.conf @@ -0,0 +1,11 @@ +# Automatically assign a dedicated systemd scope to the GUI applications +# launched in the same cgroup as the compositor. This could be helpful for +# implementing cgroup-based resource management and would be necessary when +# `systemd-oomd` is in use. +# +# Limitations: The script is using i3ipc window:new event to detect application +# launches and would fail to detect background apps or special surfaces. +# Therefore it's recommended to supplement the script with use of systemd user +# services for such background apps. +# +exec $exedir/assign-cgroups.py diff --git a/config.d/10-systemd-session.conf b/config.d/10-systemd-session.conf new file mode 100644 index 0000000..80ed890 --- /dev/null +++ b/config.d/10-systemd-session.conf @@ -0,0 +1,31 @@ +# Address several issues with DBus activation and systemd user sessions +# +# 1. DBus-activated and systemd services do not share the environment with user +# login session. In order to make the applications that have GUI or interact +# with the compositor work as a systemd user service, certain variables must +# be propagated to the systemd and dbus. +# Possible (but not exhaustive) list of variables: +# - DISPLAY - for X11 applications that are started as user session services +# - WAYLAND_DISPLAY - similarly, this is needed for wayland-native services +# - I3SOCK/SWAYSOCK - allow services to talk with sway using i3 IPC protocol +# +# 2. `xdg-desktop-portal` requires XDG_CURRENT_DESKTOP to be set in order to +# select the right implementation for screenshot and screencast portals. +# With all the numerous ways to start sway, it's not possible to rely on the +# right value of the XDG_CURRENT_DESKTOP variable within the login session, +# therefore the script will ensure that it is always set to `sway`. +# +# 3. GUI applications started as a systemd service (or via xdg-autostart-generator) +# may rely on the XDG_SESSION_TYPE variable to select the backend. +# Ensure that it is always set to `wayland`. +# +# 4. The common way to autostart a systemd service along with the desktop +# environment is to add it to a `graphical-session.target`. However, systemd +# forbids starting the graphical session target directly and encourages use +# of an environment-specific target units. Therefore, the integration +# package here provides and uses `sway-session.target` which would bind to +# the `graphical-session.target`. +# +# 5. Stop the target and unset the variables when the compositor exits. +# +exec $exedir/session.sh diff --git a/config.d/30-output.conf b/config.d/30-output.conf new file mode 100644 index 0000000..c67de40 --- /dev/null +++ b/config.d/30-output.conf @@ -0,0 +1,58 @@ +### Output configuration +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs +# +output "eDP-1" { + mode 1920x1080@60.033Hz + pos 0 720 + transform normal + scale 1.0 + scale_filter nearest + adaptive_sync off + dpms on + bg ~/.config/sway/bkg.jpg fill +} +output "DP-1" { + mode 3840x2160@59.997Hz + pos 1920 0 + transform normal + scale 1.1 + scale_filter linear + adaptive_sync off + dpms on + bg ~/.config/sway/bkg2.jpg fill +} +output "DP-2" { + mode 3840x2160@59.997Hz + pos 1920 0 + transform normal + scale 1.1 + scale_filter linear + adaptive_sync off + dpms on + bg ~/.config/sway/bkg2.jpg fill +} +output "DP-3" { + mode 3840x2160@59.997Hz + pos 1920 0 + transform normal + scale 1.1 + scale_filter linear + adaptive_sync off + dpms on + bg ~/.config/sway/bkg2.jpg fill +} +output "HDMI-A-1" { + mode 3840x2160@59.997Hz + pos 1920 0 + transform normal + scale 1.1 + scale_filter linear + adaptive_sync off + dpms on + bg ~/.config/sway/bkg2.jpg fill +} diff --git a/config.d/95-system-keyboard-config.conf b/config.d/95-system-keyboard-config.conf new file mode 100644 index 0000000..4d6d54d --- /dev/null +++ b/config.d/95-system-keyboard-config.conf @@ -0,0 +1,9 @@ +# Apply system-wide XKB configuration stored in systemd-localed. +# +# The configuration can be viewed with `localectl` and modified +# with `localectl set-x11-keymap`. +# +# Normal mode will pick up the configuration changes immediately +# and oneshot mode will require a Sway config reload. + +exec_always $exedir/locale1-xkb-config --oneshot diff --git a/config.d/95-xdg-desktop-autostart.conf b/config.d/95-xdg-desktop-autostart.conf new file mode 100644 index 0000000..d383887 --- /dev/null +++ b/config.d/95-xdg-desktop-autostart.conf @@ -0,0 +1,14 @@ +# Wait until a StatusNotifierItem tray implementation is available and +# process XDG autostart entries. +# +# This horror has to exist because +# +# - SNI spec mandates that if `IsStatusNotifierHostRegistered` is not set, +# the client should fall back to the Freedesktop System Tray specification +# (XEmbed). +# - There are actual implementations that take this seriously and implement +# a fallback *even if* StatusNotifierWatcher is already DBus-activated. +# - https://github.com/systemd/systemd/issues/3750 +# +exec $exedir/wait-sni-ready && \ + systemctl --user start sway-xdg-autostart.target