From c2f3489234c1deb19eb14c9c0a8f5cb3a92893e3 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Thu, 21 Feb 2019 14:02:37 +0000 Subject: [PATCH] Use sway instead of i3 for that sweet wayland --- bash/.bash_profile | 21 +++- sway/.config/sway/config.base | 184 +++++++++++++++++++++++++++++ sway/.config/sway/config.magnesium | 39 ++++++ sway/.config/sway/config.platinum | 18 +++ sway/.config/sway/config.plutonium | 20 ++++ 5 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 sway/.config/sway/config.base create mode 100644 sway/.config/sway/config.magnesium create mode 100644 sway/.config/sway/config.platinum create mode 100644 sway/.config/sway/config.plutonium diff --git a/bash/.bash_profile b/bash/.bash_profile index c7bcf26..9f1ee8d 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -13,6 +13,25 @@ if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi +export PATH="$HOME/.cargo/bin:$PATH" +if test -z "${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir + if ! test -d "${XDG_RUNTIME_DIR}"; then + mkdir "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" + fi +fi -export PATH="$HOME/.cargo/bin:$PATH" +export QT_QPA_PLATFORM=wayland-egl + +if [ -f ~/.config/sway/config.base ]; then + cat ~/.config/sway/config.base ~/.config/sway/config.${HOSTNAME} > ~/.config/sway/config +fi + +if [ -f ~/.Xresources ]; then + cat ~/.Xresources > ~/.Xdefaults + if [ -f ~/.Xresources.$HOSTNAME ]; then + cat ~/.Xresources.$HOSTNAME >> ~/.Xdefaults + fi +fi diff --git a/sway/.config/sway/config.base b/sway/.config/sway/config.base new file mode 100644 index 0000000..b9c1741 --- /dev/null +++ b/sway/.config/sway/config.base @@ -0,0 +1,184 @@ +# Colors +set $black #000000 +set $black_super #555555 + +set $red #f92672 +set $red_super #dd4278 + +set $green #74e22e +set $green_super #9dc54b + +set $yellow #e6db74 +set $yellow_super #d1ca89 + +set $blue #66d9ef +set $blue_super #7accda + +set $magenta #ae81ff +set $magenta_super #b392ef + +set $cyan #00d9d9 +set $cyan_super #c8f0f0 + +set $white #f5deb3 +set $white_super #ffffff + +client.focused $black $yellow_super $black $black $black +client.focused_inactive $black $black_super $white $black $black + + +set $mod Mod4 + + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +bindsym Control+t mode "$ratpoison" + +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +mode "$ratpoison" { +# All/most commands in this mode should revert to the default mode on comleption. +# We are emulating ratpoison (kinda) here + +# Moving to workspaces +# bindsym n workspace next mode "default" +# bindsym Shift+n workspace prev mode "default" + + bindsym 1 exec 'swaymsg mode "default"; swaymsg workspace $ws1' + bindsym 2 exec 'swaymsg mode "default"; swaymsg workspace $ws2' + bindsym 3 exec 'swaymsg mode "default"; swaymsg workspace $ws3' + bindsym 4 exec 'swaymsg mode "default"; swaymsg workspace $ws4' + bindsym 5 exec 'swaymsg mode "default"; swaymsg workspace $ws5' + bindsym 6 exec 'swaymsg mode "default"; swaymsg workspace $ws6' + bindsym 7 exec 'swaymsg mode "default"; swaymsg workspace $ws7' + bindsym 8 exec 'swaymsg mode "default"; swaymsg workspace $ws8' + bindsym 9 exec 'swaymsg mode "default"; swaymsg workspace $ws9' + bindsym 0 exec 'swaymsg mode "default"; swaymsg workspace $ws10' + + bindsym Shift+1 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws1' + bindsym Shift+2 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws2' + bindsym Shift+3 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws3' + bindsym Shift+4 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws4' + bindsym Shift+5 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws5' + bindsym Shift+6 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws6' + bindsym Shift+7 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws7' + bindsym Shift+8 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws8' + bindsym Shift+9 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws9' + bindsym Shift+0 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws10' + +# Moving focus +# bindsym Tab focus right mode "default" +# bindsym Shift+Tab focus left mode "default" + + bindsym h exec 'swaymsg mode "default"; swaymsg focus left' + bindsym j exec 'swaymsg mode "default"; swaymsg focus down' + bindsym k exec 'swaymsg mode "default"; swaymsg focus up' + bindsym l exec 'swaymsg mode "default"; swaymsg focus right' + + +# Moving windows + bindsym Shift+h exec 'swaymsg mode "default"; swaymsg move left' + bindsym Shift+j exec 'swaymsg mode "default"; swaymsg move down' + bindsym Shift+k exec 'swaymsg mode "default"; swaymsg move up' + bindsym Shift+l exec 'swaymsg mode "default"; swaymsg move right' + +# Changing split modes + bindsym v exec 'swaymsg mode "default"; swaymsg split v' + bindsym o exec 'swaymsg mode "default"; swaymsg split h' + + + bindsym c exec 'swaymsg mode "default"; swaymsg exec urxvt' + bindsym q exec 'swaymsg mode "default"; swaymsg kill' + + bindsym Shift+e exec 'swaymsg mode "default"; swaymsg exec dmenu_run' + + bindsym $mod+l exec 'swaymsg mode "default"; swaylock -c 000000' + bindsym Escape mode "default" +} + + + +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# enter fullscreen mode for the focused container +bindsym $mod+t fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+r layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+f layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +#reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { +# These bindings trigger as soon as you enter the resize mode + +# Pressing left will shrink the window’s width. +# Pressing right will grow the window’s width. +# Pressing up will shrink the window’s height. +# Pressing down will grow the window’s height. + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + +# same bindings, but for the arrow keys + 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 or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+p mode "default" +} + +bindsym $mod+p mode "resize" + + + +hide_edge_borders both + +focus_follows_mouse no + +focus_on_window_activation urgent + +for_window [class="^rdesktop"] move workspace number 9; floating disable + +exec swayidle \ + timeout 300 'swaylock -c 000000' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on" \ + before-sleep 'swaylock -c 000000' diff --git a/sway/.config/sway/config.magnesium b/sway/.config/sway/config.magnesium new file mode 100644 index 0000000..6e16cab --- /dev/null +++ b/sway/.config/sway/config.magnesium @@ -0,0 +1,39 @@ +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + id bar_left + status_command conky-i3bar + position top + output "HDMI2" + font pango:Liberation Mono 10 + colors { + background $black_super + focused_background $black + focused_workspace $black_super $yellow_super $black + active_workspace $black_super $blue_super $black + inactive_workspace $black_super $black_super $white_super + urgent_workspace $black $red_super $white + } +} + +bar { + id bar_right + position top + output "HDMI3" + font pango:Liberation Mono 10 + colors { + background $black_super + focused_background $black + focused_workspace $black_super $yellow_super $black + active_workspace $black_super $blue_super $black + inactive_workspace $black_super $black_super $white_super + urgent_workspace $black $red_super $white + } +} + + +workspace 1 output HDMI2 +workspace 2 output HDMI3 + + +font pango:Liberation Mono 8 diff --git a/sway/.config/sway/config.platinum b/sway/.config/sway/config.platinum new file mode 100644 index 0000000..084cb9d --- /dev/null +++ b/sway/.config/sway/config.platinum @@ -0,0 +1,18 @@ +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + id bar_left + status_command conky-i3bar + position top + font pango:Liberation Mono 12 + colors { + background $black_super + focused_background $black + focused_workspace $black_super $yellow_super $black + active_workspace $black_super $blue_super $black + inactive_workspace $black_super $black_super $white_super + urgent_workspace $black $red_super $white + } +} + +font pango:Liberation Mono 10 diff --git a/sway/.config/sway/config.plutonium b/sway/.config/sway/config.plutonium new file mode 100644 index 0000000..91dd771 --- /dev/null +++ b/sway/.config/sway/config.plutonium @@ -0,0 +1,20 @@ +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + id bar_left + status_command conky-i3bar + position top + font pango:Liberation Mono 10 + colors { + background $black_super + focused_background $black + focused_workspace $black_super $yellow_super $black + active_workspace $black_super $blue_super $black + inactive_workspace $black_super $black_super $white_super + urgent_workspace $black $red_super $white + } +} + +font pango:Liberation Mono 8 + +set $mod Mod1 -- 2.45.2