Compare commits
7 commits
3407d87191
...
a5b4ab1037
Author | SHA1 | Date | |
---|---|---|---|
Peter Cai | a5b4ab1037 | ||
Peter Cai | a20adc9424 | ||
Peter Cai | 798d464dd8 | ||
Peter Cai | fb2e70ca5f | ||
Peter Cai | 2832406e8f | ||
Peter Cai | 35053b112b | ||
Peter Cai | 16f0cd2513 |
38
bash/.bashrc
38
bash/.bashrc
|
@ -14,11 +14,6 @@ export MACHINE_START_SWAY=false # Whether to start Sway from bash
|
|||
# Source machine-specific config
|
||||
[[ -f ~/.machine_config ]] && source ~/.machine_config
|
||||
|
||||
# Execute tmux in Alacritty
|
||||
if [[ "$TERM" == "alacritty" || "$TERM_PROGRAM" == "WezTerm" ]]; then
|
||||
exec tmux
|
||||
fi
|
||||
|
||||
# SSH without checking or adding host keys to known_hosts
|
||||
# Useful for cloud server rescue environment & installation
|
||||
alias sshtmp="ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no'"
|
||||
|
@ -107,6 +102,39 @@ function sshts() {
|
|||
_ssh $(tsselect)
|
||||
}
|
||||
|
||||
# SSH shorthands for WezTerm
|
||||
function assert_wezterm() {
|
||||
[ "$TERM_PROGRAM" == "WezTerm" ]
|
||||
}
|
||||
|
||||
# sshwez and sshmuxwez are used for spawning tabs in WezTerm
|
||||
# that uses its native multiplexer; this is useful for connecting
|
||||
# to home servers etc. and make use of WezTerm's native panes
|
||||
function sshwez() {
|
||||
assert_wezterm || return
|
||||
wezterm cli spawn --domain-name "SSH:$1"
|
||||
}
|
||||
|
||||
function sshmuxwez() {
|
||||
assert_wezterm || return
|
||||
wezterm cli spawn --domain-name "SSHMUX:$1"
|
||||
}
|
||||
|
||||
# moshwez{,ts,scrts} simply runs mosh inside a new WezTerm tab
|
||||
# Ideal for remote connections
|
||||
function moshwez() {
|
||||
assert_wezterm || return
|
||||
wezterm cli spawn -- mosh "$@"
|
||||
}
|
||||
|
||||
function moshwezts() {
|
||||
moshwez $(tsselect)
|
||||
}
|
||||
|
||||
function moshwezscrts() {
|
||||
moshwez $(tsselect) -- screen -RR -d
|
||||
}
|
||||
|
||||
# Add local to path
|
||||
export PATH="$PATH:~/.local/bin"
|
||||
|
||||
|
|
|
@ -277,6 +277,9 @@ for_window [app_id="pavucontrol"] floating enable
|
|||
# Makes service management a bit cleaner
|
||||
exec_always "systemctl --user import-environment; systemctl --user start sway-session.target"
|
||||
|
||||
# Import environment to D-Bus as well for xdg-desktop-portals etc
|
||||
exec_always dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
|
||||
|
||||
# Restart kanshi if it is running
|
||||
# This restores monitor configuration on reload
|
||||
exec_always "systemctl --user is-active kanshi && systemctl --user restart kanshi"
|
||||
|
|
|
@ -3,5 +3,41 @@ return {
|
|||
color_scheme = "Gruvbox dark, medium (base16)",
|
||||
font = wezterm.font("FiraCode Nerd Font Mono"),
|
||||
font_size = 10.5,
|
||||
enable_tab_bar = false, -- I use tmux
|
||||
enable_tab_bar = true,
|
||||
use_ime = true,
|
||||
scrollback_lines = 65536,
|
||||
tab_bar_at_bottom = true,
|
||||
window_padding = {
|
||||
top = '0.5cell',
|
||||
-- We already have the tab bar at bottom
|
||||
bottom = '0',
|
||||
left = '1cell',
|
||||
right = '1cell'
|
||||
},
|
||||
keys = {
|
||||
-- The default Ctrl+Tab conflicts with Sway
|
||||
{
|
||||
key = 'Tab',
|
||||
mods = 'SHIFT',
|
||||
action = wezterm.action.ActivateTabRelative(1),
|
||||
},
|
||||
-- Reload config forcibly
|
||||
{
|
||||
key = 'r',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.ReloadConfiguration,
|
||||
},
|
||||
-- Spawn panes in the **DEFAULT** domain
|
||||
-- to use the current domain, use Ctrl + Alt + Shift + " or %
|
||||
{
|
||||
key = '"',
|
||||
mods = 'CTRL|SUPER|ALT|SHIFT',
|
||||
action = wezterm.action.SplitVertical { domain = 'DefaultDomain' },
|
||||
},
|
||||
{
|
||||
key = '%',
|
||||
mods = 'CTRL|SUPER|ALT|SHIFT',
|
||||
action = wezterm.action.SplitHorizontal { domain = 'DefaultDomain' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue