minor fix

This commit is contained in:
js0ny 2025-02-23 19:52:23 +00:00
parent bf26d5ed56
commit 48a93e2998
21 changed files with 515 additions and 2785 deletions

View file

@ -0,0 +1,43 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Append Electron argument (for wayland) to *.desktop files
import argparse
import configparser
import os
APPEND_ARG_FILE = "~/.dotfiles/platforms/linux/electron-flags.conf"
with open(os.path.expanduser(APPEND_ARG_FILE)) as f:
APPEND_ARGS = list(map(str.strip, f.readlines()))
# for file in desktop_files:
# config = configparser.ConfigParser()
# config.read(file)
def append_arg(file):
config = configparser.ConfigParser()
config.read(file)
try:
exec_line = config["Desktop Entry"].get("Exec")
except KeyError:
print(f"Skipping {file} as it does not have an Exec key")
return
print(f"Appending {APPEND_ARGS} to {exec_line}")
config["Desktop Entry"].update({"Exec": f"{exec_line} {' '.join(APPEND_ARGS)}"})
with open(file, "w") as f:
config.write(f)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", help="Desktop file to modify")
args = parser.parse_args()
append_arg(args.file)
pass
if __name__ == "__main__":
main()

View file

@ -1,16 +1,3 @@
# $DOTFILES/platforms/linux/chromium-flags.conf
# Date: 2025-01-25
# Author: js0ny
# Force chromium apps to use kwallet6 for password storage
# This solves the issue of chromium apps not being able to access passwords in non-plasma environments
# Location:
# ~/.config/chromium-flags.conf (for chromium)
# ~/.config/chrome-flags.conf
# ~/.var/app/com.vivaldi.Vivaldi/config/vivaldi-flags.conf (For flatpak)
# ~/.config/vivaldi-stable.conf (For ArchLinux vivaldi)
# Linking:
# ln -sf $DOTFILES/platforms/linux/chromium-flags.conf ~/.var/app/com.vivaldi.Vivaldi/config/vivaldi-flags.conf
--UseOzonePlatform=wayland
--ozone-platform=wayland
--password-store=kwallet6

View file

@ -1,17 +1,4 @@
# $DOTFILES/platforms/linux/hyprland/electron-flags.conf
# Date: 2024-12-22
# Author: js0ny
# Force electron apps to use Wayland
# Location:
# ~/.config/electron-flags.conf
# ~/.config/code-flags.conf
# Linking:
# ln -sf $DOTFILES/platforms/linux/electron-flags.conf ~/.config/electron-flags.conf
# ln -sf $DOTFILES/platforms/linux/electron-flags.conf ~/.config/code-flags.conf
# --enable-features=UseOzonePlatform
# --ozone-platform=wayland
# --enable-icd
--enable-features=WaylandWindowDecorations
--enable-features=UseOzonePlatform
--ozone-platform-hint=auto
--enable-wayland-ime

View file

@ -1,4 +1,8 @@
# vim:ft=bash
# This should be in
# ~/.bash_aliases
# or in if antidots and wheel
# ~/.config/bash/bash_aliases
if command -v zoxide > /dev/null ; then
eval "$(zoxide init bash)"
# Relative navigation #

View file

@ -1,4 +1,7 @@
# If no admin rights, just
# vim:ft=bash
# If wheel and antidots:
# ln -sf $DOTFILES/tools/bash/profile ~/.config/bash/bashrc
# If not wheel or antidots:
# ln -sf $DOTFILES/tools/bash/bashrc ~/.bashrc
export DOTFILES=$HOME/.dotfiles

View file

@ -1,2 +1,3 @@
#:vim: set ft=bash:
test -f $HOME/.config/bash/bashrc && source $HOME/.config/bash/bashrc
test -f $HOME/.bashrc && source $HOME/.bashrc

View file

@ -1,3 +1,4 @@
# vim:ft=bash
# Put this file in $XDG_CONFIG_HOME/bash/profile
# This file is sourced by /etc/profile.d/xdg-compat.sh
# and will source user's XDG-compliant Bash Run Commands

