UGGLP2Z2XCY6X4XWLDDBIOIZNN4EQKC7H2QYJ5M2TF2BPUCSVE7QC Z6EM4O5TOT3BHOIJUSRBNJVAKVRZZPCTFGKWFU6QFYDRDH5FF43QC 5VB62YJZQTMDVHWC2HRKTA4BQ6TKI4Y6C4EU2GGV4FLUI45XHKAAC D4RRJJZKJI4SMVZDHCUPII42M74W5CXTBW6JVN7D2KUB5ZOIYEXQC NSEVL5PUWABPDF6TBGKLP7DZBUU7TXRVMQ24AFSCOVE45WUV2NIAC E5TARAD4FR4LZYAV6HEF26ZNA2KXG6J22XTNY5W3WYQ6JQ4SWC3AC EQEPIEOA7HHF3ISH4GCI6HP3LUESO6MVQJBPQY5F66ONLSZKNLKQC 6RSYSQMBM2QWK2FM5T4IDMYHDH65GL2ARTVTUBIS3NKY5PLHSS4QC ZXML7PEJJPRZOH7J4QIAYD46GVYI5Q4QGOJFYAYRHNLO6T4E5IVAC if status --is-login; and not set -q SSH_CLIENT SSH_TTY
# # start wm## function wm## # disable on non login shells and remote# if not status --is-login; or set -q SSH_CLIENT SSH_TTY# echo "can't run here" >&2# return 1# end## # populate list# set -l sessions# for f in /usr/share/{wayland-,x}sessions/*.desktop# rg -q "^NoDisplay=true" $f; and continue# set bin (grep -m1 "^Exec=" $f | cut -d= -f2- | string split " ")[1]# command -q $bin; or continue# set -a sessions (string join \t (grep -m1 "^Name=" $f | cut -d= -f2-) $f)# end## # last first# if not set -q sessions[1]# echo "no wm found"# return# end# set -l ordered# for s in $sessions# if test (string split \t $s)[1] = "$wm_last"# set -p ordered $s# else# set -a ordered $s# end# end## # run# set sel (string join \n $ordered | fzf --with-nth=1 --delimiter=\t --inline-info)# if test -z "$sel"# echo "no wm selected"# return# else# set -U wm_last (string split \t $sel)[1]# end# set -l cmd (grep -m1 "^Exec=" (string split \t $sel)[2] | cut -d= -f2- | string split -n " ")# exec $cmd## end## if status --is-login; and not set -q SSH_CLIENT SSH_TTY## # display v# cat ~/.jrvieira/v.txt## # check dependencies# set -l missing# for dep in fzf rg# command -q $dep# or set -a missing $dep# end# if set -q missing[1]# echo "missing: $missing!" >&2# return 1# end## # greet# wm## end
# display vcat ~/.jrvieira/v.txt# check dependenciesset -l missingfor dep in fzf rgcommand -q $depor set -a missing $dependif set -q missing[1]echo "missing: $missing!" >&2return 1end# greetwmend
end# start wmfunction wm# disable on non login shells and remoteif not status --is-login; or set -q SSH_CLIENT SSH_TTYecho "can't run here" >&2return 1end# populate listset -l sessionsfor f in /usr/share/{wayland-,x}sessions/*.desktoprg -q "^NoDisplay=true" $f; and continueset bin (grep -m1 "^Exec=" $f | cut -d= -f2- | string split " ")[1]command -q $bin; or continueset -a sessions (string join \t (grep -m1 "^Name=" $f | cut -d= -f2-) $f)end# last firstif not set -q sessions[1]echo "no wm found"returnendset -l orderedfor s in $sessionsif test (string split \t $s)[1] = "$wm_last"set -p ordered $selseset -a ordered $sendend# runset sel (string join \n $ordered | fzf --with-nth=1 --delimiter=\t --inline-info)if test -z "$sel"echo "no wm selected"returnelseset -U wm_last (string split \t $sel)[1]endset -l cmd (grep -m1 "^Exec=" (string split \t $sel)[2] | cut -d= -f2- | string split -n " ")exec $cmd