Compare commits
No commits in common. "85e0bb62361a16ba0507c96b09d2a5802418498e" and "0e188ee0542f92222afc565782794b64c55cdc3a" have entirely different histories.
85e0bb6236
...
0e188ee054
5 changed files with 18 additions and 48 deletions
|
@ -1,15 +1,15 @@
|
||||||
#!/usr/bin/env nu
|
#!/usr/bin/env nu
|
||||||
|
|
||||||
use std log
|
use std log
|
||||||
|
|
||||||
def start-ssh-controller [host: string] {
|
def start-ssh-controller [host: string] {
|
||||||
log info $"initializing connection to ($host)"
|
log info "initializing connection to $host"
|
||||||
ssh -M -f -N $host
|
ssh -M -f -N $host
|
||||||
}
|
}
|
||||||
|
|
||||||
def is-null [ name: string, arg: any] {
|
def is-null [ name: string, arg: any] {
|
||||||
if $arg == null {
|
if $arg == null {
|
||||||
log error $"expected argument for --($name)"; exit 1
|
log error $"expected argument for --($name)"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ def is-null [ name: string, arg: any] {
|
||||||
|
|
||||||
# control background tunnels
|
# control background tunnels
|
||||||
# usage:
|
# usage:
|
||||||
# tunnel up -p 4321 computer
|
# tunnel up -p 4321 -h computer
|
||||||
# tunnel down computer
|
# tunnel down -h computer
|
||||||
def main [] {
|
def main [] {
|
||||||
print "use subcommands up/down to control ssh tunnels"
|
print "use subcommands up/down to control ssh tunnels"
|
||||||
help main
|
help main
|
||||||
|
@ -27,10 +27,11 @@ def main [] {
|
||||||
|
|
||||||
# activate ssh tunnel
|
# activate ssh tunnel
|
||||||
def "main up" [
|
def "main up" [
|
||||||
host: string # host name
|
--port: int # port number
|
||||||
--port: int # port number
|
--host: string # host name
|
||||||
] {
|
] {
|
||||||
is-null "port" $port
|
is-null "port" $port
|
||||||
|
is-null "host" $host
|
||||||
|
|
||||||
if (ssh -O check $host | complete).exit_code != 0 {
|
if (ssh -O check $host | complete).exit_code != 0 {
|
||||||
start-ssh-controller $host
|
start-ssh-controller $host
|
||||||
|
@ -40,24 +41,19 @@ def "main up" [
|
||||||
|
|
||||||
# shutdown ssh tunnels on host
|
# shutdown ssh tunnels on host
|
||||||
def "main down" [
|
def "main down" [
|
||||||
host: string # host name
|
--host: string # host name
|
||||||
] {
|
] {
|
||||||
log info $"exiting connection to ($host)"
|
is-null "host" $host
|
||||||
|
log info "exiting connection to $host"
|
||||||
ssh -O exit $host
|
ssh -O exit $host
|
||||||
}
|
}
|
||||||
|
|
||||||
def "main show" [] {
|
def "main show" [] {
|
||||||
let sockets = (
|
let sockets = ls ~/.ssh/ | where name =~ control | get name
|
||||||
ls ~/.ssh/
|
|
||||||
| where name =~ control
|
|
||||||
| get name
|
|
||||||
)
|
|
||||||
let n_sockets = $sockets | length
|
let n_sockets = $sockets | length
|
||||||
if $n_sockets > 0 {
|
if $n_sockets > 0 {
|
||||||
print $"($n_sockets) active connections"
|
print $"($n_sockets) active connections"
|
||||||
$sockets
|
$sockets | split column "-" | get column2
|
||||||
| split column "-"
|
|
||||||
| get column2
|
|
||||||
} else {
|
} else {
|
||||||
log info "no open connections"
|
log info "no open connections"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,4 @@
|
||||||
[Settings]
|
[Settings]
|
||||||
; gtk-icon-theme-name=breeze
|
; gtk-icon-theme-name=breeze
|
||||||
; gtk-theme-name=Catppuccin-Mocha-Standard-Rosewater-Dark
|
; gtk-theme-name=Catppuccin-Mocha-Standard-Rosewater-Dark
|
||||||
gtk-application-prefer-dark-theme=true
|
gtk-application-prefer-dark-theme=false
|
||||||
gtk-cursor-theme-name=Catppuccin-Mocha-Mauve-Cursors
|
|
||||||
gtk-cursor-theme-size=24
|
|
||||||
gtk-decoration-layout=icon:minimize,maximize,close
|
|
||||||
gtk-enable-animations=true
|
|
||||||
gtk-font-name=Noto Sans, 10
|
|
||||||
gtk-icon-theme-name=breeze
|
|
||||||
gtk-modules=colorreload-gtk-module
|
|
||||||
gtk-primary-button-warps-slider=true
|
|
||||||
gtk-sound-theme-name=ocean
|
|
||||||
gtk-xft-dpi=122880
|
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
# let kanshi handle it
|
# let kanshi handle it
|
||||||
monitor=,preferred,auto,1
|
monitor=,preferred,auto,1
|
||||||
|
|
||||||
env = NIXOS_OZONE_WL,1 # should this go somewhere else?
|
|
||||||
|
|
||||||
# Some default env vars.
|
# Some default env vars.
|
||||||
env = XCURSOR_SIZE,24
|
env = XCURSOR_SIZE,24
|
||||||
env = HYRPCURSOR_THEME,catppuccin-mocha-dark-cursors
|
env = HYRPCURSOR_THEME,catppuccin-mocha-dark-cursors
|
||||||
env = HYPRCURSOR_SIZE,24
|
env = HYPRCURSOR_SIZE,24
|
||||||
|
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
|
||||||
env = QT_QPA_PLATFORM,wayland
|
env = NIXOS_OZONE_WL,1 # should this go somewhere else?
|
||||||
# env = QT_QPA_PLATFORMTHEME,qt6ct
|
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
disable_logs = false
|
disable_logs = false
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
[Settings]
|
[Settings]
|
||||||
gtk-application-prefer-dark-theme=true
|
|
||||||
gtk-button-images=true
|
|
||||||
gtk-cursor-theme-name=Catppuccin-Mocha-Mauve-Cursors
|
|
||||||
gtk-cursor-theme-size=24
|
|
||||||
gtk-decoration-layout=icon:minimize,maximize,close
|
|
||||||
gtk-enable-animations=true
|
|
||||||
gtk-font-name=Noto Sans, 10
|
|
||||||
gtk-icon-theme-name=breeze
|
|
||||||
gtk-menu-images=true
|
|
||||||
gtk-modules=colorreload-gtk-module
|
|
||||||
gtk-primary-button-warps-slider=true
|
|
||||||
gtk-sound-theme-name=ocean
|
|
||||||
gtk-theme-name=Catppuccin-Mocha-Standard-Rosewater-Dark
|
gtk-theme-name=Catppuccin-Mocha-Standard-Rosewater-Dark
|
||||||
gtk-toolbar-style=3
|
gtk-application-prefer-dark-theme=false
|
||||||
gtk-xft-dpi=122880
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ is-tty || alias eza="${aliases[eza]:-eza} --icons"
|
||||||
alias ls='eza'
|
alias ls='eza'
|
||||||
alias la='eza -la'
|
alias la='eza -la'
|
||||||
alias l='eza -lb --git'
|
alias l='eza -lb --git'
|
||||||
# alias llm='eza -lbGd --git --sort=modified'
|
alias llm='eza -lbGd --git --sort=modified'
|
||||||
alias lx='eza -lbhHigUmuSa --time-style=long-iso --git --color-scale'
|
alias lx='eza -lbhHigUmuSa --time-style=long-iso --git --color-scale'
|
||||||
|
|
||||||
alias lS='eza -1'
|
alias lS='eza -1'
|
||||||
|
|
Loading…
Reference in a new issue