View file

@ -356,7 +356,7 @@ mapkey(",s", "Toggle Sidebar", function () {
var btn = qs("div.ds-icon-button");
btn[0].click();
}, { domain: /chat.deepseek.com/ });
mapkey(",e", "Edit last input", function () {
mapkey(",e", "[e]dit last input", function () {
var btn = qs("div.ds-icon-button");
btn[btn.length - 5].click();
}, { domain: /chat.deepseek.com/ });
@ -368,14 +368,14 @@ mapkey(",r", "[r]egenerate last output", function () {
var btn = qs("div.ds-icon-button");
btn[btn.length - 3].click();
}, { domain: /chat.deepseek.com/ });
mapkey(",n", "New Chat", function () {
mapkey(",n", "[n]ew Chat", function () {
window.location.href = "https://chat.deepseek.com/";
}, { domain: /chat.deepseek.com/ });
mapkey(",t", "Toggle Thinking (R1)", function () {
mapkey(",t", "Toggle co[t](R1)", function () {
var btns = qs("div.ds-button");
btns[0].click();
}, { domain: /chat.deepseek.com/ });
mapkey(",w", "Toggle Web Search", function () {
mapkey(",w", "Toggle [w]eb Search", function () {
var btns = qs("div.ds-button");
btns[1].click();
}, { domain: /chat.deepseek.com/ });
@ -481,7 +481,7 @@ mapkey(",y", "[y]ank app id", function () {
const id = url.pathname.split("/")[2];
Clipboard.write(id);
}, { domain: /apps.microsoft.com/ });
//#endregion
// #region perplexity.ai
/**

View file

@ -4,7 +4,7 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("e4a702e262c3e3501dfe25091621fe12cd63c7845221687e36a79e17cf3a67e0" "456697e914823ee45365b843c89fbc79191fdbaff471b29aad9dcbe0ee1d5641" "3c08da65265d80a7c8fc99fe51df3697d0fa6786a58a477a1b22887b4f116f62" "df6dfd55673f40364b1970440f0b0cb8ba7149282cf415b81aaad2d98b0f0290" "0325a6b5eea7e5febae709dab35ec8648908af12cf2d2b569bedc8da0a3a81c1" "d6b934330450d9de1112cbb7617eaf929244d192c4ffb1b9e6b63ad574784aad" "56044c5a9cc45b6ec45c0eb28df100d3f0a576f18eef33ff8ff5d32bac2d9700" "2b501400e19b1dd09d8b3708cefcb5227fda580754051a24e8abf3aff0601f87" default)))
'("5c7720c63b729140ed88cf35413f36c728ab7c70f8cd8422d9ee1cedeb618de5" "e4a702e262c3e3501dfe25091621fe12cd63c7845221687e36a79e17cf3a67e0" "456697e914823ee45365b843c89fbc79191fdbaff471b29aad9dcbe0ee1d5641" "3c08da65265d80a7c8fc99fe51df3697d0fa6786a58a477a1b22887b4f116f62" "df6dfd55673f40364b1970440f0b0cb8ba7149282cf415b81aaad2d98b0f0290" "0325a6b5eea7e5febae709dab35ec8648908af12cf2d2b569bedc8da0a3a81c1" "d6b934330450d9de1112cbb7617eaf929244d192c4ffb1b9e6b63ad574784aad" "56044c5a9cc45b6ec45c0eb28df100d3f0a576f18eef33ff8ff5d32bac2d9700" "2b501400e19b1dd09d8b3708cefcb5227fda580754051a24e8abf3aff0601f87" default)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View file

@ -153,7 +153,13 @@
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +roam2 +pomodoro +dragndrop) ; organize your plain life in plain text
(org ; organize your plain life in plain text
+pomodoro
+dragndrop
+noter
+pandoc
+pretty
)
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more

View file

@ -1,7 +1,7 @@
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/OrgFiles/")
(setq org-roam-directory "~/OrgFiles/roam/")
;; (setq org-roam-directory "~/OrgFiles/roam/")
(after! org
;; For CJK users
@ -29,9 +29,10 @@
;; Keymaps
(map! :map org-mode-map
"C-c b" (lambda () (interactive) (my/insert-emphasis-with-zws ?*))
"C-c i" (lambda () (interactive) (my/insert-emphasis-with-zws ?/))
"C-c u" (lambda () (interactive) (my/insert-emphasis-with-zws ?_))
:desc "Bold with ZWS" "C-c b" (lambda () (interactive) (my/insert-emphasis-with-zws ?*))
:desc "Italic with ZWS" "C-c i" (lambda () (interactive) (my/insert-emphasis-with-zws ?/))
:desc "Underline with ZWS" "C-c u" (lambda () (interactive) (my/insert-emphasis-with-zws ?_))
:desc "Code with ZWS" "C-c c" (lambda () (interactive) (my/insert-emphasis-with-zws ?~))
:nvom "N" 'org-next-visible-heading
:nvom "E" 'org-previous-visible-heading
:nvom "M-n" 'org-metadown
@ -54,9 +55,12 @@
)
(after! org-agenda
(setq org-agenda-files (directory-files-recursively "~/OrgFiles/tasks/" "\\.org$"))
;; (setq org-agenda-files (directory-files-recursively "~/OrgFiles/tasks/" "\\.org$"))
(setq org-agenda-files (list (concat org-directory "tasks/")))
)
(map! :leader :desc "Org Agenda" "A" #'org-agenda)
(map! :after org-agenda
:map evil-org-agenda-mode-map
:m "n" #'org-agenda-next-line
@ -67,11 +71,3 @@
:m "E" #'org-agenda-priority-down
:m "i" #'evil-forward-char)
;; (use-package! org-download
;; :after org
;; :custom
;; (setq org-download-screenshot-method
;; "pwsh.exe -File 'D:\\script.ps1'")
;; )

View file

@ -162,3 +162,7 @@ end
test -d /opt/miniconda3 && source /opt/miniconda3/etc/fish/conf.d/conda.fish
test -f /opt/miniconda3/etc/fish/conf.d/conda.fish && source /opt/miniconda3/etc/fish/conf.d/conda.fish
# User-specific PATH
test -d $HOME/.local/scripts && fish_add_path $HOME/.local/scripts
test -d $HOME/.local/build && fish_add_path $HOME/.local/build

View file

@ -52,7 +52,6 @@ abbr --add ii open
abbr --add v nvim
abbr --add c code
alias sv="sudo vim -u ~/.dotfiles/common/vim.noxdg.vimrc"
alias sn="sudo nvim -u ~/.config/nvim/init.lua"
# Dev #
abbr --add py python3

View file

@ -0,0 +1,85 @@
# vim:ft=kitty
# Customized
background_opacity 0.75
background_blur 1
## name: Catppuccin-Mocha
## author: Pocco81 (https://github.com/Pocco81)
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #CDD6F4
background #1E1E2E
selection_foreground #1E1E2E
selection_background #F5E0DC
# Cursor colors
cursor #F5E0DC
cursor_text_color #1E1E2E
# URL underline color when hovering with mouse
url_color #F5E0DC
# Kitty window border colors
active_border_color #B4BEFE
inactive_border_color #6C7086
bell_border_color #F9E2AF
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #11111B
active_tab_background #CBA6F7
inactive_tab_foreground #CDD6F4
inactive_tab_background #181825
tab_bar_background #11111B
# Colors for marks (marked text in the terminal)
mark1_foreground #1E1E2E
mark1_background #B4BEFE
mark2_foreground #1E1E2E
mark2_background #CBA6F7
mark3_foreground #1E1E2E
mark3_background #74C7EC
# The 16 terminal colors
# black
color0 #45475A
color8 #585B70
# red
color1 #F38BA8
color9 #F38BA8
# green
color2 #A6E3A1
color10 #A6E3A1
# yellow
color3 #F9E2AF
color11 #F9E2AF
# blue
color4 #89B4FA
color12 #89B4FA
# magenta
color5 #F5C2E7
color13 #F5C2E7
# cyan
color6 #94E2D5
color14 #94E2D5
# white
color7 #BAC2DE
color15 #A6ADC8

View file

@ -0,0 +1,80 @@
# vim:ft=kitty
## name: Catppuccin-Mocha
## author: Pocco81 (https://github.com/Pocco81)
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #CDD6F4
background #1E1E2E
selection_foreground #1E1E2E
selection_background #F5E0DC
# Cursor colors
cursor #F5E0DC
cursor_text_color #1E1E2E
# URL underline color when hovering with mouse
url_color #F5E0DC
# Kitty window border colors
active_border_color #B4BEFE
inactive_border_color #6C7086
bell_border_color #F9E2AF
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #11111B
active_tab_background #CBA6F7
inactive_tab_foreground #CDD6F4
inactive_tab_background #181825
tab_bar_background #11111B
# Colors for marks (marked text in the terminal)
mark1_foreground #1E1E2E
mark1_background #B4BEFE
mark2_foreground #1E1E2E
mark2_background #CBA6F7
mark3_foreground #1E1E2E
mark3_background #74C7EC
# The 16 terminal colors
# black
color0 #45475A
color8 #585B70
# red
color1 #F38BA8
color9 #F38BA8
# green
color2 #A6E3A1
color10 #A6E3A1
# yellow
color3 #F9E2AF
color11 #F9E2AF
# blue
color4 #89B4FA
color12 #89B4FA
# magenta
color5 #F5C2E7
color13 #F5C2E7
# cyan
color6 #94E2D5
color14 #94E2D5
# white
color7 #BAC2DE
color15 #A6ADC8

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,80 @@
# vim:ft=kitty
## name: Catppuccin-Latte
## author: Pocco81 (https://github.com/Pocco81)
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/latte.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #4C4F69
background #EFF1F5
selection_foreground #EFF1F5
selection_background #DC8A78
# Cursor colors
cursor #DC8A78
cursor_text_color #EFF1F5
# URL underline color when hovering with mouse
url_color #DC8A78
# Kitty window border colors
active_border_color #7287FD
inactive_border_color #9CA0B0
bell_border_color #DF8E1D
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #EFF1F5
active_tab_background #8839EF
inactive_tab_foreground #4C4F69
inactive_tab_background #9CA0B0
tab_bar_background #BCC0CC
# Colors for marks (marked text in the terminal)
mark1_foreground #EFF1F5
mark1_background #7287fD
mark2_foreground #EFF1F5
mark2_background #8839EF
mark3_foreground #EFF1F5
mark3_background #209FB5
# The 16 terminal colors
# black
color0 #5C5F77
color8 #6C6F85
# red
color1 #D20F39
color9 #D20F39
# green
color2 #40A02B
color10 #40A02B
# yellow
color3 #DF8E1D
color11 #DF8E1D
# blue
color4 #1E66F5
color12 #1E66F5
# magenta
color5 #EA76CB
color13 #EA76CB
# cyan
color6 #179299
color14 #179299
# white
color7 #ACB0BE
color15 #BCC0CC

103
tools/kitty/window.py Normal file
View file

@ -0,0 +1,103 @@
# https://github.com/sxyazi/dotfiles
from kittens.tui.handler import result_handler
directions = {
"top": "u",
"bottom": "e",
"left": "n",
"right": "i",
}
def main(args):
pass
@result_handler(no_ui=True)
def handle_result(args, answer, target_window_id, boss):
window = boss.active_window
if window is None:
return
cmd = window.child.foreground_cmdline[0]
act = args[1] # e.g. -jump
if act[0] == "-" and cmd[-4:] == "nvim":
second = directions[args[2]] if len(args) > 2 else ""
window.write_to_child(f"\x1b[119;8u{act[1]}{second}")
return
if (act == "-close" or act == "-quit") and cmd[-7:] == "joshuto":
window.write_to_child(f"\x1b{act[1]}")
return
def split(direction):
if direction == "top" or direction == "bottom":
boss.launch("--cwd=current", "--location=hsplit")
else:
boss.launch("--cwd=current", "--location=vsplit")
if direction == "top" or direction == "left":
boss.active_tab.move_window(direction)
def close():
boss.close_window()
def quit():
boss.quit()
def jump(direction):
boss.active_tab.neighboring_window(direction)
# https://github.com/chancez/dotfiles/blob/master/kitty/.config/kitty/relative_resize.py
def resize(direction):
neighbors = boss.active_tab.current_layout.neighbors_for_window(
window, boss.active_tab.windows
)
top, bottom = neighbors.get("top"), neighbors.get("bottom")
left, right = neighbors.get("left"), neighbors.get("right")
if direction == "top":
if top and bottom:
boss.active_tab.resize_window("shorter", 10)
elif top:
boss.active_tab.resize_window("taller", 10)
elif bottom:
boss.active_tab.resize_window("shorter", 10)
elif direction == "bottom":
if top and bottom:
boss.active_tab.resize_window("taller", 10)
elif top:
boss.active_tab.resize_window("shorter", 10)
elif bottom:
boss.active_tab.resize_window("taller", 10)
elif direction == "left":
if left and right:
boss.active_tab.resize_window("narrower", 10)
elif left:
boss.active_tab.resize_window("wider", 10)
elif right:
boss.active_tab.resize_window("narrower", 10)
elif direction == "right":
if left and right:
boss.active_tab.resize_window("wider", 10)
elif left:
boss.active_tab.resize_window("narrower", 10)
elif right:
boss.active_tab.resize_window("wider", 10)
def move(direction):
boss.active_tab.move_window(direction)
act = act[1:]
if act == "split":
split(args[2])
elif act == "close":
close()
elif act == "quit":
quit()
elif act == "jump":
jump(args[2])
elif act == "resize":
resize(args[2])
elif act == "move":
move(args[2])

View file

@ -1,36 +1,10 @@
-- This file *currently* contains the colorscheme for lualine (status line)
local M = {}
-- Mocha
M.scheme = {
rosewater = "#f5e0dc",
flamingo = "#f2cdcd",
pink = "#f5c2e7",
mauve = "#cba6f7",
red = "#f38ba8",
maroon = "#eba0ac",
peach = "#fab387",
yellow = "#f9e2af",
green = "#a6e3a1",
teal = "#94e2d5",
sky = "#89dceb",
sapphire = "#74c7ec",
blue = "#89b4fa",
lavender = "#b4befe",
text = "#cdd6f4",
subtext1 = "#bac2de",
subtext0 = "#a6adc8",
overlay2 = "#9399b2",
overlay1 = "#7f849c",
overlay0 = "#6c7086",
surface2 = "#585b70",
surface1 = "#45475a",
surface0 = "#313244",
base = "#1e1e2e",
mantle = "#181825",
crust = "#11111b",
}
M.accent = M.scheme.pink
-- TODO: Change the palatte when the colorscheme changes
M.scheme = require("catppuccin.palettes.mocha")
M.accent = M.scheme.lavender
M.mode = {
n = M.scheme.sky,

View file

@ -36,7 +36,9 @@ M.cmp_nvim_keymaps = require("keymaps.cmp_map")
-- })
-- which-key.nvim
if vim.g.loaded_which_key then
require("keymaps.which")
end
require("keymaps.visual-multi")
return M

View file

@ -3,7 +3,7 @@ return {
config = function()
require("telescope").setup({
defaults = {
prompt_prefix = "",
prompt_prefix = require("config.icons").telescope,
selection_caret = " ",
entry_prefix = " ",
layout_config = { -- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvchad/configs/telescope.lua