mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2025-01-01 15:39:20 +00:00
Fancy press to exit
This commit is contained in:
parent
f6f3244e54
commit
65dc8d158d
1 changed files with 10 additions and 10 deletions
|
@ -20,7 +20,7 @@ def cap_live_lines(command, **kwargs):
|
||||||
|
|
||||||
|
|
||||||
def press_to_exit():
|
def press_to_exit():
|
||||||
getpass("Exit")
|
getpass("\n<<-<>===EXIT===<>->>")
|
||||||
|
|
||||||
|
|
||||||
def update_rpm_ostree():
|
def update_rpm_ostree():
|
||||||
|
@ -40,6 +40,13 @@ def update_flatpak():
|
||||||
press_to_exit()
|
press_to_exit()
|
||||||
|
|
||||||
|
|
||||||
|
def update_cargo():
|
||||||
|
lines = cap_live_lines("cargo install-update -a")
|
||||||
|
|
||||||
|
if "no packages need updating" not in lines[-2].lower():
|
||||||
|
press_to_exit()
|
||||||
|
|
||||||
|
|
||||||
def update_pipx():
|
def update_pipx():
|
||||||
lines = cap_live_lines("pipx upgrade-all --include-injected")
|
lines = cap_live_lines("pipx upgrade-all --include-injected")
|
||||||
|
|
||||||
|
@ -51,24 +58,17 @@ def update_nvim():
|
||||||
run('nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"')
|
run('nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"')
|
||||||
|
|
||||||
|
|
||||||
def update_cargo():
|
|
||||||
lines = cap_live_lines("cargo install-update -a")
|
|
||||||
|
|
||||||
if "no packages need updating" not in lines[-2].lower():
|
|
||||||
press_to_exit()
|
|
||||||
|
|
||||||
|
|
||||||
def main(input):
|
def main(input):
|
||||||
if input == "rpm-ostree":
|
if input == "rpm-ostree":
|
||||||
update_rpm_ostree()
|
update_rpm_ostree()
|
||||||
elif input == "flatpak":
|
elif input == "flatpak":
|
||||||
update_flatpak()
|
update_flatpak()
|
||||||
elif input == "nvim":
|
|
||||||
update_nvim()
|
|
||||||
elif input == "cargo":
|
elif input == "cargo":
|
||||||
update_cargo()
|
update_cargo()
|
||||||
elif input == "pipx":
|
elif input == "pipx":
|
||||||
update_pipx()
|
update_pipx()
|
||||||
|
elif input == "nvim":
|
||||||
|
update_nvim()
|
||||||
else:
|
else:
|
||||||
print(f"Input {input} not valid!")
|
print(f"Input {input} not valid!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue