From 43ea87724c41ce7eac6261fae5d600f97228f0de Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Wed, 8 Jan 2020 16:29:30 +0100 Subject: [PATCH] Run sway from shell. Use physlock to lock screen --- .config/sway/config | 49 ++++++++++++++++++++++++++++++++++++++++----- .zshrc | 22 +++++++++++++------- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index 892aa13..fbf3916 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,3 +1,11 @@ +set $lock physlock -ms -p "$(toilet -t -f bigmono12 Shelman Group)" +set $mod Mod4 + + +set $left h +set $down j +set $up k +set $right l input "1739:30383:DELL08AF:00_06CB:76AF_Touchpad" { tap enabled @@ -43,14 +51,38 @@ bindsym Mod4+Return exec alacritty bindsym Mod4+Shift+Return exec env DARKMODE=true alacritty --config-file=/home/dln/.config/alacritty/alacritty-dark.yml bindsym Mod4+Control+Return exec alacritty --config-file=/home/dln/.config/alacritty/alacritty-tiny.yaml bindsym Mod4+p exec rofi -font "Roboto Mono 10" -show run -bindsym Mod4+l exec swaylock -s center -c 000000 -i /home/dln/.config/sway/lock.png +bindsym Mod4+l exec $lock bindsym Mod4+space exec makoctl dismiss -a bindsym Mod4+print exec grim -g "$(slurp)" - | wl-copy +bindsym Mod4+Shift+minus move scratchpad +bindsym Mod4+minus scratchpad show floating_modifier Mod4 bindsym Mod4+Shift+f floating toggle bindsym Mod4+f focus mode_toggle +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 20px + bindsym $down resize grow height 20px + bindsym $up resize shrink height 20px + bindsym $right resize grow width 20px + + # Ditto, with arrow keys + bindsym Left resize shrink width 20px + bindsym Down resize grow height 20px + bindsym Up resize shrink height 20px + bindsym Right resize grow width 20px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + hide_edge_borders both smart_borders on default_border none @@ -65,15 +97,22 @@ bar { mode overlay font "IBM Plex Sans Condensed 23" separator_symbol | - gaps 0 2 2 3490 + gaps 0 0 0 3490 height 50 colors { - statusline #333333 - background #ffffffdd + statusline #999999 + background #212121 } } seat seat0 xcursor_theme Bibata_Oil 48 output "eDP-1" scale 1 -output "eDP-1" background #cccccc solid_color +output "eDP-1" background #000000 solid_color + +# Screen lock +exec swayidle \ + timeout 600 '$lock' \ + timeout 900 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep '$lock' diff --git a/.zshrc b/.zshrc index cf65c50..f99aeba 100644 --- a/.zshrc +++ b/.zshrc @@ -11,7 +11,6 @@ export PATH=$HOME/bin:$PATH:/bin:/sbin:/usr/sbin:/usr/local/sbin export EDITOR=nvim #export DISPLAY=:0 -export GDK_SCALE=1.5 export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock fpath=(~/.zsh/functions $fpath) @@ -157,7 +156,7 @@ function prompt_command { if [[ "${TMUX}" != "" ]]; then if [[ "${HOST}" = "lilbub" ]]; then tmux set -g status-fg "#ffebee" - tmux set -g status-bg "#b71c1c" + tmux set -g status-bg "#212121" tmux set -g status-left '#[bg=#E53935,fg=#ffebee] #I #[default] ' fi fi @@ -238,7 +237,7 @@ export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket e () { - tmux select-window -t1 + tmux select-window -t1 nvr --remote $(readlink -f "$@") } @@ -265,9 +264,6 @@ export FLUX_FORWARD_NAMESPACE=flux [ -f /usr/share/bash-completion/completions/aws ] && source /usr/share/bash-completion/completions/aws [ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc -# Pager -command -v pygmentize >/dev/null 2>&1 && export LESSOPEN="|/usr/bin/pygmentize -f terminal16m -O style=native %s" - ## Aliases alias ag='ag --pager less' alias cdiff='colordiff -u' @@ -278,12 +274,17 @@ alias lower="tr '[:upper:]' '[:lower:]'" alias pstree="pstree -Auh | less" alias tail='tail -n $LINES' alias timestamp='TZ=Z date "+%Y%m%dT%H%M%SZ"' -alias tree='tree -C' +alias tree='exa -T' alias upper="tr '[:lower:]' '[:upper:]'" alias vimdiff='vimdiff -R' alias vim=nvim alias xc='xclip -selection clipboard' +## Wayland +export QT_QPA_PLATFORM=wayland +export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" +export _JAVA_AWT_WM_NONREPARENTING=1 + ## Bazel export BAZEL_PYTHON=python2 @@ -297,5 +298,12 @@ export ANSIBLE_NOCOWS=1 ## Rust export PATH=$HOME/.cargo/bin:$PATH +## GTK +export GDK_SCALE=1.5 +export GTK_THEME=Adwaita:dark + [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then + XKB_DEFAULT_LAYOUT=us exec sway +fi