From c20c38ab319ea77724eab6c7e8d00fdc287256ac Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Thu, 31 Mar 2022 17:06:03 -0500 Subject: feat: add sway configs --- bash/.profile | 3 +- sway/.config/i3status-rust/config.toml | 36 +++++ sway/.config/sway/config | 200 ++++++++++++++++++++++++++++ sway/.config/yofi/yofi.config | 76 +++++++++++ wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh | 4 +- zsh/.zshenv | 3 +- 6 files changed, 318 insertions(+), 4 deletions(-) create mode 100644 sway/.config/i3status-rust/config.toml create mode 100644 sway/.config/sway/config create mode 100644 sway/.config/yofi/yofi.config diff --git a/bash/.profile b/bash/.profile index 4f08dc5..33b9553 100644 --- a/bash/.profile +++ b/bash/.profile @@ -10,7 +10,8 @@ export BASH_COMPLETION_USER_DIR="$XDG_DATA_HOME"/bash-completion/completions # Misc export EDITOR="$( command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v vi )" -export VISUAL="code --wait" +export BROWSER="firefox" +export TERMINAL="alacritty" export MANPAGER="sh -c 'col -bx | bat -l man -p'" export MANROFFOPT="-c" export GOPATH="$HOME"/.go diff --git a/sway/.config/i3status-rust/config.toml b/sway/.config/i3status-rust/config.toml new file mode 100644 index 0000000..8b08368 --- /dev/null +++ b/sway/.config/i3status-rust/config.toml @@ -0,0 +1,36 @@ +[[block]] +block = "disk_space" +path = "/" +alias = "/" +info_type = "available" +unit = "GB" +interval = 20 +warning = 20.0 +alert = 10.0 + +[[block]] +block = "memory" +display_type = "memory" +format_mem = "{mem_used_percents}" +format_swap = "{swap_used_percents}" + +[[block]] +block = "cpu" +interval = 1 + +[[block]] +block = "load" +interval = 1 +format = "{1m}" + +[[block]] +block = "sound" + +[[block]] +block = "time" +interval = 5 +format = "%a %d/%m %R" + +[[block]] +block = "battery" +if_command = "test -e /sys/class/power_supply/BAT0" \ No newline at end of file diff --git a/sway/.config/sway/config b/sway/.config/sway/config new file mode 100644 index 0000000..d216da9 --- /dev/null +++ b/sway/.config/sway/config @@ -0,0 +1,200 @@ +### Variables + +# Set logo key as main modifier +set $mod Mod4 +set $menu yofi apps | xargs swaymsg exec -- + +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l + +# Colors +set $foreground #c0caf5 +set $highlight #bb9af7 +set $wallpaper @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png +set $lock_cmd swaylock --daemonize --image $wallpaper +set $sleep_cmd systemctl suspend + +# Set color for focused window +client.focused $highlight $highlight $foreground + +### Output configuration + +# Set wallpaper +output * bg $wallpaper fill + +### Idle configuration + +# Lock the screen after 300 seconds of inactivity, then turn off +# all displays after another 300 seconds, and turn the screens back on when +# resumed. It will also lock the screen before the computer goes to sleep. +exec swayidle -w \ + timeout 900 '$lock_cmd' \ + timeout 1200 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + timeout 1800 '$sleep_cmd' \ + before-sleep '$lock_cmd' \ + lock '$lock_cmd' + +# Inhibit idle if a window is in fullscreen +for_window [shell=".*"] inhibit_idle fullscreen + +### Input configuration + +# Mouse +# Hide mouse cursor when not used +seat * hide_cursor 8000 + +# Touchpad +input type:touchpad { + tap enabled + natural_scroll enabled +} + +# Keyboard +input type:keyboard { + # Map caps lock to escape and use right alt as compose key to create umlauts + # To actually create them, type the following keys in a sequence: + # ralt + " + u --> ΓΌ + xkb_options caps:escape,compose:ralt +} + +### Key bindings + +# Exit sway +bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway?' -B 'Yes, exit sway' 'swaymsg exit' + +# App launcher +bindsym $mod+space exec $menu + +# Launch terminal +bindsym $mod+Return exec $TERMINAL + +# Launch browser +bindsym $mod+w exec $BROWSER + +# Take screenshots +bindsym Print exec grim "screenshot-$(date +'%F-%H-%M-%S').png" +bindsym Print+$mod exec grim -g "$(slurp)" "screenshot-$(date +'%F-%H-%M-%S').png" + +# Lock screen +bindsym $mod+ctrl+q exec loginctl lock-session + +# Media control +bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle +bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- +bindsym --locked XF86MonBrightnessUp exec brightnessctl set +5% +bindsym --locked XF86AudioPlay exec playerctl play-pause +bindsym --locked XF86AudioNext exec playerctl next +bindsym --locked XF86AudioPrev exec playerctl previous + +# Kill focused window +bindsym $mod+q kill + +# Reload the configuration file +bindsym $mod+Shift+c reload + +# Move focus 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 + +# 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 + +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 number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 +bindsym $mod+0 workspace number 10 +bindsym $mod+tab workspace back_and_forth + +# Move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number 1; workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2; workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3; workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4; workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5; workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6; workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7; workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8; workspace number 8 +bindsym $mod+Shift+9 move container to workspace number 9; workspace number 9 +bindsym $mod+Shift+0 move container to workspace number 10 + +# Splitting direction +bindsym $mod+b split toggle +bindsym $mod+- splith +bindsym $mod+\ splitv + +# Make current focus fullscreen +bindsym $mod+f fullscreen + +# Resizing containers +bindsym $mod+r mode 'resize' +mode 'resize' { + # Resizing 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 + + 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 Escape mode 'default' +} + +# +# Status Bar +# +bar { + swaybar_command i3status-rs ./.config/ +} + +# Hide window title bars and borders +default_border pixel +hide_edge_borders smart + +# Start notification daemon +# exec mako + +# Start display management daemon +# exec kanshi + +# Adjust color temperature to reduce eye strain +# exec gammastep -l '46.95:7.45' + +# Clipboard manager +# exec wl-paste --type text --watch clipman store +# bindsym $mod+v exec clipman pick --tool wofi + + +include @sysconfdir@/sway/config.d/* \ No newline at end of file diff --git a/sway/.config/yofi/yofi.config b/sway/.config/yofi/yofi.config new file mode 100644 index 0000000..b1a7f08 --- /dev/null +++ b/sway/.config/yofi/yofi.config @@ -0,0 +1,76 @@ +# Width/height of the app in pixels +width = 400 +height = 512 + +# If set forces usage of basic window instead of Layer Shell wayland protocol +force_window = false + +# if unset, renders window centered +# window_offsets = [500, -50] # in format [top_offset_pixels, left_offset_pixels] + +# font = "DejaVu Sans" +# or you may use an absolute path, e.g: +# font = "/usr/share/fonts/TTF/DejaVuSans.ttf" +font_size = 24 + +# Color of the app background +# Colors are specified in 0xRRGGBBAA format +bg_color = 0x272822ee +# Color for the fonts +# font_color = 0xf8f8f2ff + +# HiDPI scaling factor; default is requested from compositor but +# fractional values are truncated, so one may want to set it explicitly. +# scale = 3 + +# TOML sections are scope config values for a related blocks. +# This one for instance is for input field area. +[input_text] +# font = ... +font_color = 0xf8f8f2ff +bg_color = 0x75715eff + +# Margin/padding values are specified as in CSS but only in pixels. +# So it's either a single value for all directions +# or two values, the first for top/bottom and the second for left/right +# or finally four values for top, right, bottom and left directions respectively. +margin = "5" # equivalent to "5 5 5 5" +padding = "1.7 -4" # equivalent to "1.7 -4 1.7 -4" + +# Section for items in the search results area. +[list_items] +# font = ... +font_color = 0xf8f8f2ff + +# Font color for an item that currently selected +selected_font_color = 0xa6e22eff + +# if specified, search matches are emphasized with this color +match_color = 0xe69f66ff + +margin = "5 10" + +# If set to true hides the desktop actions +hide_actions = false +# Specify left margin for action line +action_left_margin = 60 + +# Additional spacing between list items. +# By default there's a space around 10 pixels +# the value can be reduced by specifying a negative value +item_spacing = 2 + +# Spacing between an icon and a text. +icon_spacing = 5 + +# Sections for the icons. When this section presents, icons are displayed +[icon] +# For now app only supports fixed sized icons and there's no icon up/down-scaling yet. +# More info: https://github.com/l4l/yofi/issues/76#issuecomment-1023631399 +size = 16 + +# For the icon search path +theme = "Adwaita" + +# If no icon found for an entry, this one will be used instead +fallback_icon_path = "/usr/share/icons/Adwaita/16x16/categories/applications-engineering-symbolic.symbolic.png" \ No newline at end of file diff --git a/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh b/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh index b692551..58f5cd9 100644 --- a/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh +++ b/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh @@ -7,9 +7,9 @@ WINHOME="/mnt/c/Users/$USER" mkdir -p /tmp/xdg -export BROWSER=wslview -export EDITOR="code --wait" export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0 +export VISUAL="code --wait" +export BROWSER=wslview export XDG_RUNTIME_DIR=/tmp/xdg export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock" export GPG_AGENT_SOCK="$HOME/.gnupg/S.gpg-agent" diff --git a/zsh/.zshenv b/zsh/.zshenv index 4f08dc5..33b9553 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -10,7 +10,8 @@ export BASH_COMPLETION_USER_DIR="$XDG_DATA_HOME"/bash-completion/completions # Misc export EDITOR="$( command -v nvim 2>/dev/null || command -v vim 2>/dev/null || command -v vi )" -export VISUAL="code --wait" +export BROWSER="firefox" +export TERMINAL="alacritty" export MANPAGER="sh -c 'col -bx | bat -l man -p'" export MANROFFOPT="-c" export GOPATH="$HOME"/.go -- cgit v1.2.3-70-g09d2