diff --git a/sway/config b/sway/config index 10ac846..c43e730 100644 --- a/sway/config +++ b/sway/config @@ -1,220 +1,181 @@ -# Default config for sway -# -# Copy this to ~/.config/sway/config and edit it to your liking. -# -# Read `man 5 sway` for a complete reference. - ### Variables -# -# Logo key. Use Mod1 for Alt. set $mod Mod4 -# Your preferred terminal emulator +set $left n +set $down r +set $up t +set $right d set $term gnome-terminal -# Your preferred application launcher -set $menu dmenu_run +set $menu rofi -show combi -show-icons | xargs swaymsg exec +set $locker swaylock -f -s center -i "/home/oliver/Bilder/Wallpapers/the\ neon\ demon.png" + +### Font +font pango:DejaVu Sans Mono 9 ### Output configuration -# -# Default wallpaper (more resolutions are available in /usr/share/sway/) -output HDMI-A-1 primary true -output HDMI-A-1 bg "/home/oliver/Bilder/Wallpapers/the neon demon.png" fill -output DP-1 disable -# -# Example output 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 * bg ~/Bilder/Wallpapers/grimes.png fill +output HDMI-A-1 position 0,0 +output DP-1 resolution 1920x1080 position 1920,0 ### Input configuration +input "65261:4871:ErgoDox_EZ_ErgoDox_EZ" { + xkb_layout de + xkb_variant neo +} input "5426:66:Razer_Razer_Abys" { drag_lock disabled accel_profile flat } ### Key bindings -# -# Basics: -# - # start a terminal - bindsym $mod+Return exec $term +# Basics +bindsym $mod+Return exec $term +bindsym $mod+Shift+x kill +bindsym $mod+a exec $menu +bindsym $mod+Shift+c reload +bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +floating_modifier $mod normal +# Moving around +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right +# Switch to workspace +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 +bindsym $mod+mod3+m workspace 1 +bindsym $mod+mod3+comma workspace 2 +bindsym $mod+mod3+period workspace 3 +bindsym $mod+mod3+n workspace 4 +bindsym $mod+mod3+r workspace 5 +bindsym $mod+mod3+t workspace 6 +bindsym $mod+mod3+h workspace 7 +bindsym $mod+mod3+g workspace 8 +bindsym $mod+mod3+f workspace 9 +bindsym $mod+mod3+space workspace 10 +# Move focused container to workspace +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 +bindsym $mod+Shift+mod3+m move container to workspace 1 +bindsym $mod+Shift+mod3+comma move container to workspace 2 +bindsym $mod+Shift+mod3+period move container to workspace 3 +bindsym $mod+Shift+mod3+n move container to workspace 4 +bindsym $mod+Shift+mod3+r move container to workspace 5 +bindsym $mod+Shift+mod3+t move container to workspace 6 +bindsym $mod+Shift+mod3+h move container to workspace 7 +bindsym $mod+Shift+mod3+g move container to workspace 8 +bindsym $mod+Shift+mod3+f move container to workspace 9 +bindsym $mod+Shift+mod3+space move container to workspace 10 +# Multiple monitors +bindsym $mod+Shift+H move workspace to output left +bindsym $mod+Shift+G move container to output left +bindsym $mod+Shift+F move container to output right +bindsym $mod+Shift+Q move workspace to output right +# Layout stuff +bindsym $mod+s splith +bindsym $mod+o splitv +bindsym $mod+i layout stacking +bindsym $mod+v layout tabbed +bindsym $mod+l layout toggle split +# Make the current focus fullscreen +bindsym $mod+e fullscreen +# Toggle the current focus between tiling and floating mode +bindsym $mod+Shift+space floating toggle +# Swap focus between the tiling area and the floating area +bindsym $mod+space focus mode_toggle +# move focus to the parent container +bindsym $mod+u focus parent +# Scratchpad +bindsym $mod+Shift+minus move scratchpad +bindsym $mod+minus scratchpad show - # kill focused window - bindsym $mod+Shift+x kill - - # start your launcher - bindsym $mod+a exec $menu - - # Drag floating windows by holding down $mod and left mouse button. - # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. - floating_modifier $mod normal - - # reload the configuration file - bindsym $mod+Shift+c reload - - # exit sway (logs you out of your wayland session) - #bindsym $mod+Shift+adiaresis exit -# -# Moving around: -# - # Move your focus around with $mod+[h|j|k|l], like vim - bindsym $mod+n focus left - bindsym $mod+r focus down - bindsym $mod+t focus up - bindsym $mod+d focus right - # or use $mod+[up|down|left|right] - bindsym $mod+Left focus left - bindsym $mod+Down focus down - bindsym $mod+Up focus up - bindsym $mod+Right focus right - - # _move_ the focused window with the same, but add Shift - bindsym $mod+Shift+n move left - bindsym $mod+Shift+r move down - bindsym $mod+Shift+t move up - bindsym $mod+Shift+d move right - # ditto, with arrow keys - bindsym $mod+Shift+Left move left - bindsym $mod+Shift+Down move down - bindsym $mod+Shift+Up move up - bindsym $mod+Shift+Right move right -# -# Workspaces: -# - # switch to workspace - bindsym $mod+1 workspace 1 - bindsym $mod+2 workspace 2 - bindsym $mod+3 workspace 3 - bindsym $mod+4 workspace 4 - bindsym $mod+5 workspace 5 - bindsym $mod+6 workspace 6 - bindsym $mod+7 workspace 7 - bindsym $mod+8 workspace 8 - bindsym $mod+9 workspace 9 - bindsym $mod+0 workspace 10 - bindsym $mod+mod3+m workspace 1 - bindsym $mod+mod3+comma workspace 2 - bindsym $mod+mod3+period workspace 3 - bindsym $mod+mod3+n workspace 4 - bindsym $mod+mod3+r workspace 5 - bindsym $mod+mod3+t workspace 6 - bindsym $mod+mod3+h workspace 7 - bindsym $mod+mod3+g workspace 8 - bindsym $mod+mod3+f workspace 9 - bindsym $mod+mod3+space workspace 10 - - # move focused container to workspace - bindsym $mod+Shift+1 move container to workspace 1 - bindsym $mod+Shift+2 move container to workspace 2 - bindsym $mod+Shift+3 move container to workspace 3 - bindsym $mod+Shift+4 move container to workspace 4 - bindsym $mod+Shift+5 move container to workspace 5 - bindsym $mod+Shift+6 move container to workspace 6 - bindsym $mod+Shift+7 move container to workspace 7 - bindsym $mod+Shift+8 move container to workspace 8 - bindsym $mod+Shift+9 move container to workspace 9 - bindsym $mod+Shift+0 move container to workspace 10 - # Note: workspaces can have any name you want, not just numbers. - # We just use 1-10 as the default. - bindsym $mod+Shift+mod3+m move container to workspace 1 - bindsym $mod+Shift+mod3+comma move container to workspace 2 - bindsym $mod+Shift+mod3+period move container to workspace 3 - bindsym $mod+Shift+mod3+n move container to workspace 4 - bindsym $mod+Shift+mod3+r move container to workspace 5 - bindsym $mod+Shift+mod3+t move container to workspace 6 - bindsym $mod+Shift+mod3+h move container to workspace 7 - bindsym $mod+Shift+mod3+g move container to workspace 8 - bindsym $mod+Shift+mod3+f move container to workspace 9 - bindsym $mod+Shift+mod3+space move container to workspace 10 - - # multiple monitors - bindsym $mod+Shift+H move workspace to output left - bindsym $mod+Shift+G move container to output left - bindsym $mod+Shift+F move container to output right - bindsym $mod+Shift+Q move workspace to output right - -# -# Layout stuff: -# - # You can "split" the current object of your focus with - # $mod+b or $mod+v, for horizontal and vertical splits - # respectively. - bindsym $mod+s splith - bindsym $mod+o splitv - - # Switch the current container between different layout styles - bindsym $mod+i layout stacking - bindsym $mod+v layout tabbed - bindsym $mod+l layout toggle split - - # Make the current focus fullscreen - bindsym $mod+e fullscreen - - # Toggle the current focus between tiling and floating mode - bindsym $mod+Shift+space floating toggle - - # Swap focus between the tiling area and the floating area - bindsym $mod+space focus mode_toggle - - # move focus to the parent container - bindsym $mod+u focus parent - - # TODO move focus to the child container - #bindsym $mod+p focus child -# -# Scratchpad: -# - # Sway has a "scratchpad", which is a bag of holding for windows. - # You can send windows there and get them back later. - - # Move the currently focused window to the scratchpad - bindsym $mod+Shift+minus move scratchpad - - # Show the next scratchpad window or hide the focused scratchpad window. - # If there are multiple scratchpad windows, this command cycles through them. - bindsym $mod+minus scratchpad show - -# Resize mode +# Resizing containers mode "resize" { - bindsym n resize shrink width 10 px or 10 ppt - bindsym r resize grow height 10 px or 10 ppt - bindsym t resize shrink height 10 px or 10 ppt - bindsym d resize grow width 10 px or 10 ppt - - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym mod3+p mode "default" - bindsym Escape mode "default" - bindsym mod3+udiaeresis mode "default" + bindsym $left resize shrink width 80px + bindsym Shift+$left resize shrink width 20px + bindsym $down resize grow height 80px + bindsym Shift+$down resize grow height 20px + bindsym $up resize shrink height 80px + bindsym Shift+$up resize shrink height 20px + bindsym $right resize grow width 80px + bindsym Shift+$right resize grow width 20px + bindsym Left resize shrink width 80px + bindsym Down resize grow height 80px + bindsym Up resize shrink height 80px + bindsym Right resize grow width 80px + bindsym Return mode "default" + bindsym Escape mode "default" } bindsym $mod+c mode "resize" -# -# Status Bar: -# +# Status Bar bar { - status_command i3status position top - #colors { - # statusline #ffffff - # background #323232 - # inactive_workspace #32323200 #32323200 #5c5c5c - #} + font pango:DejaVu Sans Mono 10 + status_command i3blocks } -# Read sway-bar(5) for more information about this section. -# You may want this: -# -# include ~/.config/sway/conf.d/* -# -# Protip: -# -# include ~/.config/sway/`hostname`/* +# Shutdown, reboot, lock srceen +set $mode_system System (b) blank, (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown +mode "$mode_system" { + bindsym b exec sleep 1 && killall -s SIGUSR1 swayidle, mode "default" + bindsym l exec '$locker', mode "default" + bindsym e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit', mode "default" + bindsym s exec '$locker && systemctl suspend', mode "default" + bindsym h exec '$locker && systemctl hibernate', mode "default" + bindsym r exec systemctl reboot, mode "default" + bindsym Shift+s exec systemctl poweroff -i, mode "default" + bindsym Return mode "default" + bindsym mod3+Return mode "default" + bindsym Escape mode "default" + bindsym mod3+Escape mode "default" +} +bindsym $mod+Shift+P mode "$mode_system" + +# Monitor setup +set $mode_monitor Monitor (l) single left, (r) single right, (h) dual horizontal, ((v) dual vertical +mode "$mode_monitor" { + bindsym l output HDMI-A-1 enable, output DP-1 disable, mode "default" + bindsym r output HDMI-A-1 disable, output DP-1 enable position 0 0 transform normal, mode "default" + bindsym h output HDMI-A-1 enable, output DP-1 enable position 1920 0 transform normal, mode "default" + bindsym v output HDMI-A-1 enable, output DP-1 enable position 0 320 transform 270, mode "default" + bindsym Return mode "default" + bindsym mod3+Return mode "default" + bindsym Escape mode "default" + bindsym mod3+Escape mode "default" +} +bindsym $mod+Shift+M mode "$mode_monitor" + +# Systemd environment +exec systemctl --user import-environment +exec systemctl --user start sway-session.target + +# Global configuration +include /etc/sway/config.d/* diff --git a/systemd/user/sway-session.target b/systemd/user/sway-session.target new file mode 100644 index 0000000..30151b3 --- /dev/null +++ b/systemd/user/sway-session.target @@ -0,0 +1,6 @@ +[Unit] +Description=sway compositor session +Documentation=man:systemd.special(7) +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target