Streamline i3/sway environment

This commit is contained in:
lhark 2019-08-26 01:42:21 +00:00
parent 4bf957240b
commit c8e4a1c6df
6 changed files with 381 additions and 109 deletions

View file

@ -0,0 +1,19 @@
## Base16 Gruvbox dark, pale
# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
set $base00 #262626
set $base01 #3a3a3a
set $base02 #4e4e4e
set $base03 #8a8a8a
set $base04 #949494
set $base05 #dab997
set $base06 #d5c4a1
set $base07 #ebdbb2
set $base08 #d75f5f
set $base09 #ff8700
set $base0A #ffaf00
set $base0B #afaf00
set $base0C #85ad85
set $base0D #83adad
set $base0E #d485ad
set $base0F #d65d0e

1
config/i3/colorscheme Symbolic link
View file

@ -0,0 +1 @@
base16-gruvbox-dark-pale

247
config/i3/common Normal file
View file

@ -0,0 +1,247 @@
#########################
# i3/sway common config #
#########################
### 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
# keycodes for number keys
set $key1 10
set $key2 11
set $key3 12
set $key4 13
set $key5 14
set $key6 15
set $key7 16
set $key8 17
set $key9 18
set $key0 19
# Workspaces names. Format: "index:name"
set $ws1 "1:mail"
set $ws2 "2:web"
set $ws3 "3:3"
set $ws4 "4:4"
set $ws5 "5:5"
set $ws6 "6:6"
set $ws7 "7:7"
set $ws8 "8:8"
set $ws9 "9:9"
set $ws10 "10:10"
# Your preferred terminal emulator
set $term kitty --single-instance
# Font for window titles and bar
font pango:Hack 8
# Remove borders
hide_edge_borders smart
# Remove window title
default_border pixel 1
# Base16 color config
include ./colorscheme
# Property Name Border BG Text Indicator Child Border
client.focused $base05 $base0D $base00 $base0D $base0D
client.focused_inactive $base01 $base01 $base05 $base03 $base01
client.unfocused $base01 $base00 $base05 $base01 $base01
client.urgent $base08 $base08 $base00 $base08 $base08
client.placeholder $base00 $base00 $base05 $base00 $base00
client.background $base07
### Key bindings
#
# Basics:
#
# start a terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+Shift+c kill
# start your launcher
bindsym $mod+r exec $menu
# call clipboard plumber
bindsym $mod+v exec cliplumber
# volume control
bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 1%- unmute
bindsym XF86AudioMute exec amixer -q set Master toggle
# lock session
bindsym Ctrl+Mod1+l exec $lock
# 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+r reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+x restart
# exit
bindsym $mod+Shift+e exec $exit
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right 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+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right 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
bindcode $mod+$key1 workspace $ws1
bindcode $mod+$key2 workspace $ws2
bindcode $mod+$key3 workspace $ws3
bindcode $mod+$key4 workspace $ws4
bindcode $mod+$key5 workspace $ws5
bindcode $mod+$key6 workspace $ws6
bindcode $mod+$key7 workspace $ws7
bindcode $mod+$key8 workspace $ws8
bindcode $mod+$key9 workspace $ws9
bindcode $mod+$key0 workspace $ws10
# move focused container to workspace
bindcode $mod+Shift+$key1 move container to workspace $ws1
bindcode $mod+Shift+$key2 move container to workspace $ws2
bindcode $mod+Shift+$key3 move container to workspace $ws3
bindcode $mod+Shift+$key4 move container to workspace $ws4
bindcode $mod+Shift+$key5 move container to workspace $ws5
bindcode $mod+Shift+$key6 move container to workspace $ws6
bindcode $mod+Shift+$key7 move container to workspace $ws7
bindcode $mod+Shift+$key8 move container to workspace $ws8
bindcode $mod+Shift+$key9 move container to workspace $ws9
bindcode $mod+Shift+$key0 move container to workspace $ws10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# 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+b splith
#bindsym $mod+v splitv
bindsym $mod+shift+v splith
bindsym $mod+ctrl+shift+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f 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+a focus parent
#
# 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
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Mnemonic: Dimension
bindsym $mod+d mode "resize"
# Fast resize
bindsym $mod+Ctrl+$left resize shrink width 5 px or 5 ppt
bindsym $mod+Ctrl+$down resize grow height 5 px or 5 ppt
bindsym $mod+Ctrl+$up resize shrink height 5 px or 5 ppt
bindsym $mod+Ctrl+$right resize grow width 5 px or 5 ppt
### Status Bar
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
#status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
status_command i3status
#colors {
# statusline #ffffff
# background #323232
# inactive_workspace #32323200 #32323200 #5c5c5c
#}
# Base16 colors for the statusbar
colors {
background $base00
separator $base04
statusline $base05
# State Border BG Text
focused_workspace $base05 $base0D $base00
active_workspace $base05 $base03 $base00
inactive_workspace $base03 $base01 $base05
urgent_workspace $base08 $base08 $base00
binding_mode $base00 $base0A $base00
}
strip_workspace_numbers yes
}

View file

@ -9,44 +9,13 @@
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Hack 8
# Remove borders
hide_edge_borders both
for_window [class=".*"] border pixel 1
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
include ./common
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec kitty --single-instance
# volume control
bindsym XF86AudioRaiseVolume exec amixer -q set Master 1%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 1%- unmute
bindsym XF86AudioMute exec amixer -q set Master toggle
# lock session
bindsym Ctrl+Mod1+l exec i3lock -c 000000
# kill focused window
bindsym $mod+Shift+c kill
set $lock i3lock -c 000000
set $menu dmenu_run
# start dmenu (a program launcher)
bindsym $mod+r exec dmenu_run
@ -107,85 +76,10 @@ bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1:mail"
set $ws2 "2:web"
set $ws3 "3:3"
set $ws4 "4:4"
set $ws5 "5:5"
set $ws6 "6:6"
set $ws7 "7:7"
set $ws8 "8:8"
set $ws9 "9:9"
set $ws10 "10:10"
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# reload the configuration file
bindsym $mod+x reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+x 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'"
bindsym $mod+Shift+e exec 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 windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows 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+r mode "default"
}
# Mnemonic: Dimension
bindsym $mod+d mode "resize"
# Fast resize
bindsym $mod+Ctrl+h resize shrink width 5 px or 5 ppt
bindsym $mod+Ctrl+j resize grow height 5 px or 5 ppt
bindsym $mod+Ctrl+k resize shrink height 5 px or 5 ppt
bindsym $mod+Ctrl+l resize grow width 5 px or 5 ppt
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {

53
config/i3status/config Normal file
View file

@ -0,0 +1,53 @@
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
interval = 5
}
order += "ipv6"
order += "wireless _first_"
order += "ethernet _first_"
order += "battery all"
order += "disk /"
order += "load"
order += "memory"
order += "tztime local"
wireless _first_ {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}
ethernet _first_ {
format_up = "E: %ip (%speed)"
format_down = "E: down"
}
battery all {
format = "%status %percentage %remaining"
}
disk "/" {
format = "%avail"
}
load {
format = "%1min"
}
memory {
format = "%used | %available"
threshold_degraded = "1G"
format_degraded = "MEMORY < %available"
}
tztime local {
format = "%Y-%m-%d %H:%M:%S"
}

58
config/sway/config Normal file
View file

@ -0,0 +1,58 @@
# Default config for sway
#
# Read `man 5 sway` for a complete reference.
# i3/sway common config
include ../i3/common
# Your preferred application launcher
# Note: it's recommended that you pass the final command to sway
set $menu dmenu_path | bemenu | xargs swaymsg exec --
# exit sway (logs you out of your Wayland session)
set $exit 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'
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# 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
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' \
# resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
# Set keyboard layout
input * xkb_layout fr,us
include /etc/sway/config.d/*