Initial commit.
This commit is contained in:
commit
fb9d04b7ef
28 changed files with 2359 additions and 0 deletions
72
.config/MangoHud/MangoHud.conf
Normal file
72
.config/MangoHud/MangoHud.conf
Normal file
|
@ -0,0 +1,72 @@
|
|||
### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless VSynced)
|
||||
fps_limit=0,30,60
|
||||
|
||||
### Display the current GPU information
|
||||
## Note: gpu_mem_clock also needs "vram" to be enabled
|
||||
gpu_stats
|
||||
gpu_temp
|
||||
gpu_core_clock
|
||||
gpu_mem_clock
|
||||
gpu_power
|
||||
gpu_text=GPU
|
||||
gpu_load_change
|
||||
gpu_load_value=60,90
|
||||
gpu_load_color=39F900,FDFD09,B22222
|
||||
|
||||
### Display the current CPU information
|
||||
cpu_stats
|
||||
cpu_temp
|
||||
# cpu_power
|
||||
cpu_text=CPU
|
||||
cpu_mhz
|
||||
cpu_load_change
|
||||
cpu_load_value=60,90
|
||||
cpu_load_color=39F900,FDFD09,B22222
|
||||
|
||||
### Display IO read and write for the app (not system)
|
||||
# io_stats
|
||||
io_read
|
||||
io_write
|
||||
|
||||
### Display system vram / ram / swap space usage
|
||||
vram
|
||||
ram
|
||||
swap
|
||||
|
||||
### Display FPS and frametime
|
||||
fps
|
||||
fps_sampling_period=1000
|
||||
fps_color_change
|
||||
fps_value=30,60
|
||||
fps_color=B22222,FDFD09,39F900
|
||||
frametime
|
||||
# frame_count
|
||||
|
||||
### Display miscellaneous information
|
||||
# engine_version
|
||||
gpu_name
|
||||
vulkan_driver
|
||||
# wine
|
||||
|
||||
### Display GameMode / vkBasalt running status
|
||||
gamemode
|
||||
# vkbasalt
|
||||
|
||||
### Display current FPS limit
|
||||
show_fps_limit
|
||||
|
||||
### Display the current resolution
|
||||
resolution
|
||||
|
||||
### Change the corner roundness
|
||||
round_corners=5
|
||||
|
||||
### Hud position offset
|
||||
offset_x=15
|
||||
offset_y=15
|
||||
|
||||
### Hud dimensions
|
||||
width=275
|
||||
# height=
|
||||
# table_columns=3
|
||||
# cellpadding_y=0
|
53
.config/X11/xinitrc
Normal file
53
.config/X11/xinitrc
Normal file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo ryzenadj-service --stapm-limit 35000 --fast-limit 35000 --slow-limit 35000 --slow-time 60 --stapm-time 1000 --tctl-temp 85 --vrmmax-current 70000 &>/dev/null &
|
||||
|
||||
userresources=$HOME/.config/X11/xresources
|
||||
usermodmap=$HOME/.Xmodmap
|
||||
sysresources=/etc/X11/xinit/.Xresources
|
||||
sysmodmap=/etc/X11/xinit/.Xmodmap
|
||||
|
||||
# merge in defaults and keymaps
|
||||
if [ -f $sysresources ]; then
|
||||
xrdb -merge $sysresources
|
||||
fi
|
||||
|
||||
if [ -f $sysmodmap ]; then
|
||||
xmodmap $sysmodmap
|
||||
fi
|
||||
|
||||
if [ -f "$userresources" ]; then
|
||||
xrdb -merge "$userresources"
|
||||
fi
|
||||
|
||||
if [ -f "$usermodmap" ]; then
|
||||
xmodmap "$usermodmap"
|
||||
fi
|
||||
|
||||
# start some nice programs
|
||||
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
||||
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
|
||||
# Setup monitor
|
||||
external-monitor.sh
|
||||
|
||||
# Fix mouse cursor
|
||||
xsetroot -cursor_name left_ptr
|
||||
|
||||
# Replace caps lock with escape
|
||||
setxkbmap -option caps:escape
|
||||
|
||||
# Set mouse settings
|
||||
mouse-settings
|
||||
|
||||
# Recompile xmonad
|
||||
xmonad --recompile
|
||||
|
||||
# Set wallpaper
|
||||
xwallpaper --zoom $HOME/pics/wallpaper.png
|
||||
|
||||
exec xmonad
|
9
.config/X11/xresources
Normal file
9
.config/X11/xresources
Normal file
|
@ -0,0 +1,9 @@
|
|||
! Fix hinting for fonts
|
||||
Xft.lcdfilter: lcddefault
|
||||
Xft.hintstyle: hintslight
|
||||
Xft.hinting: 1
|
||||
Xft.antialias: 1
|
||||
Xft.rgba: rgb
|
||||
|
||||
! Fix cursor
|
||||
Xcursor.theme: catppuccin-frappe-rosewater-cursors
|
86
.config/alacritty/alacritty.toml
Normal file
86
.config/alacritty/alacritty.toml
Normal file
|
@ -0,0 +1,86 @@
|
|||
[colors.primary]
|
||||
background = "#303446"
|
||||
foreground = "#c6d0f5"
|
||||
dim_foreground = "#838ba7"
|
||||
bright_foreground = "#c6d0f5"
|
||||
|
||||
[colors.cursor]
|
||||
text = "#303446"
|
||||
cursor = "#f2d5cf"
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
text = "#303446"
|
||||
cursor = "#babbf1"
|
||||
|
||||
[colors.search.matches]
|
||||
foreground = "#303446"
|
||||
background = "#a5adce"
|
||||
|
||||
[colors.search.focused_match]
|
||||
foreground = "#303446"
|
||||
background = "#a6d189"
|
||||
|
||||
[colors.footer_bar]
|
||||
foreground = "#303446"
|
||||
background = "#a5adce"
|
||||
|
||||
[colors.hints.start]
|
||||
foreground = "#303446"
|
||||
background = "#e5c890"
|
||||
|
||||
[colors.hints.end]
|
||||
foreground = "#303446"
|
||||
background = "#a5adce"
|
||||
|
||||
[colors.selection]
|
||||
text = "#303446"
|
||||
background = "#f2d5cf"
|
||||
|
||||
[colors.normal]
|
||||
black = "#51576d"
|
||||
red = "#e78284"
|
||||
green = "#a6d189"
|
||||
yellow = "#e5c890"
|
||||
blue = "#8caaee"
|
||||
magenta = "#f4b8e4"
|
||||
cyan = "#81c8be"
|
||||
white = "#b5bfe2"
|
||||
|
||||
[colors.bright]
|
||||
black = "#626880"
|
||||
red = "#e78284"
|
||||
green = "#a6d189"
|
||||
yellow = "#e5c890"
|
||||
blue = "#8caaee"
|
||||
magenta = "#f4b8e4"
|
||||
cyan = "#81c8be"
|
||||
white = "#a5adce"
|
||||
|
||||
[colors.dim]
|
||||
black = "#51576d"
|
||||
red = "#e78284"
|
||||
green = "#a6d189"
|
||||
yellow = "#e5c890"
|
||||
blue = "#8caaee"
|
||||
magenta = "#f4b8e4"
|
||||
cyan = "#81c8be"
|
||||
white = "#b5bfe2"
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = "#ef9f76"
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = "#f2d5cf"
|
||||
|
||||
[window]
|
||||
padding = { x = 5, y = 5 }
|
||||
dynamic_padding = true
|
||||
|
||||
[font]
|
||||
normal = { family = "Cascadia Code", style = "Regular" }
|
||||
bold = { family = "Cascadia Code", style = "Bold" }
|
||||
italic = { family = "Cascadia Code", style = "Italic" }
|
||||
bold_italic = { family = "Cascadia Code", style = "Bold Italic" }
|
||||
size = 11
|
22
.config/dunst/dunstrc
Normal file
22
.config/dunst/dunstrc
Normal file
|
@ -0,0 +1,22 @@
|
|||
[global]
|
||||
width = (0,300)
|
||||
height = (0,300)
|
||||
offset = 8x32
|
||||
frame_width = 2
|
||||
separator_color = frame
|
||||
font = Cascadia Code 12
|
||||
frame_color = "#8caaee"
|
||||
separator_color= frame
|
||||
|
||||
[urgency_low]
|
||||
background = "#303446"
|
||||
foreground = "#c6d0f5"
|
||||
|
||||
[urgency_normal]
|
||||
background = "#303446"
|
||||
foreground = "#c6d0f5"
|
||||
|
||||
[urgency_critical]
|
||||
background = "#303446"
|
||||
foreground = "#c6d0f5"
|
||||
frame_color = "#ef9f76"
|
80
.config/fsh/catppuccin-frappe.ini
Normal file
80
.config/fsh/catppuccin-frappe.ini
Normal file
|
@ -0,0 +1,80 @@
|
|||
[base]
|
||||
default = #c6d0f5
|
||||
unknown-token = #e78284,bold
|
||||
commandseparator = #81c8be
|
||||
redirection = #81c8be
|
||||
here-string-tri = #b5bfe2
|
||||
here-string-text = #b5bfe2
|
||||
here-string-var = #b5bfe2
|
||||
exec-descriptor = none
|
||||
comment = #737994
|
||||
correct-subtle = #babbf1
|
||||
incorrect-subtle = #ea999c
|
||||
subtle-separator = none
|
||||
subtle-bg = none
|
||||
secondary =
|
||||
recursive-base = #c6d0f5
|
||||
|
||||
[command-point]
|
||||
reserved-word = #ca9ee6
|
||||
subcommand = #85c1dc
|
||||
alias = #8caaee
|
||||
suffix-alias = #8caaee
|
||||
global-alias = #8caaee
|
||||
builtin = #ca9ee6
|
||||
function = #8caaee
|
||||
command = #8caaee
|
||||
precommand = #ca9ee6
|
||||
hashed-command = #8caaee
|
||||
single-sq-bracket = #e5c890
|
||||
double-sq-bracket = #e5c890
|
||||
double-paren = #a6d189
|
||||
|
||||
[paths]
|
||||
path = #f2d5cf
|
||||
pathseparator = #f2d5cf
|
||||
path-to-dir = #f2d5cf
|
||||
globbing = #f4b8e4
|
||||
globbing-ext = none
|
||||
|
||||
[brackets]
|
||||
paired-bracket = bold
|
||||
bracket-level-1 = #e78284
|
||||
bracket-level-2 = #e5c890
|
||||
bracket-level-3 = #85c1dc
|
||||
|
||||
[arguments]
|
||||
single-hyphen-option = #81c8be
|
||||
double-hyphen-option = #81c8be
|
||||
back-quoted-argument = #81c8be
|
||||
single-quoted-argument = #a6d189
|
||||
double-quoted-argument = #a6d189
|
||||
dollar-quoted-argument = #a6d189
|
||||
optarg-string = #a6d189
|
||||
optarg-number = #ef9f76
|
||||
|
||||
[in-string]
|
||||
back-dollar-quoted-argument = #ef9f76
|
||||
back-or-dollar-double-quoted-argument = #ef9f76
|
||||
|
||||
[other]
|
||||
variable = #ef9f76
|
||||
assign = none
|
||||
assign-array-bracket = none
|
||||
history-expansion = none
|
||||
|
||||
[math]
|
||||
mathvar = #f4b8e4
|
||||
mathnum = #ef9f76
|
||||
matherr = #e78284,bold
|
||||
|
||||
[for-loop]
|
||||
forvar = #c6d0f5
|
||||
fornum = #ef9f76
|
||||
foroper = #8caaee
|
||||
forsep = #8caaee
|
||||
|
||||
[case]
|
||||
case-input = #ef9f76
|
||||
case-parentheses = #949cbb
|
||||
case-condition = #ca9ee6
|
112
.config/gamemode.ini
Normal file
112
.config/gamemode.ini
Normal file
|
@ -0,0 +1,112 @@
|
|||
[general]
|
||||
; The reaper thread will check every 5 seconds for exited clients, for config file changes, and for the CPU/iGPU power balance
|
||||
reaper_freq=5
|
||||
|
||||
; The desired governor is used when entering GameMode instead of "performance"
|
||||
desiredgov=performance
|
||||
; The default governor is used when leaving GameMode instead of restoring the original value
|
||||
;defaultgov=powersave
|
||||
|
||||
; The iGPU desired governor is used when the integrated GPU is under heavy load
|
||||
igpu_desiredgov=powersave
|
||||
; Threshold to use to decide when the integrated GPU is under heavy load.
|
||||
; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the
|
||||
; integraged GPU is under heavy enough load to justify switching to
|
||||
; igpu_desiredgov. Set this to -1 to disable all iGPU checking and always
|
||||
; use desiredgov for games.
|
||||
igpu_power_threshold=-1
|
||||
|
||||
; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
|
||||
; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
|
||||
; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
|
||||
softrealtime=off
|
||||
|
||||
; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
|
||||
; will be negated and applied as a nice value (0 means no change). Defaults to 0.
|
||||
; To use this feature, the user must be added to the gamemode group (and then rebooted):
|
||||
; sudo usermod -aG gamemode $(whoami)
|
||||
renice=10
|
||||
|
||||
; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
|
||||
; between 0 and 7 here (with 0 being highest priority), or one of the special values
|
||||
; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
|
||||
; currently, only the best-effort class is supported thus you cannot set it here
|
||||
ioprio=0
|
||||
|
||||
; Sets whether gamemode will inhibit the screensaver when active
|
||||
; Defaults to 1
|
||||
inhibit_screensaver=1
|
||||
|
||||
; Sets whether gamemode will disable split lock mitigation when active
|
||||
; Defaults to 1
|
||||
disable_splitlock=1
|
||||
|
||||
[filter]
|
||||
; If "whitelist" entry has a value(s)
|
||||
; gamemode will reject anything not in the whitelist
|
||||
;whitelist=RiseOfTheTombRaider
|
||||
|
||||
; Gamemode will always reject anything in the blacklist
|
||||
;blacklist=HalfLife3
|
||||
; glxgears
|
||||
|
||||
[gpu]
|
||||
; Here Be Dragons!
|
||||
; Warning: Use these settings at your own risk
|
||||
; Any damage to hardware incurred due to this feature is your responsibility and yours alone
|
||||
; It is also highly recommended you try these settings out first manually to find the sweet spots
|
||||
|
||||
; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
|
||||
;apply_gpu_optimisations=0
|
||||
|
||||
; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
|
||||
;gpu_device=0
|
||||
|
||||
; Nvidia specific settings
|
||||
; Requires the coolbits extension activated in nvidia-xconfig
|
||||
; This corresponds to the desired GPUPowerMizerMode
|
||||
; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
|
||||
; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
|
||||
;nv_powermizer_mode=1
|
||||
|
||||
; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
|
||||
; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
|
||||
;nv_core_clock_mhz_offset=0
|
||||
;nv_mem_clock_mhz_offset=0
|
||||
|
||||
; AMD specific settings
|
||||
; Requires a relatively up to date AMDGPU kernel module
|
||||
; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
|
||||
; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
|
||||
; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
|
||||
;amd_performance_level=high
|
||||
|
||||
[cpu]
|
||||
; Parking or Pinning can be enabled with either "yes", "true" or "1" and disabled with "no", "false" or "0".
|
||||
; Either can also be set to a specific list of cores to park or pin, comma separated list where "-" denotes
|
||||
; a range. E.g "park_cores=1,8-15" would park cores 1 and 8 to 15.
|
||||
; The default is uncommented is to disable parking but enable pinning. If either is enabled the code will
|
||||
; currently only properly autodetect Ryzen 7900x3d, 7950x3d and Intel CPU:s with E- and P-cores.
|
||||
;park_cores=no
|
||||
;pin_cores=yes
|
||||
|
||||
[supervisor]
|
||||
; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
|
||||
; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
|
||||
;supervisor_whitelist=
|
||||
;supervisor_blacklist=
|
||||
|
||||
; In case you want to allow a supervisor to take full control of gamemode, this option can be set
|
||||
; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
|
||||
;require_supervisor=0
|
||||
|
||||
[custom]
|
||||
; Custom scripts (executed using the shell) when gamemode starts and ends
|
||||
start=notify-send "GameMode started"
|
||||
; /home/me/bin/stop_foldingathome.sh
|
||||
|
||||
end=notify-send "GameMode ended"
|
||||
; /home/me/bin/start_foldingathome.sh
|
||||
|
||||
; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
|
||||
;script_timeout=10
|
27
.config/mpv/mpv.conf
Normal file
27
.config/mpv/mpv.conf
Normal file
|
@ -0,0 +1,27 @@
|
|||
# multiple codecs with the easiest to run being prefered and vp9 disabled with limit to 1080p and 60 fps
|
||||
ytdl-format=bestvideo[height<=?1080][fps<=?60][vcodec!=?vp9]+bestaudio/best
|
||||
# THIS OPTIONS ACTUALLY FORCES VP9 OUT, FUCK YEA
|
||||
ytdl-raw-options=extractor-args="youtube:player-client=android"
|
||||
# fullscreen and show window immediatly
|
||||
fs
|
||||
force-window=immediate
|
||||
# making playback be as smooth as possible f**k quility
|
||||
scale=bilinear
|
||||
cscale=bilinear
|
||||
dscale=bilinear
|
||||
scale-antiring=0
|
||||
cscale-antiring=0
|
||||
dither-depth=no
|
||||
correct-downscaling=no
|
||||
sigmoid-upscaling=no
|
||||
deband=no
|
||||
# hwdec=auto
|
||||
# gpu-api=vulkan
|
||||
# vo=gpu-next
|
||||
# nice screenshots
|
||||
screenshot-template="%F - [%P]v%#01n"
|
||||
|
||||
# Subtitles loading on crack
|
||||
sub-file-paths=Subs;subs
|
||||
sub-auto=all
|
||||
slang=english,eng,en
|
10
.config/picom/picom.conf
Normal file
10
.config/picom/picom.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
shadow = false;
|
||||
fading = false;
|
||||
|
||||
inactive-opacity = 1;
|
||||
frame-opacity = 1.0;
|
||||
inactive-opacity-override = false;
|
||||
|
||||
corner-radius = 0;
|
||||
|
||||
vsync = false;
|
190
.config/qutebrowser/config.py
Normal file
190
.config/qutebrowser/config.py
Normal file
|
@ -0,0 +1,190 @@
|
|||
import catppuccin
|
||||
|
||||
# pylint: disable=C0111
|
||||
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
|
||||
from qutebrowser.config.config import ConfigContainer # noqa: F401
|
||||
|
||||
# fmt: off
|
||||
config: ConfigAPI = config # type: ConfigAPI # noqa: F821 pylint: disable=E0602,C0103 # pyright: ignore
|
||||
c: ConfigContainer = c # type: ConfigContainer # noqa: F821 pylint: disable=E0602,C0103 # pyright: ignore
|
||||
# fmt: on
|
||||
|
||||
# load autoconfig values
|
||||
config.load_autoconfig()
|
||||
|
||||
# load catppuccin theme
|
||||
catppuccin.setup(c, "Machiatto", True)
|
||||
|
||||
# load custom configs
|
||||
config.source("pyconfig/redirectors.py")
|
||||
|
||||
##-- Dark Mode Settings --##
|
||||
c.colors.webpage.preferred_color_scheme = "dark"
|
||||
c.colors.webpage.darkmode.enabled = True
|
||||
c.colors.webpage.bg = "black"
|
||||
c.colors.webpage.darkmode.algorithm = "lightness-cielab"
|
||||
c.colors.webpage.darkmode.threshold.foreground = 150
|
||||
c.colors.webpage.darkmode.threshold.background = 100
|
||||
c.colors.webpage.darkmode.policy.images = "never"
|
||||
# c.colors.webpage.darkmode.grayscale.images = 0.35
|
||||
|
||||
# change startpage and default page
|
||||
c.url.start_pages = ["https://startpage.cronyakatsuki.xyz"]
|
||||
c.url.default_page = "https://startpage.cronyakatsuki.xyz"
|
||||
|
||||
# search engines
|
||||
c.url.searchengines = {
|
||||
"DEFAULT": "https://searx.cronyakatsuki.xyz/?q={}",
|
||||
"aw": "https://wiki.archlinux.org/?search={}",
|
||||
"re": "https://www.reddit.com/r/{}",
|
||||
"w": "https://en.wikipedia.org/wiki/{}",
|
||||
"y": "https://www.youtube.com/results?search_query={}",
|
||||
}
|
||||
|
||||
##-- Fingerprinting settings --##
|
||||
c.content.headers.user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.3"
|
||||
c.content.headers.accept_language = "en-US,en;q=0.5"
|
||||
c.content.headers.custom = {
|
||||
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
||||
}
|
||||
c.content.canvas_reading = False
|
||||
c.content.webgl = False
|
||||
c.content.webrtc_ip_handling_policy = "default-public-interface-only"
|
||||
c.content.geolocation = False
|
||||
c.content.javascript.enabled = False
|
||||
c.content.notifications.enabled = False
|
||||
c.content.cookies.accept = "never"
|
||||
c.content.private_browsing = False
|
||||
|
||||
##-- AdBLock Settings --##
|
||||
c.content.blocking.method = "both"
|
||||
c.content.blocking.adblock.lists = [
|
||||
"https://easylist.to/easylist/easylist.txt",
|
||||
"https://easylist.to/easylist/easyprivacy.txt",
|
||||
"https://secure.fanboy.co.nz/fanboy-annoyance.txt",
|
||||
"https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt",
|
||||
"https://www.i-dont-care-about-cookies.eu/abp/",
|
||||
]
|
||||
|
||||
|
||||
# History disable
|
||||
c.completion.web_history.max_items = 0
|
||||
c.completion.cmd_history_max_items = 0
|
||||
|
||||
##-- Devtool Settings --##
|
||||
with config.pattern("chrome-devtools://*") as s:
|
||||
s.content.cookies.accept = "all"
|
||||
s.content.images = True
|
||||
s.content.javascript.enabled = True
|
||||
|
||||
with config.pattern("devtools://*") as s:
|
||||
s.content.cookies.accept = "all"
|
||||
s.content.images = True
|
||||
s.content.javascript.enabled = True
|
||||
|
||||
with config.pattern("chrome://*/*") as s:
|
||||
s.content.javascript.enabled = True
|
||||
|
||||
with config.pattern("qute://*/*") as s:
|
||||
s.content.javascript.enabled = True
|
||||
|
||||
##-- Site settings --##
|
||||
with config.pattern("https://searx.cronyakatsuki.xyz/*") as s:
|
||||
s.content.cookies.accept = "all"
|
||||
with config.pattern("https://monkeytype.com") as s:
|
||||
s.content.javascript.enabled = True
|
||||
s.content.cookies.accept = "all"
|
||||
with config.pattern("https://piped.cronyakatsuki.xyz/*") as s:
|
||||
s.content.javascript.enabled = True
|
||||
s.content.cookies.accept = "all"
|
||||
|
||||
|
||||
##-- Aliases --##
|
||||
c.aliases = config.get("aliases")
|
||||
c.aliases["buku"] = "spawn --userscript buku"
|
||||
|
||||
##-- Bindings --##
|
||||
# launch with mpv
|
||||
config.bind(",m", "spawn mpv {url}")
|
||||
config.bind(",fm", "hint links spawn mpv {hint-url}")
|
||||
|
||||
# buku bundings
|
||||
config.bind("b", "buku open")
|
||||
config.bind("B", "buku open -t")
|
||||
config.bind(",ba", "buku add")
|
||||
config.bind(",be", "buku edit")
|
||||
config.bind(",bd", "buku delete")
|
||||
config.bind(",bfa", "hint links spawn --userscript buku add {hint-url}")
|
||||
|
||||
# yt-dlp
|
||||
config.bind(",y", "spawn --userscript yt-dlp")
|
||||
config.bind(",fy", "hint links userscript yt-dlp")
|
||||
|
||||
# search current selection
|
||||
config.bind(",fo", "open {primary}")
|
||||
config.bind(",fO", "open --tab {primary}")
|
||||
|
||||
# yank found url
|
||||
config.bind("yf", "hint links yank")
|
||||
|
||||
# fix escape
|
||||
config.bind(
|
||||
"<Escape>", "mode-leave ;; jseval -q document.activeElement.blur()", mode="insert"
|
||||
)
|
||||
|
||||
# fix scrolling
|
||||
config.bind("j", "jseval --quiet scrollHelper.scrollBy(50)")
|
||||
config.bind("k", "jseval --quiet scrollHelper.scrollBy(-50)")
|
||||
config.bind("<Ctrl-D>", "jseval --quiet scrollHelper.scrollPage(0.8)")
|
||||
config.bind("<Ctrl-U>", "jseval --quiet scrollHelper.scrollPage(-0.8)")
|
||||
config.bind("gg", "jseval --quiet scrollHelper.scrollTo(0)")
|
||||
config.bind("G", "jseval --quiet scrollHelper.scrollToPercent(100)")
|
||||
|
||||
# KeePassXC binding
|
||||
config.bind('pw', 'spawn --userscript qute-keepassxc --key crony@cronyakatsuki.xyz')
|
||||
|
||||
# remove clickbard and gdpr banners
|
||||
config.bind(
|
||||
"ek",
|
||||
"jseval (function () { "
|
||||
+ ' var i, elements = document.querySelectorAll("body *");'
|
||||
+ ""
|
||||
+ " for (i = 0; i < elements.length; i++) {"
|
||||
+ " var pos = getComputedStyle(elements[i]).position;"
|
||||
+ ' if (pos === "fixed" || pos == "sticky") {'
|
||||
+ " elements[i].parentNode.removeChild(elements[i]);"
|
||||
+ " }"
|
||||
+ " }"
|
||||
+ "})();",
|
||||
)
|
||||
|
||||
##-- Font Settings --##
|
||||
c.fonts.default_family = '"Dejavu Sans Mono"'
|
||||
c.fonts.default_size = "10pt"
|
||||
c.fonts.completion.entry = 'default_size "default_family"'
|
||||
c.fonts.debug_console = 'default_size "default_family"'
|
||||
c.fonts.prompts = "default_size default_family"
|
||||
c.fonts.statusbar = 'default_size "default_family"'
|
||||
|
||||
##-- FilePicker (nnn on crrack)--##
|
||||
fileselect_cmd = [
|
||||
"alacritty",
|
||||
"--class",
|
||||
"filepicker,filepicker",
|
||||
"-e",
|
||||
"tmux",
|
||||
"new",
|
||||
"-s",
|
||||
"filepicker",
|
||||
"env",
|
||||
"LC_COLLATE=C",
|
||||
"nnn",
|
||||
"-P",
|
||||
"p",
|
||||
"-p",
|
||||
"{}",
|
||||
]
|
||||
c.fileselect.handler = "external"
|
||||
c.fileselect.folder.command = fileselect_cmd
|
||||
c.fileselect.single_file.command = fileselect_cmd
|
||||
c.fileselect.multiple_files.command = fileselect_cmd
|
14
.config/qutebrowser/greasemonkey/darkmode-disable.js
Normal file
14
.config/qutebrowser/greasemonkey/darkmode-disable.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
// ==UserScript==
|
||||
// @name DarkMode Disable
|
||||
// @match https://monkeytype.com/*
|
||||
// @match https://nc.cronyakatsuki.xyz/*
|
||||
// @match https://company-mode.github.io/*
|
||||
// @match https://adventofcode.com/*
|
||||
// @match https://cronyakatsuki.xyz/qbt/*
|
||||
// @match https://www.keybr.com/*
|
||||
// ==/UserScript==
|
||||
|
||||
const meta = document.createElement("meta");
|
||||
meta.name = "color-scheme";
|
||||
meta.content = "dark light";
|
||||
document.head.appendChild(meta);
|
83
.config/qutebrowser/greasemonkey/scrollHelper.js
Normal file
83
.config/qutebrowser/greasemonkey/scrollHelper.js
Normal file
|
@ -0,0 +1,83 @@
|
|||
// ==UserScript==
|
||||
// @name Adds scrolling JS that can be used within QB to do smarter scrolling
|
||||
// @qute-js-world jseval
|
||||
// @run-at document-start
|
||||
// ==/UserScript==
|
||||
unsafeWindow.scrollHelper = (() => {
|
||||
const scrollableElemOverflowTypes = [
|
||||
'auto',
|
||||
'scroll',
|
||||
]
|
||||
|
||||
const getFocusedWindow = (nextElem) => {
|
||||
if (nextElem === null) return null
|
||||
if (nextElem === undefined) return getFocusedWindow(window.document.activeElement ?? null)
|
||||
return getFocusedWindow(nextElem.contentDocument?.activeElement ?? null) ?? nextElem.ownerDocument?.defaultView ?? null
|
||||
}
|
||||
|
||||
const getScrollMaxY = ({ document: { documentElement } }) => documentElement.scrollHeight - documentElement.clientHeight
|
||||
|
||||
const getWindowVisibleArea = ({ document: { documentElement } }) => documentElement.clientHeight * documentElement.clientWidth
|
||||
|
||||
const findVertScrollableWindow = () => {
|
||||
const focusedWindow = getFocusedWindow() ?? window
|
||||
if (getScrollMaxY(focusedWindow) > 0) return focusedWindow
|
||||
if (getScrollMaxY(window) > 0) return window
|
||||
|
||||
return Array
|
||||
.from(window.frames)
|
||||
.sort((x, y) => getWindowVisibleArea(y) - getWindowVisibleArea(x))
|
||||
.find((frame) => getScrollMaxY(frame) > 0) ?? window
|
||||
}
|
||||
|
||||
const getScrollTopMax = (elem) => elem.scrollHeight - elem.clientHeight
|
||||
const isElementVertScrollable = (element) => element.clientHeight !==0 &&
|
||||
scrollableElemOverflowTypes.includes(getComputedStyle(element).overflowY)
|
||||
|
||||
const findVertScrollableAncestor = (delta, nextElem) => {
|
||||
if (!(nextElem?.parentNode instanceof Element)) return nextElem
|
||||
|
||||
if (isElementVertScrollable(nextElem)) {
|
||||
if (delta < 0 && nextElem.scrollTop > 0) return nextElem
|
||||
if (delta > 0 && nextElem.scrollTop < getScrollTopMax(nextElem)) return nextElem
|
||||
if (delta === 0 && getScrollTopMax(nextElem) > 0) return nextElem
|
||||
}
|
||||
|
||||
return findVertScrollableAncestor(delta, nextElem.parentNode)
|
||||
}
|
||||
|
||||
const getSelectionElem = () => {
|
||||
const selection = getFocusedWindow().getSelection()
|
||||
return selection.rangeCount !== 0
|
||||
? selection.getRangeAt(0).startContainer
|
||||
: null
|
||||
}
|
||||
|
||||
const getParentIfNotElement = (maybeElement) => maybeElement instanceof Element ? maybeElement : maybeElement?.parentNode
|
||||
|
||||
const findVertScrollable = (delta = 0) => {
|
||||
const selectionScrollableElem = findVertScrollableAncestor(delta, getParentIfNotElement(getSelectionElem()))
|
||||
if (selectionScrollableElem instanceof Element) return selectionScrollableElem
|
||||
|
||||
const scrollableDoc = findVertScrollableWindow().document
|
||||
const scrollableElem = scrollableDoc.body || scrollableDoc.getElementsByTagName('body')[0] || scrollableDoc.documentElement
|
||||
return findVertScrollableAncestor(delta, getParentIfNotElement(scrollableElem))
|
||||
}
|
||||
|
||||
return {
|
||||
scrollTo: (position) => findVertScrollable().scrollTo({top: position}),
|
||||
scrollToPercent: (percentPosition) => {
|
||||
const scrollElement = findVertScrollable()
|
||||
const paneHeight = scrollElement.scrollHeight
|
||||
scrollElement.scrollTo({top: percentPosition / 100 * paneHeight})
|
||||
},
|
||||
scrollBy: (delta) => findVertScrollable(delta).scrollBy({top: delta, behavior: 'smooth'}),
|
||||
scrollPage: (pages) => {
|
||||
const fakeDelta = pages < 0 ? -10 : 10
|
||||
const scrollElement = findVertScrollable(fakeDelta)
|
||||
const pageHeight = scrollElement.clientHeight
|
||||
scrollElement.scrollBy({top: pageHeight * pages})
|
||||
},
|
||||
}
|
||||
|
||||
})()
|
36
.config/qutebrowser/pyconfig/redirectors.py
Normal file
36
.config/qutebrowser/pyconfig/redirectors.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
import operator
|
||||
|
||||
from qutebrowser.api import interceptor, message
|
||||
|
||||
REDIRECT_MAP = {
|
||||
"reddit.com": operator.methodcaller("setHost", "libreddit.cronyakatsuki.xyz"),
|
||||
"www.reddit.com": operator.methodcaller("setHost", "libreddit.cronyakatsuki.xyz"),
|
||||
"twitter.com": operator.methodcaller("setHost", "nitter.cronyakatsuki.xyz"),
|
||||
"www.twitter.com": operator.methodcaller("setHost", "nitter.cronyakatsuki.xyz"),
|
||||
"youtube.com": operator.methodcaller("setHost", "piped.cronyakatsuki.xyz"),
|
||||
"www.youtube.com": operator.methodcaller("setHost", "piped.cronyakatsuki.xyz"),
|
||||
"music.youtube.com": operator.methodcaller(
|
||||
"setHost", "hyperpipe.cronyakatsuki.xyz"
|
||||
),
|
||||
"medium.com": operator.methodcaller("setHost", "scribe.cronyakatsuki.xyz"),
|
||||
"www.medium.com": operator.methodcaller("setHost", "scribe.cronyakatsuki.xyz"),
|
||||
"twitch.tv": operator.methodcaller("setHost", "safetwitch.cronyakatsuki.xyz"),
|
||||
"www.twitch.tv": operator.methodcaller("setHost", "safetwitch.cronyakatsuki.xyz"),
|
||||
"tiktok.com": operator.methodcaller("setHost", "proxytok.cronyakatsuki.xyz"),
|
||||
"www.tiktok.com": operator.methodcaller("setHost", "proxytok.cronyakatsuki.xyz"),
|
||||
"imgur.com": operator.methodcaller("setHost", "rimgo.cronyakatsuki.xyz"),
|
||||
"www.imgur.com": operator.methodcaller("setHost", "rimgo.cronyakatsuki.xyz"),
|
||||
"github.com": operator.methodcaller("setHost", "gh.cronyakatsuki.xyz"),
|
||||
"gist.github.com": operator.methodcaller("setHost", "gh.cronyakatsuki.xyz/gist"),
|
||||
}
|
||||
|
||||
|
||||
def int_fn(info: interceptor.Request):
|
||||
url = info.request_url
|
||||
redir = REDIRECT_MAP.get(url.host())
|
||||
if redir is not None and redir(url) is not False:
|
||||
message.info("Redirecting to " + url.toString())
|
||||
info.redirect(url)
|
||||
|
||||
|
||||
interceptor.register(int_fn)
|
74
.config/qutebrowser/userscripts/buku
Executable file
74
.config/qutebrowser/userscripts/buku
Executable file
|
@ -0,0 +1,74 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Qutebrowser userscript for interacting with buku
|
||||
# requries buku and dmenu (with list patch)
|
||||
|
||||
get_bookmark() {
|
||||
buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | dmenu -p "$1 bookmark: " -i -l 10 | awk '{ print $1 }'
|
||||
}
|
||||
|
||||
get_url() {
|
||||
buku --nostdin -p "$1" -f10
|
||||
}
|
||||
|
||||
get_title() {
|
||||
buku --nostdin -p "$1" -f30
|
||||
}
|
||||
|
||||
fifo() {
|
||||
printf '%s\n' "$1" >>"$QUTE_FIFO"
|
||||
}
|
||||
|
||||
add() {
|
||||
buku --nostdin -a "$QUTE_URL"
|
||||
$TERMINAL --class badd,badd -e buku -w -1
|
||||
fifo "message-info 'Added current url to buku'"
|
||||
}
|
||||
|
||||
open() {
|
||||
bookmark=$(get_bookmark "Open")
|
||||
[ -z "$bookmark" ] && fifo "message-info 'No Bookmark selected!!!'" && exit
|
||||
if [ "$1" == "-t" ]; then
|
||||
fifo "open -t $(get_url "$bookmark")"
|
||||
fifo "message-info 'Opening bookmark $(get_title "$bookmark") in new tab.'"
|
||||
else
|
||||
fifo "open $(get_url "$bookmark")"
|
||||
fifo "message-info 'Opening bookmark $(get_title "$bookmark").'"
|
||||
fi
|
||||
}
|
||||
|
||||
delete() {
|
||||
bookmark=$(get_bookmark "Delete")
|
||||
title=$(get_title "$bookmark")
|
||||
buku --nostdin -d "$bookmark" --tacit
|
||||
fifo "message-info 'Deleted bookmark $title.'"
|
||||
}
|
||||
|
||||
edit() {
|
||||
bookmark=$(get_bookmark "Edit")
|
||||
fifo "message-info 'Editing bookmark $(get_title "$bookmark")'"
|
||||
$TERMINAL --class badd,badd -e buku -w "$bookmark"
|
||||
}
|
||||
|
||||
main() {
|
||||
case "$1" in
|
||||
"add")
|
||||
[ -n "$2" ] && QUTE_URL=$2
|
||||
add
|
||||
exit
|
||||
;;
|
||||
"open")
|
||||
open "$2"
|
||||
exit
|
||||
;;
|
||||
"delete")
|
||||
delete
|
||||
exit
|
||||
;;
|
||||
"edit")
|
||||
edit
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main $@
|
52
.config/starship.toml
Normal file
52
.config/starship.toml
Normal file
|
@ -0,0 +1,52 @@
|
|||
format = """
|
||||
$username\
|
||||
$hostname\
|
||||
$directory\
|
||||
$git_branch\
|
||||
$git_state\
|
||||
$git_status\
|
||||
$cmd_duration\
|
||||
$line_break\
|
||||
$python\
|
||||
$character"""
|
||||
|
||||
# Get editor completions based on the config schema
|
||||
"$schema" = 'https://starship.rs/config-schema.json'
|
||||
|
||||
# Inserts a blank line between shell prompts
|
||||
add_newline = false
|
||||
|
||||
[directory]
|
||||
style = "blue"
|
||||
|
||||
[character]
|
||||
success_symbol = "[❯](purple)"
|
||||
error_symbol = "[❯](red)"
|
||||
vimcmd_symbol = "[❮](green)"
|
||||
|
||||
[git_branch]
|
||||
format = "[$branch]($style)"
|
||||
style = "bright-black"
|
||||
|
||||
[git_status]
|
||||
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)"
|
||||
style = "cyan"
|
||||
conflicted = ""
|
||||
untracked = ""
|
||||
modified = ""
|
||||
staged = ""
|
||||
renamed = ""
|
||||
deleted = ""
|
||||
stashed = "≡"
|
||||
|
||||
[git_state]
|
||||
format = '\([$state( $progress_current/$progress_total)]($style)\) '
|
||||
style = "bright-black"
|
||||
|
||||
[cmd_duration]
|
||||
format = "[$duration]($style) "
|
||||
style = "yellow"
|
||||
|
||||
[python]
|
||||
format = "[$virtualenv]($style) "
|
||||
style = "bright-black"
|
80
.config/sxhkd/general
Normal file
80
.config/sxhkd/general
Normal file
|
@ -0,0 +1,80 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# power menu
|
||||
super + shift + e
|
||||
dmenu-power-menu
|
||||
|
||||
# Reload sxhkd
|
||||
super + control + r
|
||||
pkill -USR1 -x sxhkd
|
||||
|
||||
##---System Control---##
|
||||
|
||||
# Audio Control
|
||||
{XF86AudioRaiseVolume,XF86AudioLowerVolume,XF86AudioMute}
|
||||
sb-volume-update { up, down, mute }
|
||||
|
||||
# Brightness
|
||||
{XF86MonBrightnessUp,XF86MonBrightnessDown}
|
||||
sb-backlight-update { up, down }
|
||||
|
||||
# Player control keybindings
|
||||
{XF86AudioPlay,XF86AudioPrev,XF86AudioNext}
|
||||
dmenu-playerctl {play-pause,previous,next}
|
||||
|
||||
##---Aplication Launchers---##
|
||||
|
||||
# terminal
|
||||
super + Return
|
||||
$TERMINAL
|
||||
|
||||
# Browser run
|
||||
super + {_, shift + , control}b
|
||||
{$BROWSER, librewolf, ungoogled-chromium}
|
||||
|
||||
# Gui Programs
|
||||
super g; l
|
||||
slock
|
||||
|
||||
# Terminal Programs with class
|
||||
super + t; n
|
||||
$TERMINAL --class newsboat -e newsboat
|
||||
|
||||
##---Dmenu bindings---#
|
||||
|
||||
# Key chaining some certain scripts
|
||||
super + p; {w,d,k,l}
|
||||
{dmenu-wifi, dmenu-runner, dmenu-kill,\
|
||||
dmenu-link-handler $(xclip -sel c -o)}
|
||||
|
||||
# Regular binding some other one's
|
||||
super + d
|
||||
dmenu_run
|
||||
|
||||
Print
|
||||
dmenu-screenshot
|
||||
|
||||
##---Gaming bindings---##
|
||||
super + shift + F12
|
||||
gaming-time
|
||||
|
||||
##---Buku bindings---##
|
||||
alt + b; {a,o,e,d}
|
||||
{badd, dmenu-buku open, dmenu-buku edit, dmenu-buku delete}
|
||||
|
||||
##---KeePassXC quick pass bindings---##
|
||||
super + g; b
|
||||
dmenu-keepassxc vaultwarden copy
|
||||
|
||||
##---Sripts---##
|
||||
super + F1
|
||||
sound-output-toggle
|
||||
|
||||
super + F2
|
||||
recorder
|
||||
|
||||
super + m
|
||||
mpv $(xclip -sel c -o)
|
||||
|
||||
super + F3
|
||||
bash -c 'killall xdotool || while xdotool key --repeat 100 --delay 100 Enter; do :; done'
|
86
.config/tmux/tmux.conf
Normal file
86
.config/tmux/tmux.conf
Normal file
|
@ -0,0 +1,86 @@
|
|||
# Colors with alacritty
|
||||
set-option -sa terminal-overrides ",alacritty:Tc"
|
||||
|
||||
# enable mouse support
|
||||
set -g mouse on
|
||||
|
||||
# start window and panes indexing at 1
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
set-window-option -g pane-base-index 1
|
||||
set-option -g renumber-windows on
|
||||
|
||||
# SPEED
|
||||
set -g escape-time 0
|
||||
set-option -g status-interval 1
|
||||
|
||||
# set prefix key to ctrl + space
|
||||
unbind C-b
|
||||
set -g prefix C-Space
|
||||
bind C-Space send-prefix
|
||||
|
||||
bind -n M-K previous-window
|
||||
bind -n M-J next-window
|
||||
|
||||
# set vi-mode
|
||||
set-window-option -g mode-keys vi
|
||||
# keybindings
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
||||
|
||||
bind "'" split-window -v -c "#{pane_current_path}"
|
||||
bind '\' split-window -h -c "#{pane_current_path}"
|
||||
|
||||
# Floating popup keybindings
|
||||
bind-key g run-shell 'tmux-popup lazygit'
|
||||
bind-key f run-shell 'tmux-popup nnn'
|
||||
bind-key h run-shell 'tmux-popup htop'
|
||||
bind-key t run-shell 'tmux-popup t'
|
||||
|
||||
# Vim keybindings for pane movement
|
||||
setw -g mode-keys vi
|
||||
bind-key h select-pane -L
|
||||
bind-key j select-pane -D
|
||||
bind-key k select-pane -U
|
||||
bind-key l select-pane -R
|
||||
|
||||
# Skip kill pane %Number% (y/n) prompt
|
||||
bind-key x kill-pane
|
||||
|
||||
# Don't exit from tmux when closing a session
|
||||
set -g detach-on-destroy off
|
||||
|
||||
# Catppuccin settings
|
||||
set -g @catppuccin_flavour 'frappe'
|
||||
set -g @catppuccin_window_right_separator "█ "
|
||||
set -g @catppuccin_window_number_position "right"
|
||||
set -g @catppuccin_window_middle_separator " | "
|
||||
|
||||
set -g @catppuccin_window_default_fill "none"
|
||||
|
||||
set -g @catppuccin_window_current_fill "all"
|
||||
|
||||
set -g @catppuccin_status_modules_right "application session date_time"
|
||||
set -g @catppuccin_status_left_separator "█"
|
||||
set -g @catppuccin_status_right_separator "█"
|
||||
|
||||
set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M"
|
||||
|
||||
# Status bar border
|
||||
setw -g pane-border-status top
|
||||
setw -g pane-border-format '─'
|
||||
|
||||
# Bar to top
|
||||
set-option -g status-position top
|
||||
|
||||
# Plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
||||
set -g @plugin 'wfxr/tmux-fzf-url'
|
||||
|
||||
run '~/.local/share/tmux/plugins/tpm/tpm'
|
15
.config/user-dirs.dirs
Normal file
15
.config/user-dirs.dirs
Normal file
|
@ -0,0 +1,15 @@
|
|||
# This file is written by xdg-user-dirs-update
|
||||
# If you want to change or add directories, just edit the line you're
|
||||
# interested in. All local changes will be retained on the next run.
|
||||
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
||||
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
||||
# absolute path. No other format is supported.
|
||||
#
|
||||
XDG_DESKTOP_DIR="$HOME/"
|
||||
XDG_DOWNLOAD_DIR="$HOME/downs"
|
||||
XDG_TEMPLATES_DIR="$HOME/"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/"
|
||||
XDG_DOCUMENTS_DIR="$HOME/docs"
|
||||
XDG_MUSIC_DIR="$HOME/"
|
||||
XDG_PICTURES_DIR="$HOME/pics"
|
||||
XDG_VIDEOS_DIR="$HOME/"
|
52
.config/xmobar/trayer-padding-icon.sh
Executable file
52
.config/xmobar/trayer-padding-icon.sh
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/bin/sh
|
||||
# Copied from https://github.com/jaor/xmobar/issues/239#issuecomment-233206552
|
||||
# Detects the width of running trayer-srg window (xprop name 'panel')
|
||||
# and creates an XPM icon of that width, 1px height, and transparent.
|
||||
# Outputs an <icon>-tag for use in xmobar to display the generated
|
||||
# XPM icon.
|
||||
#
|
||||
# Run script from xmobar:
|
||||
# `Run Com "/where/ever/trayer-padding-icon.sh" [] "trayerpad" 10`
|
||||
# and use `%trayerpad%` in your template.
|
||||
|
||||
|
||||
# Function to create a transparent Wx1 px XPM icon
|
||||
create_xpm_icon () {
|
||||
timestamp=$(date)
|
||||
pixels=$(for i in `seq $1`; do echo -n "."; done)
|
||||
|
||||
cat << EOF > "$2"
|
||||
/* XPM *
|
||||
static char * trayer_pad_xpm[] = {
|
||||
/* This XPM icon is used for padding in xmobar to */
|
||||
/* leave room for trayer-srg. It is dynamically */
|
||||
/* updated by by trayer-padding-icon.sh which is run */
|
||||
/* by xmobar. */
|
||||
/* Created: ${timestamp} */
|
||||
/* <w/cols> <h/rows> <colors> <chars per pixel> */
|
||||
"$1 1 1 1",
|
||||
/* Colors (none: transparent) */
|
||||
". c none",
|
||||
/* Pixels */
|
||||
"$pixels"
|
||||
};
|
||||
EOF
|
||||
}
|
||||
|
||||
# Width of the trayer window
|
||||
width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5)
|
||||
|
||||
# Icon file name
|
||||
iconfile="/tmp/trayer-padding-${width}px.xpm"
|
||||
|
||||
# If the desired icon does not exist create it
|
||||
if [ ! -f $iconfile ]; then
|
||||
create_xpm_icon $width $iconfile
|
||||
fi
|
||||
|
||||
if [ "$width" -gt "5" ]; then
|
||||
# Output the icon tag for xmobar
|
||||
echo "<fc=#eba0ac>•</fc><icon=${iconfile}/>"
|
||||
else
|
||||
echo "<icon=${iconfile}/>"
|
||||
fi
|
21
.config/xmobar/xmobarrc
Normal file
21
.config/xmobar/xmobarrc
Normal file
|
@ -0,0 +1,21 @@
|
|||
Config { lowerOnStart = True
|
||||
, overrideRedirect = True
|
||||
, font = "Cascadia Code 11"
|
||||
, additionalFonts = ["IpaGothic Bold 12"]
|
||||
, bgColor = "#303446"
|
||||
, fgColor = "#c6d0f5"
|
||||
, position = TopSize L 100 24
|
||||
, commands = [ Run Cpu
|
||||
[ "--template", " <total>%"] 90
|
||||
, Run Com "sb-cpu-temp" [] "cpu-temp" 100
|
||||
, Run Com "sb-battery" [] "battery" 300
|
||||
, Run Com "sb-ram" [] "memory" 150
|
||||
, Run Com "sb-disk-space" [] "disk" 360000
|
||||
, Run Com "sb-datetime" [] "date" 200
|
||||
, Run Com "sb-wifi" [] "wifi" 50
|
||||
, Run Com "/home/crony/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 100
|
||||
, Run XMonadLog
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = " %XMonadLog% }{ %cpu-temp% <fc=#eba0ac>•</fc> %cpu% <fc=#eba0ac>•</fc> %memory% <fc=#eba0ac>•</fc> %disk% <fc=#eba0ac>•</fc> %wifi% <fc=#eba0ac>•</fc> %battery% <fc=#eba0ac>•</fc> %date% %trayerpad%" }
|
286
.config/xmonad/xmonad.hs
Normal file
286
.config/xmonad/xmonad.hs
Normal file
|
@ -0,0 +1,286 @@
|
|||
-- Base
|
||||
import XMonad
|
||||
import System.Exit
|
||||
import qualified XMonad.StackSet as W
|
||||
|
||||
-- Actions
|
||||
import XMonad.Actions.CycleWS (toggleWS')
|
||||
import XMonad.Actions.MouseResize
|
||||
import XMonad.Actions.SinkAll (sinkAll)
|
||||
|
||||
-- Data
|
||||
import qualified Data.Map as M
|
||||
import Data.Maybe (isJust)
|
||||
|
||||
-- Hooks
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.StatusBar
|
||||
import XMonad.Hooks.StatusBar.PP
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.SetWMName
|
||||
import XMonad.Hooks.InsertPosition
|
||||
|
||||
-- Layout modifiers
|
||||
import XMonad.Layout.Renamed
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.Layout.NoBorders
|
||||
import XMonad.Layout.SimplestFloat
|
||||
import XMonad.Layout.LayoutModifier
|
||||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Layout.PerWorkspace
|
||||
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
|
||||
|
||||
-- Utils
|
||||
import XMonad.Util.Loggers
|
||||
import XMonad.Util.NamedScratchpad
|
||||
import XMonad.Util.SpawnOnce
|
||||
import XMonad.Util.EZConfig
|
||||
import XMonad.Util.Hacks
|
||||
|
||||
-- main loop
|
||||
main :: IO ()
|
||||
main = xmonad
|
||||
. ewmhFullscreen
|
||||
. ewmh
|
||||
. withEasySB (statusBarProp "xmobar ~/.config/xmobar/xmobarrc" (pure myXmobarPP)) toggleStrutsKey
|
||||
$ myConfig
|
||||
where
|
||||
toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym)
|
||||
toggleStrutsKey XConfig{ modMask = m } = (m, xK_F11)
|
||||
|
||||
-- My config
|
||||
myConfig = def
|
||||
{ modMask = myModMask
|
||||
, layoutHook = myLayoutHook
|
||||
, manageHook = insertPosition End Newer <+> myManageHook
|
||||
, handleEventHook = trayerAboveXmobarEventHook
|
||||
, focusFollowsMouse = myFocusFollowsMouse
|
||||
, terminal = myTerminal
|
||||
, borderWidth = myBorderWidth
|
||||
, normalBorderColor = myNormalBorderColor
|
||||
, focusedBorderColor = myFocusedBorderColor
|
||||
, keys = myKeys
|
||||
, workspaces = myWorkspaces
|
||||
, startupHook = myStartupHook
|
||||
}
|
||||
|
||||
-- My variables
|
||||
myModMask = mod4Mask
|
||||
myTerminal = "alacritty"
|
||||
myBorderWidth = 2
|
||||
|
||||
myFocusFollowsMouse :: Bool
|
||||
myFocusFollowsMouse = False
|
||||
|
||||
myNormalBorderColor = "#737994"
|
||||
myFocusedBorderColor = "#c6d0f5"
|
||||
|
||||
myWorkspaces = ["一","二","三","四","五","六","七","八","九"]
|
||||
|
||||
-- My startup hook
|
||||
myStartupHook :: X ()
|
||||
myStartupHook = do
|
||||
spawn "killall trayer" -- kill current trayer on each restart
|
||||
spawnOnce "sxhkd -c $HOME/.config/sxhkd/general"
|
||||
spawnOnce "syncthing"
|
||||
spawnOnce "picom"
|
||||
spawnOnce "clipmenud"
|
||||
spawnOnce "dunst"
|
||||
spawnOnce "keepassxc"
|
||||
spawnOnce "lxpolkit"
|
||||
spawnOnce "nheko"
|
||||
spawnOnce "jellyfin-mpv-shim"
|
||||
spawn ("sleep 2 && trayer --edge top --align right --widthtype request --padding 6 --iconspacing 7 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x303446 --height 24 -l")
|
||||
setWMName "LG3D" -- Fix java programs
|
||||
|
||||
-- My scratchpads
|
||||
myScratchPads :: [NamedScratchpad]
|
||||
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
|
||||
, NS "wiki" spawnWiki findWiki manageWiki
|
||||
, NS "notes" spawnNotes findNotes manageNotes
|
||||
]
|
||||
where
|
||||
spawnTerm = myTerminal ++ " --class scratchpad,scratchpad"
|
||||
findTerm = className =? "scratchpad"
|
||||
manageTerm = customFloating $ W.RationalRect l t w h
|
||||
where
|
||||
h = 0.8
|
||||
w = 0.8
|
||||
t = 0.9 -h
|
||||
l = 0.9 -w
|
||||
spawnWiki = myTerminal ++ " --class wiki,wiki -e wiki"
|
||||
findWiki = className =? "wiki"
|
||||
manageWiki = customFloating $ W.RationalRect l t w h
|
||||
where
|
||||
h = 0.8
|
||||
w = 0.8
|
||||
t = 0.9 -h
|
||||
l = 0.9 -w
|
||||
spawnNotes = myTerminal ++ " --class wiki,wiki -e notes"
|
||||
findNotes = className =? "notes"
|
||||
manageNotes = customFloating $ W.RationalRect l t w h
|
||||
where
|
||||
h = 0.8
|
||||
w = 0.8
|
||||
t = 0.9 -h
|
||||
l = 0.9 -w
|
||||
|
||||
|
||||
--Makes setting the spacingRaw simpler to write. The spacingRaw module adds a configurable amount of space around windows.
|
||||
mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||
mySpacing i = spacingRaw False (Border i i i i) True (Border i i i i) True
|
||||
|
||||
-- Below is a variation of the above except no borders are applied
|
||||
-- if fewer than two windows. So a single window has no gaps.
|
||||
mySpacing' :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
|
||||
mySpacing' i = spacingRaw True (Border i i i i) True (Border i i i i) True
|
||||
|
||||
-- My layouts
|
||||
tall = renamed [Replace "tall"]
|
||||
$ withBorder myBorderWidth
|
||||
$ mySpacing 4
|
||||
$ ResizableTall 1 (3/100) (1/2) []
|
||||
monocle = renamed [Replace "monocle"]
|
||||
$ withBorder myBorderWidth
|
||||
$ mySpacing 4
|
||||
$ Full
|
||||
floats = renamed [Replace "floats"]
|
||||
$ withBorder myBorderWidth
|
||||
$ simplestFloat
|
||||
|
||||
myLayoutHook = lessBorders OnlyScreenFloat
|
||||
$ mouseResize
|
||||
$ windowArrange
|
||||
$ myDefaultLayout
|
||||
where
|
||||
myDefaultLayout = onWorkspaces [(myWorkspaces !! 0), (myWorkspaces !! 3), (myWorkspaces !! 4)] (monocle ||| floats ||| tall)
|
||||
$ onWorkspace (myWorkspaces !! 5) (floats ||| tall ||| monocle)
|
||||
$ tall
|
||||
||| monocle
|
||||
||| floats
|
||||
|
||||
-- My manage hook
|
||||
myManageHook :: ManageHook
|
||||
myManageHook = composeAll
|
||||
[ className =? "qutebrowser" --> doShiftAndGo ( myWorkspaces !! 0)
|
||||
, className =? "newsboat" --> doShiftAndGo ( myWorkspaces !! 3)
|
||||
, className =? "videos" --> doShiftAndGo ( myWorkspaces !! 3)
|
||||
, className =? "ytfzf" --> doShiftAndGo ( myWorkspaces !! 3)
|
||||
, className =? "lf" --> doShiftAndGo ( myWorkspaces !! 3)
|
||||
, className =? "thunderbird" --> doShiftAndGo ( myWorkspaces !! 4)
|
||||
, className =? "Ferdium" --> doShiftAndGo ( myWorkspaces !! 4)
|
||||
, className =? "discord" --> doShiftAndGo ( myWorkspaces !! 4)
|
||||
, className =? "tutanota-desktop" --> doShiftAndGo ( myWorkspaces !! 4)
|
||||
, className =? "nheko" --> doShiftAndGo ( myWorkspaces !! 4)
|
||||
, className =? "Lutris" --> doShiftAndGo ( myWorkspaces !! 5)
|
||||
, className =? "steam" --> doShiftAndGo ( myWorkspaces !! 5)
|
||||
, className =? "heroic" --> doShiftAndGo ( myWorkspaces !! 5)
|
||||
, className =? "cartridges" --> doShiftAndGo ( myWorkspaces !! 5)
|
||||
, className =? "Cemu" --> doShiftAndGo ( myWorkspaces !! 5)
|
||||
, className =? "xemu" --> doShiftAndGo ( myWorkspaces !! 5)
|
||||
, className =? "librewolf" --> doShiftAndGo ( myWorkspaces !! 8)
|
||||
, isDialog --> doCenterFloat <+> doF W.swapUp
|
||||
, className =? "Gimp" --> doFloat <+> doF W.swapUp
|
||||
, className =? "confirm" --> doFloat <+> doF W.swapUp
|
||||
, className =? "file_progress" --> doFloat <+> doF W.swapUp
|
||||
, className =? "dialog" --> doFloat <+> doF W.swapUp
|
||||
, className =? "download" --> doFloat <+> doF W.swapUp
|
||||
, className =? "error" --> doFloat <+> doF W.swapUp
|
||||
, className =? "notification" --> doFloat <+> doF W.swapUp
|
||||
, className =? "splash" --> doFloat <+> doF W.swapUp
|
||||
, className =? "toolbar" --> doFloat <+> doF W.swapUp
|
||||
, className =? "pinentry-gtk-2" --> doFloat <+> doF W.swapUp
|
||||
, className =? "Yad" --> doCenterFloat <+> doF W.swapUp
|
||||
, className =? "badd" --> doCenterFloat <+> doF W.swapUp
|
||||
, className =? "filepicker" --> doRectFloat (W.RationalRect (1/12) (1/12) (5/6) (5/6)) <+> doF W.swapUp
|
||||
, isFullscreen --> doFullFloat
|
||||
, namedScratchpadManageHook myScratchPads
|
||||
]
|
||||
where
|
||||
doShiftAndGo ws = doF (W.greedyView ws) <+> doShift ws
|
||||
|
||||
-- My keybindings in a nice readable format
|
||||
myKeys = \c -> mkKeymap c $
|
||||
[ ("M-S-q", kill) -- kill active window
|
||||
, ("M-<Space>", sendMessage NextLayout) -- cycle layout
|
||||
, ("M-S-<Space>", withFocused toggleFloat) -- toggle floating state of a window
|
||||
, ("M-j", windows W.focusDown) -- Move focus down
|
||||
, ("M-k", windows W.focusUp) -- Move focus up
|
||||
, ("M-S-<Return>", windows W.swapMaster) -- Move Focused window to master
|
||||
, ("M-S-j", windows W.swapDown) --Move window down the stack
|
||||
, ("M-S-k", windows W.swapUp) -- Move window up the stack
|
||||
, ("M-h", sendMessage Shrink) -- Shrink master
|
||||
, ("M-l", sendMessage Expand) -- Expand master
|
||||
, ("M-,", sendMessage (IncMasterN 1)) -- Increase master count
|
||||
, ("M-.", sendMessage (IncMasterN (-1))) -- Decrease msaster count
|
||||
, ("M-C-e", io (exitWith ExitSuccess)) -- Quit xmonad
|
||||
, ("M-S-r", spawn "xmonad --recompile && xmonad --restart") -- Restart xmonad
|
||||
, ("M-<Tab>", toggleWS' ["NSP"]) -- Toogle last used workspace, ignoring named scratchpad
|
||||
, ("M-s t", namedScratchpadAction myScratchPads "terminal") -- Toggle scratchpad
|
||||
, ("M-s w", namedScratchpadAction myScratchPads "wiki") -- Toggle scratchpad
|
||||
, ("M-s n", namedScratchpadAction myScratchPads "notes") -- Toggle scratchpad
|
||||
, ("M-1", viewDesktop 0) -- Check workspace 1
|
||||
, ("M-2", viewDesktop 1) -- Check workspace 2
|
||||
, ("M-3", viewDesktop 2) -- Check workspace 3
|
||||
, ("M-4", viewDesktop 3) -- Check workspace 4
|
||||
, ("M-5", viewDesktop 4) -- Check workspace 5
|
||||
, ("M-6", viewDesktop 5) -- Check workspace 6
|
||||
, ("M-7", viewDesktop 6) -- Check workspace 7
|
||||
, ("M-8", viewDesktop 7) -- Check workspace 8
|
||||
, ("M-9", viewDesktop 8) -- Check workspace 9
|
||||
, ("M-S-1", shiftWindow 0) -- Send window to workspace 1
|
||||
, ("M-S-2", shiftWindow 1) -- Send window to workspace 2
|
||||
, ("M-S-3", shiftWindow 2) -- Send window to workspace 3
|
||||
, ("M-S-4", shiftWindow 3) -- Send window to workspace 4
|
||||
, ("M-S-5", shiftWindow 4) -- Send window to workspace 5
|
||||
, ("M-S-6", shiftWindow 5) -- Send window to workspace 6
|
||||
, ("M-S-7", shiftWindow 6) -- Send window to workspace 7
|
||||
, ("M-S-8", shiftWindow 7) -- Send window to workspace 8
|
||||
, ("M-S-9", shiftWindow 8) -- Send window to workspace 9
|
||||
, ("M-C-1", shiftAndView 0) -- Send window and check workspace 1
|
||||
, ("M-C-2", shiftAndView 1) -- Send window and check workspace 2
|
||||
, ("M-C-3", shiftAndView 2) -- Send window and check workspace 3
|
||||
, ("M-C-4", shiftAndView 3) -- Send window and check workspace 4
|
||||
, ("M-C-5", shiftAndView 4) -- Send window and check workspace 5
|
||||
, ("M-C-6", shiftAndView 5) -- Send window and check workspace 6
|
||||
, ("M-C-7", shiftAndView 6) -- Send window and check workspace 7
|
||||
, ("M-C-8", shiftAndView 7) -- Send window and check workspace 8
|
||||
, ("M-C-9", shiftAndView 8) -- Send window and check workspace 9
|
||||
, ("M-f", sinkAll) -- Nuke solution for simplestFloat layout
|
||||
]
|
||||
where
|
||||
toggleFloat w = windows (\s -> if M.member w (W.floating s)
|
||||
then W.sink w s
|
||||
else (W.float w (W.RationalRect (1/6) (1/6) (2/3) (2/3)) s))
|
||||
viewDesktop d = windows $ W.greedyView $ myWorkspaces !! d
|
||||
shiftWindow w = windows $ W.shift $ myWorkspaces !! w
|
||||
shiftAndView w = windows $ W.greedyView (myWorkspaces !! w) . W.shift (myWorkspaces !! w)
|
||||
|
||||
-- My xmobar workspace and other things config
|
||||
myXmobarPP :: PP
|
||||
myXmobarPP = filterOutWsPP ["NSP"]
|
||||
$ def
|
||||
{ ppSep = magenta " • "
|
||||
, ppWsSep = " "
|
||||
, ppTitleSanitize = xmobarStrip
|
||||
, ppCurrent = xmobarBorder "Bottom" "#89b4fa" 2
|
||||
, ppHidden = white
|
||||
, ppHiddenNoWindows = lowWhite
|
||||
, ppUrgent = red . wrap (yellow "!") (yellow "!")
|
||||
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
|
||||
, ppExtras = [logTitles formatFocused formatUnfocused]
|
||||
}
|
||||
where
|
||||
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
|
||||
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
|
||||
|
||||
ppWindow :: String -> String
|
||||
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 25
|
||||
|
||||
blue, lowWhite, magenta, red, white, yellow :: String -> String
|
||||
magenta = xmobarColor "#eba0ac" ""
|
||||
blue = xmobarColor "#cba6f7" ""
|
||||
white = xmobarColor "#cdd6f4" ""
|
||||
yellow = xmobarColor "#f9e2af" ""
|
||||
red = xmobarColor "#f38ba8" ""
|
||||
lowWhite = xmobarColor "#585b70" ""
|
3
.config/zsh/.zprofile
Normal file
3
.config/zsh/.zprofile
Normal file
|
@ -0,0 +1,3 @@
|
|||
if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
|
||||
exec startx
|
||||
fi
|
56
.config/zsh/.zshenv
Normal file
56
.config/zsh/.zshenv
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Path setup
|
||||
typeset -U PATH path
|
||||
path=("$HOME/.local/bin" "$HOME/bin/dmenu" "$HOME/bin/misc" "$HOME/bin/statusbar" "$path[@]")
|
||||
export PATH
|
||||
|
||||
# qt5ct setting
|
||||
export QT_QPA_PLATFORMTHEME="qt6ct"
|
||||
|
||||
# Basic settings
|
||||
export EDITOR="nvim"
|
||||
export VISUAL="nvim"
|
||||
export READER="zathura"
|
||||
export TERMINAL="alacritty"
|
||||
export BROWSER="qutebrowser"
|
||||
export VIDEO="mpv"
|
||||
export IMAGE="nsxiv"
|
||||
export OPENER="xdg-open"
|
||||
export PAGER="less"
|
||||
export WM="xmonad"
|
||||
export SUDO_ASKPASS="dmenu-pass"
|
||||
|
||||
# NNN settings
|
||||
export NNN_FIFO="/tmp/nnn.fifo"
|
||||
export NNN_PLUG="u:nmount;c:chksum;r:gitroot;v:imgview;m:mtpmount;d:xdgdefault;x:togglex;p:preview-tui"
|
||||
export NNN_SSHFS="sshfs -o follow_symlinks"
|
||||
export NNN_TERMINAL="alacritty --class preview,preview"
|
||||
|
||||
# Catppuccin colors nnn
|
||||
BLK="03" CHR="03" DIR="04" EXE="02" REG="07" HARDLINK="05" SYMLINK="05" MISSING="08" ORPHAN="01" FIFO="06" SOCK="03" UNKNOWN="01"
|
||||
export NNN_COLORS="#04020301;4231"
|
||||
export NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$UNKNOWN"
|
||||
|
||||
# XDG CLEANUP
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_DESKTOP_DIR="$HOME/.local/share/desktop"
|
||||
export XDG_DOWNLOAD_DIR="$HOME/downs"
|
||||
export XDG_TEMPLATES_DIR="$HOME/.local/share/templates"
|
||||
export XDG_PUBLICSHARE_DIR="$HOME/.local/share/public"
|
||||
export XDG_DOCUMENTS_DIR="$HOME/docs"
|
||||
export XDG_MUSIC_DIR="$HOME/music"
|
||||
export XDG_PICTURES_DIR="$HOME/pics"
|
||||
export XDG_VIDEOS_DIR="$HOME/vids"
|
||||
|
||||
# Home cleanup
|
||||
export CARGO_HOME="$XDG_DATA_HOME"/cargo
|
||||
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
|
||||
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
|
||||
export GOPATH="$XDG_DATA_HOME"/go
|
||||
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
|
||||
export XCURSOR_PATH=/usr/share/icons:$XDG_DATA_HOME/icons
|
||||
export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
|
||||
|
57
.config/zsh/.zshrc
Normal file
57
.config/zsh/.zshrc
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Nice prompt
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
# Quick folder jump
|
||||
eval "$(zoxide init zsh)"
|
||||
|
||||
# Automatic setup of environments
|
||||
eval "$(direnv hook zsh)"
|
||||
|
||||
# Plugin manager
|
||||
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh"
|
||||
|
||||
# Plugins
|
||||
plug "zap-zsh/supercharge"
|
||||
plug "xPMo/zsh-toggle-command-prefix"
|
||||
plug "zap-zsh/completions"
|
||||
plug "zap-zsh/vim"
|
||||
plug "zap-zsh/exa"
|
||||
plug "zsh-users/zsh-autosuggestions"
|
||||
plug "zsh-users/zsh-completions"
|
||||
plug "chivalryq/git-alias"
|
||||
plug "zap-zsh/fzf"
|
||||
plug "zdharma-continuum/fast-syntax-highlighting"
|
||||
plug "zsh-users/zsh-history-substring-search"
|
||||
plug "MichaelAquilina/zsh-you-should-use"
|
||||
|
||||
# Local
|
||||
plug "$XDG_CONFIG_HOME/zsh/aliases.zsh"
|
||||
plug "$XDG_CONFIG_HOME/zsh/functions.zsh"
|
||||
|
||||
# VI Mode escape timeout fix
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
# Substring search settings
|
||||
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold"
|
||||
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=black,bold'
|
||||
bindkey -M vicmd 'k' history-substring-search-up
|
||||
bindkey -M vicmd 'j' history-substring-search-down
|
||||
|
||||
# History settings
|
||||
setopt INC_APPEND_HISTORY
|
||||
export HISTTIMEFORMAT="[%F %T]"
|
||||
|
||||
HISTFILE="$HOME"/.local/state/zsh/history
|
||||
|
||||
# Add nnn shell level to prompt
|
||||
[ -n "$NNNLVL" ] && PS1="N$NNNLVL $PS1"
|
||||
|
||||
# cd on nnn quiting
|
||||
nnn_cd ()
|
||||
{
|
||||
if ! [ -z "$NNN_PIPE" ]; then
|
||||
printf "%s\0" "0c${PWD}" > "${NNN_PIPE}" !&
|
||||
fi
|
||||
}
|
||||
|
||||
trap nnn_cd EXIT
|
37
.config/zsh/aliases.zsh
Normal file
37
.config/zsh/aliases.zsh
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Check ssd state
|
||||
alias ssd-check="sudo smartctl -a /dev/nvme0n1 | grep -E -- 'Data Units Read:|Data Units Written:|Percentage Used:'"
|
||||
|
||||
# Add colors to regular commands
|
||||
alias grep='grep --color=auto'
|
||||
alias cp='cp -iv'
|
||||
alias rm='rm -iv'
|
||||
alias mkd='mkdir -pv'
|
||||
alias less='less -R'
|
||||
|
||||
# neovim
|
||||
alias vi='nvim'
|
||||
# nnn
|
||||
alias nnn='LC_COLLATE="C" nnn -xeaiH'
|
||||
|
||||
# Human readable + better output
|
||||
alias df='df -h -x devtmpfs -x tmpfs -x usbfs -x loop'
|
||||
alias free='free -mht'
|
||||
|
||||
# nicer ps
|
||||
alias ps='ps auxf'
|
||||
|
||||
# continue download by default
|
||||
alias wget='wget -c'
|
||||
|
||||
# Just cause I can't remember the command at all
|
||||
alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
|
||||
|
||||
# Quickly see the hogger in the directory
|
||||
alias dust='du -hd1 | sort -hr | sed "s/.\///g" | sed "/\.$/d"'
|
||||
|
||||
alias b='buku -p'
|
||||
|
||||
# cryptography
|
||||
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
|
69
.config/zsh/functions.zsh
Normal file
69
.config/zsh/functions.zsh
Normal file
|
@ -0,0 +1,69 @@
|
|||
#!/bin/sh
|
||||
# Open a script in path with vim quicly
|
||||
vish () {
|
||||
nvim $(which $1)
|
||||
}
|
||||
|
||||
# Create a directory and change into it
|
||||
md () {
|
||||
mkdir -p "$@" && cd "$@"
|
||||
}
|
||||
|
||||
# Move a file and create a link in it's place
|
||||
mvln () {
|
||||
from=$(readlink -f $1)
|
||||
to="$2"
|
||||
[ ! -d "$(dirname $to)" ] && mkdir -p "$(dirname $to)"
|
||||
mv $from $to
|
||||
ln -s $to $from
|
||||
}
|
||||
|
||||
# Find my script and let me edit them
|
||||
se() {
|
||||
fd . ~/bin -L --type f --color=never | fzf --prompt "Choose script to edit: " \
|
||||
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
|
||||
}
|
||||
|
||||
# List my config and open the dir in a editor
|
||||
ce() {
|
||||
current=$(pwd)
|
||||
dir=$(fd . ~/.config -L --maxdepth 1 --color=never | fzf --prompt \
|
||||
"Choose config to edit: " --preview 'tree -a -C {}')
|
||||
[ "$dir" = "" ] && return
|
||||
cd "$dir" && nvim .
|
||||
cd "$current"
|
||||
}
|
||||
|
||||
# Copy current working directory
|
||||
cpdir() {
|
||||
pwd | tr -d "\r\n" | xclip -sel c
|
||||
}
|
||||
|
||||
# Copy content of a file.
|
||||
cf() {
|
||||
cat $1 | xclip -sel c
|
||||
}
|
||||
|
||||
# nnn
|
||||
n () {
|
||||
# Block nesting of nnn in subshells
|
||||
[ "${NNNLVL:-0}" -eq 0 ] || {
|
||||
echo "nnn is already running"
|
||||
return
|
||||
}
|
||||
|
||||
# Tempfile location
|
||||
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||
|
||||
nnn "$@"
|
||||
|
||||
[ ! -f "$NNN_TMPFILE" ] || {
|
||||
. "$NNN_TMPFILE"
|
||||
rm -f "$NNN_TMPFILE" > /dev/null
|
||||
}
|
||||
}
|
||||
|
||||
# upfast
|
||||
upfast () {
|
||||
curl -F "file=@$(readlink -f $1)" "https://upfast.cronyakatsuki.xyz/"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue