chore: kde-neon -> linux, kitty themes + settings, install-script fixes

This commit is contained in:
Pratik Tripathy
2024-09-18 00:06:56 +05:30
parent 42b8551ef1
commit 90084f4780
15 changed files with 175 additions and 80 deletions

View File

@@ -1,39 +0,0 @@
# set PATH so it includes user's private bin if it exists
[ ! -d "$HOME/bin" ] || PATH="$HOME/bin:$PATH"
# set PATH so it includes user's private bin if it exists
[ ! -d "$HOME/.local/bin" ] || PATH="$HOME/.local/bin:$PATH"
# Set the config directory enviroment variable
[ ! -z "$XDG_CONFIG_HOME" ] || export XDG_CONFIG_HOME="$HOME/.config"
# Set the cache directory enviroment variable
[ ! -z "$XDG_CACHE_HOME" ] || export XDG_CACHE_HOME="$HOME/.cache"
# Set the data directory enviroment variable
[ ! -z "$XDG_DATA_HOME" ] || export XDG_DATA_HOME="$HOME/.local/share"
# Set the state directory enviroment variable
[ ! -z "$XDG_STATE_HOME" ] || export XDG_STATE_HOME="$HOME/.local/state"
##################################################################################
EDITOR=$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null)
VISUAL=$EDITOR
# Manually follow steps from https://steamcommunity.com/app/646570/discussions/1/3935537639868400686
# To disable ~/.oracle_jre_usage/ from being created
# Source aliases
[ ! -f "$XDG_CONFIG_HOME/shell/aliases" ] || source "$XDG_CONFIG_HOME/shell/aliases"
[ ! -f "$XDG_CONFIG_HOME/shell/aliases_personal" ] || source "$XDG_CONFIG_HOME/shell/aliases_personal"
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
export LESSHISTFILE="$XDG_STATE_HOME/shell/lesshst"
export WGET_HSTS_FILE="$XDG_STATE_HOME/shell/wget-hsts-history" # wget aliased to use this path
# Setup Python
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
command -v pyenv >/dev/null && export PATH="$PATH:$PYENV_ROOT/bin"
command -v pyenv >/dev/null && eval "$(pyenv init -)"
export PYTHON_HISTORY="$XDG_STATE_HOME/shell/python_history" # will be picked up by Python 3.13+

View File

@@ -0,0 +1,61 @@
# vim:ft=kitty
## name: GitHub Dark Dimmed
## author: GitHub
## license: MIT
#: The basic colors
foreground #adbac7
background #22272e
selection_foreground #22272e
selection_background #539bf5
#: Cursor colors
cursor #539bf5
#: Tab bar colors
tab_bar_background #1c2128
active_tab_foreground #adbac7
active_tab_background #22272e
inactive_tab_foreground #768390
inactive_tab_background #1c2128
#: The basic 16 colors
#: black
color0 #545d68
color8 #636e7b
#: red
color1 #f47067
color9 #ff938a
#: green
color2 #57ab5a
color10 #6bc46d
#: yellow
color3 #c69026
color11 #daaa3f
#: blue
color4 #539bf5
color12 #6cb6ff
#: magenta
color5 #b083f0
color13 #dcbdfb
#: cyan
color6 #39c5cf
color14 #56d4dd
#: white
color7 #909dab
color15 #cdd9e5

View File

@@ -0,0 +1,47 @@
import re
from kittens.tui.handler import result_handler
from kitty.key_encoding import KeyEvent, parse_shortcut
def is_window_vim(window, vim_id):
fp = window.child.foreground_processes
return any(re.search(vim_id, p['cmdline'][0] if len(p['cmdline']) else '', re.I) for p in fp)
def encode_key_mapping(window, key_mapping):
mods, key = parse_shortcut(key_mapping)
event = KeyEvent(
mods=mods,
key=key,
shift=bool(mods & 1),
alt=bool(mods & 2),
ctrl=bool(mods & 4),
super=bool(mods & 8),
hyper=bool(mods & 16),
meta=bool(mods & 32),
).as_window_system_event()
return window.encoded_key(event)
def main():
pass
@result_handler(no_ui=True)
def handle_result(args, result, target_window_id, boss):
direction = args[1]
key_mapping = args[2]
vim_id = args[3] if len(args) > 3 else "n?vim"
window = boss.window_id_map.get(target_window_id)
if window is None:
return
if is_window_vim(window, vim_id):
for keymap in key_mapping.split(">"):
encoded = encode_key_mapping(window, keymap)
window.write_to_child(encoded)
else:
boss.active_tab.neighboring_window(direction)