代码拉取完成,页面将自动刷新
import os
def update_tmux_conf(hexcode):
tmux_conf_path = os.path.expanduser("~/.dotfiles/config/tmux/tmux.conf")
with open(tmux_conf_path, "r") as f:
lines = f.readlines()
with open(tmux_conf_path, "w") as f:
for line in lines:
if line.strip().startswith("set -g background"):
f.write(f"set -g background {hexcode}\n")
else:
f.write(line)
def update_kitty_conf(hexcode):
kitty_conf_path = os.path.expanduser("~/.dotfiles/config/kitty/current-theme.conf")
with open(kitty_conf_path, "r") as f:
lines = f.readlines()
with open(kitty_conf_path, "w") as f:
for line in lines:
if line.strip().startswith("background "):
f.write(f"background {hexcode}\n")
else:
f.write(line)
if __name__ == "__main__":
hexcode = input("new background hexcode:")
update_tmux_conf(hexcode)
update_kitty_conf(hexcode)
print("config file updated!")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。