Fix tmuxswitcher

This commit is contained in:
Daniel Flanagan 2020-11-05 22:29:58 -06:00
parent 14de7c3ec5
commit b3460e92ce
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
9 changed files with 40 additions and 60 deletions

View File

@ -1,5 +1,5 @@
gesture swipe left 3 bspc desktop -f next
gesture swipe right 3 bspc desktop -f prev
# TODO: sway gestures?
gesture swipe left 3 swaymsg workspace back_and_forth
gesture swipe right 2 swaymsg seat seat0 cursor press BTN_EXTRA && swaymsg seat seat0 cursor release BTN_EXTRA
gesture swipe left 2 swaymsg seat seat0 cursor press BTN_SIDE && swaymsg seat seat0 cursor release BTN_SIDE

View File

@ -17,6 +17,17 @@ focus_follows_mouse no
input type:keyboard {
repeat_delay 200
repeat_rate 60
# I have a keyboard that takes care of this on my workstation, so we only enable
# this on laptops
# xkb_options ctrl:nocaps
}
input type:touchpad {
dwt enabled
tap enabled
natural_scroll enabled
middle_emulation enabled
pointer_accel 0.33
}
bindsym $mod+control+space exec makoctl dismiss
@ -151,4 +162,8 @@ bar {
swaybar_command waybar
}
include $ENV_PATH/sway/config.d/main
# TODO: exec_always?
exec gammastep -t 6500:3500 -l 39.0:-94.5
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'
include $HOME/.env/sway/config.d/main

View File

@ -166,3 +166,7 @@ end
# grep aliases
alias rg "rg --text"
alias grep "rg"
alias vim nvim
alias vi nvim

View File

@ -17,27 +17,15 @@ set -Ux TERMINAL kitty
set -Ux BROWSER firefox-developer-edition
set -Ux ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" # iex history
set -Ux LESS "-r"
# set our EDITOR to neovim if we've got it
set -Ux EDITOR vim
if has_command nvim
set -Ux EDITOR nvim
set -Ux MANPAGER 'env MANWIDTH="" nvim --cmd "let g:prosession_on_startup=0" +Man!'
end
alias ovim 'command vim' # always have an alias to normal vim just in case
alias vim $EDITOR
alias vi $EDITOR
# more sane ls colors
set -Ux LS_COLORS 'ow=01;36;40'
set -Ux LS_COLORS 'ow=01;36;40' # more sane ls colors
set -Ux EDITOR nvim
set -Ux MANPAGER 'env MANWIDTH="" nvim --cmd "let g:prosession_on_startup=0" +Man!'
has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'
test -f ~/.fzf/shell/key-bindings.fish && source ~/.fzf/shell/key-bindings.fish
function fish_greeting
fortune
end
function fish_greeting; fortune; end
# we assume the user uses "$HOME" to just store their mess of dotfiles and other
# nonsense that clutters it up and that they have a preferred starting
@ -53,21 +41,14 @@ else if test -f /opt/asdf-vm/asdf.fish
source /opt/asdf-vm/asdf.fish
end
# load a per-device config last so anything can be overridden
if set -q $__HM_SESS_VARS_SOURCED; and test -f $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
exec bash -c "source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh; exec fish"
end
# load a per-device, secret config last so anything can be overridden
for cf in config.fish .hidden/config.fish
set f $ENV_PATH/$cf
test -f $f && source $f
end
mkdir -p $NOTES_PATH $USER_LOGS_PATH $SCROTS_PATH
# start a tmux session by default if possible and we're not already in
# a terminal multiplexer
if has_command tmux && string match -v -q '*tmux*' $TERM && string match -v -q '*screen*' $TERM
tmux start-server
tmux attach -t default || tmux new -s default
end
if set -q $__HM_SESS_VARS_SOURCED; and test -f $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
exec bash -c "source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh; exec fish"
end

View File

@ -9,6 +9,8 @@ fi
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../../" && pwd)
source "${dfp}/bin/lib/setup_helpers.bash"
cp "$dfp/apps/de/sway/dm-entry" "/usr/share/wayland-sessions/lsway.desktop"
links=(
# display manager files
"apps/de/sway/init" "/usr/bin/sway-lytedev"

View File

@ -1,9 +1,13 @@
#!/usr/bin/env sh
fmt='#{session_id}:|#S|(#{session_attached} attached)'
{ tmux display-message -p -F "$fmt" && tmux list-sessions -F "$fmt"; } \
t="tmux switch-client -t"
[ -z "$TMUX" ] && t="tmux attach-session -t"
sess="$({ tmux display-message -p -F "$fmt" && tmux list-sessions -F "$fmt"; } \
| awk '!seen[$1]++' \
| column -t -s'|' \
| fzf -q '$' --reverse --prompt 'switch session: ' -1 \
| cut -d':' -f1 \
| xargs tmux switch-client -t
| cut -d':' -f1)"
$t $sess

View File

@ -1,7 +0,0 @@
#!/usr/bin/env sh
nvim \
-c 'let nosession=1' \
-c 'silent setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile' \
"$@" \
-

View File

@ -1,5 +0,0 @@
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'

View File

@ -1,19 +1,5 @@
output eDP-1 res 1600x900 pos 0 0
exec libinput-gestures -c $HOME/.config/dotfiles/apps/de/libinput/sway-gestures.conf
exec gammastep -t 6500:3500 -l 39.0:-94.5
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'
bindswitch lid:toggle exec swaylock
input type:touchpad {
dwt enabled
tap enabled
natural_scroll enabled
middle_emulation enabled
pointer_accel 0.33
}
input type:keyboard {
xkb_options ctrl:nocaps
}