diff --git a/phillpc/fish/config.fish b/phillpc/fish/config.fish index 2597012..308c962 100644 --- a/phillpc/fish/config.fish +++ b/phillpc/fish/config.fish @@ -2,35 +2,32 @@ set -gx EDITOR nvim set -gx VISUAL nvim -# Better defaults set -gx PAGER less set -gx LESS "-R --use-color -Dd+r -Du+b" -# XDG paths set -gx XDG_CONFIG_HOME "$HOME/.config" set -gx XDG_DATA_HOME "$HOME/.local/share" set -gx XDG_CACHE_HOME "$HOME/.cache" -# Local binaries fish_add_path "$HOME/.local/bin" fish_add_path "$HOME/.cargo/bin" -# Wayland-friendly defaults -set -gx MOZ_ENABLE_WAYLAND 1 -set -gx QT_QPA_PLATFORM wayland -set -gx SDL_VIDEODRIVER wayland -set -gx CLUTTER_BACKEND wayland - -# Fish behavior set fish_greeting -# Vi-style bindings -fish_vi_key_bindings +if type -q eza + alias ls="eza --icons" + alias ll="eza -lah --icons --git" + alias la="eza -A --icons" +else + alias ls="ls --color=auto" + alias ll="ls -lah" + alias la="ls -A" +end + +if type -q bat + alias cat="bat" +end -# Useful aliases -alias ls="ls --color=auto" -alias ll="ls -lah" -alias la="ls -A" alias grep="grep --color=auto" alias c="clear" @@ -48,9 +45,15 @@ alias pacin="sudo pacman -S" alias pacrm="sudo pacman -Rns" alias pacq="pacman -Qs" -alias ls="eza --icons" -alias ll="eza -lah --icons --git" -alias cat="bat" +# Safer defaults +alias cp="cp -i" +alias mv="mv -i" +alias rm="rm -i" + +# Optional tools +if type -q thefuck + thefuck --alias | source +end if type -q zoxide zoxide init fish | source @@ -60,18 +63,18 @@ if type -q fzf fzf --fish | source end -# Safer defaults -alias cp="cp -i" -alias mv="mv -i" -alias rm="rm -i" - -# Starship prompt if type -q starship starship init fish | source end +# Start Sway on tty1 login +# +# These are real environment variables. They are inherited by Sway because +# Fish execs Sway after exporting them. if status is-login - and test -z "$WAYLAND_DISPLAY" - and test "$XDG_VTNR" = "1" - exec sway + if test -z "$TMUX"; and test -z "$DISPLAY"; and test -z "$WAYLAND_DISPLAY" + if test (tty) = /dev/tty1 + exec sway + end + end end diff --git a/phillpc/mako/mako b/phillpc/mako/mako new file mode 120000 index 0000000..0910ef1 --- /dev/null +++ b/phillpc/mako/mako @@ -0,0 +1 @@ +/home/phill/.dotfiles/phillpc/mako \ No newline at end of file diff --git a/phillpc/nvim/init.lua b/phillpc/nvim/init.lua index af8551c..7875e4a 100644 --- a/phillpc/nvim/init.lua +++ b/phillpc/nvim/init.lua @@ -322,6 +322,7 @@ vim.lsp.enable({ "lua_ls", "pyright", "gopls", + "rust_analyzer", }) vim.api.nvim_create_autocmd("LspAttach", { diff --git a/phillpc/sway/config b/phillpc/sway/config index 6d65eea..637142b 100644 --- a/phillpc/sway/config +++ b/phillpc/sway/config @@ -6,7 +6,7 @@ set $up k set $right l set $term alacritty -set $menu bemenu-run -b -i --fn "Hack Nerd Font 10" --prompt "Run:" --list "8 up" +set $menu bemenu-run -b -i --fn "Hack Nerd Font 10" --prompt "Run:" --list "8 up" set $b00 #141415 set $b01 #1c1c24 @@ -36,28 +36,24 @@ client.background $b00 for_window [floating] border pixel 2 -exec_always swaybg -c $b00 +# Prefer native Sway background handling over repeatedly spawning swaybg. +output * bg #000000 solid_color bar { - colors { - focused_workspace $b01 $b01 $b05 - } - swaybar_command waybar + swaybar_command waybar } +### Input/output input type:keyboard { - xkb_layout "us" + xkb_layout us } output HDMI-A-1 resolution 2560x1440 pos 0 0 +output * adaptive_sync on workspace 1 output HDMI-A-1 - workspace_auto_back_and_forth yes -bindsym $mod+Tab workspace back_and_forth - -output * adaptive_sync on ### Key bindings bindsym $mod+Return exec $term @@ -66,6 +62,8 @@ bindsym $mod+Space exec $menu bindsym $mod+Shift+c reload bindsym $mod+Shift+e exec swaymsg exit +bindsym $mod+Tab workspace back_and_forth + bindsym $mod+$left focus left bindsym $mod+$down focus down bindsym $mod+$up focus up @@ -116,8 +114,16 @@ bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURC bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ +### Screenshots bindsym $mod+Shift+p exec grim -g "$(slurp)" - | wl-copy bindsym $mod+p exec grim - | wl-copy +### Autostart +# +# If Steam behaves weirdly under forced Wayland env vars, the Fish config below +# should fix that by not forcing SDL/QT globally. +exec steam +exec spotify-launcher -exec_always dbus-update-activation-environment --systemd WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway +exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway +exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP