First commit

This commit is contained in:
hok7z 2022-10-21 13:15:28 +03:00
parent 24badfc16c
commit f928ec6b15
427 changed files with 4690 additions and 0 deletions

6
.clang-format Normal file
View File

@ -0,0 +1,6 @@
UseTab: Always
IndentWidth: 4
TabWidth: 4
AllowShortFunctionsOnASingleLine: None
AlignAfterOpenBracket: AlwaysBreak
# vim: ft=yaml

Binary file not shown.

170
.config/bottom/bottom.toml Normal file
View File

@ -0,0 +1,170 @@
# This is a default config file for bottom. All of the settings are commented
# out by default; if you wish to change them uncomment and modify as you see
# fit.
# This group of options represents a command-line flag/option. Flags explicitly
# added when running (ie: btm -a) will override this config file if an option
# is also set here.
[flags]
# Whether to hide the average cpu entry.
#hide_avg_cpu = false
# Whether to use dot markers rather than braille.
#dot_marker = false
# The update rate of the application.
#rate = 1000
# Whether to put the CPU legend to the left.
#left_legend = false
# Whether to set CPU% on a process to be based on the total CPU or just current usage.
#current_usage = false
# Whether to group processes with the same name together by default.
#group_processes = false
# Whether to make process searching case sensitive by default.
#case_sensitive = false
# Whether to make process searching look for matching the entire word by default.
#whole_word = false
# Whether to make process searching use regex by default.
#regex = false
# Defaults to Celsius. Temperature is one of:
#temperature_type = "k"
#temperature_type = "f"
temperature_type = "c"
#temperature_type = "kelvin"
#temperature_type = "fahrenheit"
#temperature_type = "celsius"
# The default time interval (in milliseconds).
#default_time_value = 60000
# The time delta on each zoom in/out action (in milliseconds).
#time_delta = 15000
# Hides the time scale.
#hide_time = false
# Override layout default widget
#default_widget_type = "proc"
#default_widget_count = 1
# Use basic mode
#basic = false
# Use the old network legend style
#use_old_network_legend = false
# Remove space in tables
#hide_table_gap = false
# Show the battery widgets
#battery = false
# Disable mouse clicks
#disable_click = false
# Built-in themes. Valid values are "default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light"
#color = "default"
# Show memory values in the processes widget as values by default
#mem_as_value = false
# Show tree mode by default in the processes widget.
#tree = false
# Shows an indicator in table widgets tracking where in the list you are.
#show_table_scroll_position = false
# Show processes as their commands by default in the process widget.
#process_command = false
# Displays the network widget with binary prefixes.
#network_use_binary_prefix = false
# Displays the network widget using bytes.
#network_use_bytes = false
# Displays the network widget with a log scale.
#network_use_log = false
# Hides advanced options to stop a process on Unix-like systems.
#disable_advanced_kill = false
# These are all the components that support custom theming. Note that colour support
# will depend on terminal support.
#[colors] # Uncomment if you want to use custom colors
# Represents the colour of table headers (processes, CPU, disks, temperature).
#table_header_color="LightBlue"
# Represents the colour of the label each widget has.
#widget_title_color="Gray"
# Represents the average CPU color.
#avg_cpu_color="Red"
# Represents the colour the core will use in the CPU legend and graph.
#cpu_core_colors=["LightMagenta", "LightYellow", "LightCyan", "LightGreen", "LightBlue", "LightRed", "Cyan", "Green", "Blue", "Red"]
# Represents the colour RAM will use in the memory legend and graph.
#ram_color="LightMagenta"
# Represents the colour SWAP will use in the memory legend and graph.
#swap_color="LightYellow"
# Represents the colour rx will use in the network legend and graph.
#rx_color="LightCyan"
# Represents the colour tx will use in the network legend and graph.
#tx_color="LightGreen"
# Represents the colour of the border of unselected widgets.
#border_color="Gray"
# Represents the colour of the border of selected widgets.
#highlighted_border_color="LightBlue"
# Represents the colour of most text.
#text_color="Gray"
# Represents the colour of text that is selected.
#selected_text_color="Black"
# Represents the background colour of text that is selected.
#selected_bg_color="LightBlue"
# Represents the colour of the lines and text of the graph.
#graph_color="Gray"
# Represents the colours of the battery based on charge
#high_battery_color="green"
#medium_battery_color="yellow"
#low_battery_color="red"
# Layout - layouts follow a pattern like this:
# [[row]] represents a row in the application.
# [[row.child]] represents either a widget or a column.
# [[row.child.child]] represents a widget.
#
# All widgets must have the type value set to one of ["cpu", "mem", "proc", "net", "temp", "disk", "empty"].
# All layout components have a ratio value - if this is not set, then it defaults to 1.
# The default widget layout:
#[[row]]
# ratio=30
# [[row.child]]
# type="cpu"
#[[row]]
# ratio=40
# [[row.child]]
# ratio=4
# type="mem"
# [[row.child]]
# ratio=3
# [[row.child.child]]
# type="temp"
# [[row.child.child]]
# type="disk"
#[[row]]
# ratio=30
# [[row.child]]
# type="net"
# [[row.child]]
# type="proc"
# default=true
# Filters - you can hide specific temperature sensors, network interfaces, and disks using filters. This is admittedly
# a bit hard to use as of now, and there is a planned in-app interface for managing this in the future:
#[disk_filter]
#is_list_ignored = true
#list = ["/dev/sda\\d+", "/dev/nvme0n1p2"]
#regex = true
#case_sensitive = false
#whole_word = false
#[mount_filter]
#is_list_ignored = true
#list = ["/mnt/.*", "/boot"]
#regex = true
#case_sensitive = false
#whole_word = false
#[temp_filter]
#is_list_ignored = true
#list = ["cpu", "wifi"]
#regex = false
#case_sensitive = false
#whole_word = false
#[net_filter]
#is_list_ignored = true
#list = ["virbr0.*"]
#regex = true
#case_sensitive = false
#whole_word = false

49
.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,49 @@
#!/bin/sh
# Running events
# ----------------------------------------------------------------------------
xsetroot -cursor_name left_ptr
picom --experimental-backends &
polybar example &
light -S 75
nitrogen --restore &
betterlockscreen -u ~/Pictures/wallpapers/astronaut-watching-sunset-on-mars.jpg --blur 0.45 --display 1 --span &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
dunst -config ~/.config/dunst/dunstrc &
/home/q/bin/battery &
# ----------------------------------------------------------------------------
pgrep -x sxhkd > /dev/null || sxhkd &
bspc monitor -d    
# Smart Gaps
bspc config single_monocle true
bspc config gapless_monocle true
# Gaps
bspc config border_width 2
bspc config window_gap 8
# Set color border
bspc config focused_border_color '#BB9AF7'
bspc config active_border_color '#0C1115'
bspc config normal_border_color '#0C1115'
bspc config split_ratio 1.5
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_follows_pointer true
bspc config pointer_modifier super
# Set floating window size
bspc rule --add kitty rectangle=750x500+400+200
# Configure allways floating window
bspc rule -a KotatogramDesktop state=floating follow=off rectangle=666x823+8-26 desktop='^2'
bspc rule -a Steam state=floating follow=off rectangle=1105x777+226-57
bspc rule -a spotify state=floatig follow=off rectangle=1492x848+53-13
bspc rule -a Nitrogen state=floating follow=off rectangle=712x563+429+157
bspc rule -a mpv state=floating follow=off rectangle=800x450+560+315
bspc rule -a virt-manager state=floating follow=off rectangle=900x600
bspc rule -a keepassxc state=floating follow=off rectangle=900x900 desktop='^3'

456
.config/dunst/dunstrc Normal file
View File

@ -0,0 +1,456 @@
# See dunst(5) for all configuration options
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = (111,444)
# The maximum height of a single notification, excluding the frame.
height = 222
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = 10x50
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 0
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 10
# Set the frame width of the progress bar
progress_bar_frame_width = 1
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 300
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#16161E"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 0
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = Iosevka 10
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup)
icon_theme = Adwaita
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 32
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 128
# Paths to default icons (only neccesary when not using recursive icon lookup)
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 5
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#1A1B26"
foreground = "#A9B1D6"
highlight = "#A9B1D6"
timeout = 6
# Icon for notifications with low urgency, uncomment to enable
# default_icon = ~/.config/dunst/icons/notification.png
[urgency_normal]
background = "#1A1B26"
foreground = "#A9B1D6"
highlight = "#A9B1D6"
timeout = 6
# Icon for notifications with normal urgency, uncomment to enable
default_icon = /home/q/.config/dunst/icons/notification.png
[urgency_critical]
background = "#1A1B26"
foreground = "#A9B1D6"
highlight = "#A9B1D6"
timeout = 10
# Icon for notifications with critical urgency, uncomment to enable
# default_icon = ~/.config/dunst/icons/notification.png
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# icon_position
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
# hide_text
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,7 @@
complete --command fisher --exclusive --long help --description "Print help"
complete --command fisher --exclusive --long version --description "Print version"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"

View File

@ -0,0 +1,21 @@
complete --command nvm --exclusive
complete --command nvm --exclusive --long version --description "Print version"
complete --command nvm --exclusive --long help --description "Print help"
complete --command nvm --long silent --description "Suppress standard output"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
test -e $nvm_data && string split ' ' <$nvm_data/.index
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
_nvm_list | string split ' ' | string replace system ''
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
set --query nvm_default_version && echo default
)"

View File

@ -0,0 +1,28 @@
function _nvm_install --on-event nvm_install
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
set --universal nvm_data $XDG_DATA_HOME/nvm
test ! -d $nvm_data && command mkdir -p $nvm_data
echo "Downloading the Node distribution index..." 2>/dev/null
_nvm_index_update
end
function _nvm_update --on-event nvm_update
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
set --universal nvm_data $XDG_DATA_HOME/nvm
end
function _nvm_uninstall --on-event nvm_uninstall
command rm -rf $nvm_data
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source
functions --erase (functions --all | string match --entire --regex -- "^_nvm_")
end
if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
nvm use --silent $nvm_default_version
end

20
.config/fish/config.fish Normal file
View File

@ -0,0 +1,20 @@
if status is-interactive
alias ls="lsd"
alias nv="nvim"
alias gc="git clone"
alias gst="git status"
alias bat="bat -p"
alias recscreen="ffmpeg -f x11grab -y -framerate 30 -s 1600x900 -i :0.0 -c:v libx264 -preset superfast -crf 18 "Video/$(date +'%Y-%m-%d_%H:%M').mp4""
alias la="lsd -la"
set -x PF_INFO "ascii title os kernel wm shell pkgs memory"
set srcdir "$HOME/.cache/"
set pkgdir "$HOME/.npm/"
alias npm="npm --cache $srcir/npm-cache"
set fish_greeting
# Commands to run in interactive sessions can go here
end

View File

@ -0,0 +1,2 @@
jorgebucaran/fisher
jorgebucaran/nvm.fish

View File

@ -0,0 +1,48 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3400
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish
SETUVAR _fisher_upgraded_to_4_4:\x1d
SETUVAR fish_color_autosuggestion:4D5566
SETUVAR fish_color_cancel:\x2d\x2dreverse
SETUVAR fish_color_command:39BAE6
SETUVAR fish_color_comment:626A73
SETUVAR fish_color_cwd:59C2FF
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:F29668
SETUVAR fish_color_error:FF3333
SETUVAR fish_color_escape:95E6CB
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:\x1d
SETUVAR fish_color_keyword:\x1d
SETUVAR fish_color_match:F07178
SETUVAR fish_color_normal:B3B1AD
SETUVAR fish_color_operator:E6B450
SETUVAR fish_color_option:\x1d
SETUVAR fish_color_param:B3B1AD
SETUVAR fish_color_quote:C2D94C
SETUVAR fish_color_redirection:FFEE99
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3dE6B450
SETUVAR fish_color_selection:\x2d\x2dbackground\x3dE6B450
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_background:\x1d
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_secondary_background:\x1d
SETUVAR fish_pager_color_secondary_completion:\x1d
SETUVAR fish_pager_color_secondary_description:\x1d
SETUVAR fish_pager_color_secondary_prefix:\x1d
SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dE6B450
SETUVAR fish_pager_color_selected_completion:\x1d
SETUVAR fish_pager_color_selected_description:\x1d
SETUVAR fish_pager_color_selected_prefix:\x1d
SETUVAR nvm_data:/home/q/\x2elocal/share/nvm
SETUVAR nvm_mirror:https\x3a//nodejs\x2eorg/dist

View File

@ -0,0 +1,20 @@
function _nvm_index_update
test ! -d $nvm_data && command mkdir -p $nvm_data
set --local index $nvm_data/.index
if not command curl --location --silent $nvm_mirror/index.tab >$index.temp
command rm -f $index.temp
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
return 1
end
command awk -v OFS=\t '
/v0.9.12/ { exit } # Unsupported
NR > 1 {
print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
}
' $index.temp >$index
command rm -f $index.temp
end

View File

@ -0,0 +1,11 @@
function _nvm_list
set --local versions $nvm_data/*
set --query versions[1] &&
string match --entire --regex -- (string match --regex -- "v\d.+" $versions |
string escape --style=regex |
string join "|"
) <$nvm_data/.index
command --all node |
string match --quiet --invert --regex -- "^$nvm_data" && echo system
end

View File

@ -0,0 +1,4 @@
function _nvm_version_activate --argument-names ver
set --global --export nvm_current_version $ver
set --prepend PATH $nvm_data/$ver/bin
end

View File

@ -0,0 +1,5 @@
function _nvm_version_deactivate --argument-names ver
test "$nvm_current_version" = "$ver" && set --erase nvm_current_version
set --local index (contains --index -- $nvm_data/$ver/bin $PATH) &&
set --erase PATH[$index]
end

View File

@ -0,0 +1,56 @@
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
prompt_login
echo -n ':'
# PWD
set_color $fish_color_cwd
echo -n (prompt_pwd)
set_color normal
set -q __fish_git_prompt_showdirtystate
or set -g __fish_git_prompt_showdirtystate 1
set -q __fish_git_prompt_showuntrackedfiles
or set -g __fish_git_prompt_showuntrackedfiles 1
set -q __fish_git_prompt_showcolorhints
or set -g __fish_git_prompt_showcolorhints 1
set -q __fish_git_prompt_color_untrackedfiles
or set -g __fish_git_prompt_color_untrackedfiles yellow
set -q __fish_git_prompt_char_untrackedfiles
or set -g __fish_git_prompt_char_untrackedfiles '?'
set -q __fish_git_prompt_color_invalidstate
or set -g __fish_git_prompt_color_invalidstate red
set -q __fish_git_prompt_char_invalidstate
or set -g __fish_git_prompt_char_invalidstate '!'
set -q __fish_git_prompt_color_dirtystate
or set -g __fish_git_prompt_color_dirtystate blue
set -q __fish_git_prompt_char_dirtystate
or set -g __fish_git_prompt_char_dirtystate '*'
set -q __fish_git_prompt_char_stagedstate
or set -g __fish_git_prompt_char_stagedstate '✚'
set -q __fish_git_prompt_color_cleanstate
or set -g __fish_git_prompt_color_cleanstate green
set -q __fish_git_prompt_char_cleanstate
or set -g __fish_git_prompt_char_cleanstate '✓'
set -q __fish_git_prompt_color_stagedstate
or set -g __fish_git_prompt_color_stagedstate yellow
set -q __fish_git_prompt_color_branch_dirty
or set -g __fish_git_prompt_color_branch_dirty red
set -q __fish_git_prompt_color_branch_staged
or set -g __fish_git_prompt_color_branch_staged yellow
set -q __fish_git_prompt_color_branch
or set -g __fish_git_prompt_color_branch green
set -q __fish_git_prompt_char_stateseparator
or set -g __fish_git_prompt_char_stateseparator '⚡'
fish_vcs_prompt '|%s'
echo
if not test $last_status -eq 0
set_color $fish_color_error
end
echo -n '➤ '
set_color normal
end

View File

@ -0,0 +1,240 @@
function fisher --argument-names cmd --description "A plugin manager for Fish"
set --query fisher_path || set --local fisher_path $__fish_config_dir
set --local fisher_version 4.4.2
set --local fish_plugins $__fish_config_dir/fish_plugins
switch "$cmd"
case -v --version
echo "fisher, version $fisher_version"
case "" -h --help
echo "Usage: fisher install <plugins...> Install plugins"
echo " fisher remove <plugins...> Remove installed plugins"
echo " fisher update <plugins...> Update installed plugins"
echo " fisher update Update all installed plugins"
echo " fisher list [<regex>] List installed plugins matching regex"
echo "Options:"
echo " -v or --version Print version"
echo " -h or --help Print this help message"
echo "Variables:"
echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~
case ls list
string match --entire --regex -- "$argv[2]" $_fisher_plugins
case install update remove
isatty || read --local --null --array stdin && set --append argv $stdin
set --local install_plugins
set --local update_plugins
set --local remove_plugins
set --local arg_plugins $argv[2..-1]
set --local old_plugins $_fisher_plugins
set --local new_plugins
test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins)
if ! set --query argv[2]
if test "$cmd" != update
echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1
else if ! set --query file_plugins
echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
end
set arg_plugins $file_plugins
end
for plugin in $arg_plugins
set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin)
contains -- "$plugin" $new_plugins || set --append new_plugins $plugin
end
if set --query argv[2]
for plugin in $new_plugins
if contains -- "$plugin" $old_plugins
test "$cmd" = remove &&
set --append remove_plugins $plugin ||
set --append update_plugins $plugin
else if test "$cmd" = install
set --append install_plugins $plugin
else
echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1
end
end
else
for plugin in $new_plugins
contains -- "$plugin" $old_plugins &&
set --append update_plugins $plugin ||
set --append install_plugins $plugin
end
for plugin in $old_plugins
contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin
end
end
set --local pid_list
set --local source_plugins
set --local fetch_plugins $update_plugins $install_plugins
set --local fish_path (status fish-path)
echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal)
for plugin in $fetch_plugins
set --local source (command mktemp -d)
set --append source_plugins $source
command mkdir -p $source/{completions,conf.d,themes,functions}
$fish_path --command "
if test -e $plugin
command cp -Rf $plugin/* $source
else
set temp (command mktemp -d)
set repo (string split -- \@ $plugin) || set repo[2] HEAD
if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1])
set name (string split -- / \$path)[-1]
set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz
else
set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2]
end
echo Fetching (set_color --underline)\$url(set_color normal)
if curl --silent -L \$url | tar -xzC \$temp -f - 2>/dev/null
command cp -Rf \$temp/*/* $source
else
echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2
command rm -rf $source
end
command rm -rf \$temp
end
set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files
" &
set --append pid_list (jobs --last --pid)
end
wait $pid_list 2>/dev/null
for plugin in $fetch_plugins
if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
if set --local index (contains --index -- "$plugin" $install_plugins)
set --erase install_plugins[$index]
else
set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)]
end
end
end
for plugin in $update_plugins $remove_plugins
if set --local index (contains --index -- "$plugin" $_fisher_plugins)
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
if contains -- "$plugin" $remove_plugins
for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var)
emit {$name}_uninstall
end
printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
set --erase _fisher_plugins[$index]
end
command rm -rf (string replace -- \~ ~ $$plugin_files_var)
functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var)
for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var)
complete --erase --command $name
end
set --erase $plugin_files_var
end
end
if set --query update_plugins[1] || set --query install_plugins[1]
command mkdir -p $fisher_path/{functions,themes,conf.d,completions}
end
for plugin in $update_plugins $install_plugins
set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)]
set --local files $source/{functions,themes,conf.d,completions}/*
if set --local index (contains --index -- $plugin $install_plugins)
set --local user_files $fisher_path/{functions,themes,conf.d,completions}/*
set --local conflict_files
for file in (string replace -- $source/ $fisher_path/ $files)
contains -- $file $user_files && set --append conflict_files $file
end
if set --query conflict_files[1] && set --erase install_plugins[$index]
echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2
continue
end
end
for file in (string replace -- $source/ "" $files)
command cp -Rf $source/$file $fisher_path/$file
end
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~)
contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin
contains -- $plugin $install_plugins && set --local event install || set --local event update
printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~)
source $file
if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file)
emit {$name}_$event
end
end
end
command rm -rf $source_plugins
if set --query _fisher_plugins[1]
set --local commit_plugins
for plugin in $file_plugins
contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin
end
for plugin in $_fisher_plugins
contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin
end
printf "%s\n" $commit_plugins >$fish_plugins
else
set --erase _fisher_plugins
command rm -f $fish_plugins
end
set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
test "$total" != "0 0 0" && echo (string join ", " (
test $total[1] = 0 || echo "Installed $total[1]") (
test $total[2] = 0 || echo "Updated $total[2]") (
test $total[3] = 0 || echo "Removed $total[3]")
) plugin/s
case \*
echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1
end
end
if ! set --query _fisher_upgraded_to_4_4
set --universal _fisher_upgraded_to_4_4
if functions --query _fisher_list
set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share
command rm -rf $XDG_DATA_HOME/fisher
functions --erase _fisher_{list,plugin_parse}
fisher update >/dev/null 2>/dev/null
else
for var in (set --names | string match --entire --regex '^_fisher_.+_files$')
set $var (string replace -- ~ \~ $$var)
end
functions --erase _fisher_fish_postexec
end
end

View File

@ -0,0 +1,230 @@
function nvm --description "Node version manager"
for silent in --silent -s
if set --local index (contains --index -- $silent $argv)
set --erase argv[$index] && break
end
set --erase silent
end
set --local cmd $argv[1]
set --local ver $argv[2]
if set --query silent && ! set --query cmd[1]
echo "nvm: Version number not specified (see nvm -h for usage)" >&2
return 1
end
if ! set --query ver[1] && contains -- "$cmd" install use
for file in .nvmrc .node-version
set file (_nvm_find_up $PWD $file) && read ver <$file && break
end
if ! set --query ver[1]
echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
return 1
end
end
set --local their_version $ver
switch "$cmd"
case -v --version
echo "nvm, version 2.2.11"
case "" -h --help
echo "Usage: nvm install <version> Download and activate the specified Node version"
echo " nvm install Install version from nearest .nvmrc file"
echo " nvm use <version> Activate a version in the current shell"
echo " nvm use Activate version from nearest .nvmrc file"
echo " nvm list List installed versions"
echo " nvm list-remote List versions available to install"
echo " nvm list-remote <regex> List versions matching a given regular expression"
echo " nvm current Print the currently-active version"
echo " nvm uninstall <version> Uninstall a version"
echo "Options:"
echo " -s or --silent Suppress standard output"
echo " -v or --version Print version"
echo " -h or --help Print this help message"
echo "Variables:"
echo " nvm_arch Override architecture, e.g. x64-musl"
echo " nvm_mirror Use a mirror of the Node binaries"
echo " nvm_default_version Set the default version for new shells"
echo " nvm_default_packages Install a list of packages every time you install a Node version"
case install
_nvm_index_update
string match --entire --regex -- (_nvm_version_match $ver) <$nvm_data/.index | read ver alias
if ! set --query ver[1]
echo "nvm: Invalid version number or alias: \"$their_version\"" >&2
return 1
end
if test ! -e $nvm_data/$ver
set --local os (command uname -s | string lower)
set --local ext tar.gz
set --local arch (command uname -m)
switch $os
case aix
set arch ppc64
case sunos
case linux
case darwin
case {MSYS_NT,MINGW\*_NT}\*
set os win
set ext zip
case \*
echo "nvm: Unsupported operating system: \"$os\"" >&2
return 1
end
switch $arch
case i\*86
set arch x86
case x86_64
set arch x64
case arm64
string match --regex --quiet "v(?<major>\d+)" $ver
if test "$os" = darwin -a $major -lt 16
set arch x64
end
case armv6 armv6l
set arch armv6l
case armv7 armv7l
set arch armv7l
case armv8 armv8l aarch64
set arch arm64
end
set --query nvm_arch && set arch $nvm_arch
set --local dir "node-$ver-$os-$arch"
set --local url $nvm_mirror/$ver/$dir.$ext
command mkdir -p $nvm_data/$ver
if ! set --query silent
echo -e "Installing Node \x1b[1m$ver\x1b[22m $alias"
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
end
if ! command curl $silent --progress-bar --location $url |
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
command rm -rf $nvm_data/$ver
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
return 1
end
set --query silent || echo -en "\033[F\33[2K\x1b[0m"
if test "$os" = win
command mv $nvm_data/$ver/$dir $nvm_data/$ver/bin
else
command mv $nvm_data/$ver/$dir/* $nvm_data/$ver
command rm -rf $nvm_data/$ver/$dir
end
end
if test $ver != "$nvm_current_version"
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
_nvm_version_activate $ver
set --query nvm_default_packages[1] && npm install --global $silent $nvm_default_packages
end
set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
case use
test $ver = default && set ver $nvm_default_version
_nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
if ! set --query ver[1]
echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2
return 1
end
if test $ver != "$nvm_current_version"
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
test $ver != system && _nvm_version_activate $ver
end
set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
case uninstall
if test -z "$ver"
echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
return 1
end
test $ver = default && test ! -z "$nvm_default_version" && set ver $nvm_default_version
_nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
if ! set -q ver[1]
echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2
return 1
end
set --query silent || printf "Uninstalling Node %s %s\n" $ver (string replace ~ \~ "$nvm_data/$ver/bin/node")
_nvm_version_deactivate $ver
command rm -rf $nvm_data/$ver
case current
_nvm_current
case ls list
_nvm_list | _nvm_list_format (_nvm_current) $argv[2]
case lsr {ls,list}-remote
_nvm_index_update || return
_nvm_list | command awk '
FILENAME == "-" && (is_local[$1] = FNR == NR) { next } {
print $0 (is_local[$1] ? " ✓" : "")
}
' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
case \*
echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h for usage)" >&2
return 1
end
end
function _nvm_find_up --argument-names path file
test -e "$path/$file" && echo $path/$file || begin
test ! -z "$path" || return
_nvm_find_up (string replace --regex -- '/[^/]*$' "" $path) $file
end
end
function _nvm_version_match --argument-names ver
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver |
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
string escape --style=regex ||
string lower '\b'$ver'(?:/\w+)?$'
end
function _nvm_list_format --argument-names current regex
command awk -v current="$current" -v regex="$regex" '
$0 ~ regex {
aliases[versions[i++] = $1] = $2 " " $3
pad = (n = length($1)) > pad ? n : pad
}
END {
if (!i) exit 1
while (i--)
printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n",
versions[i], aliases[versions[i]])
}
'
end
function _nvm_current
command --search --quiet node || return
set --query nvm_current_version && echo $nvm_current_version || echo system
end
function _nvm_node_info
set --local npm_path (string replace bin/npm-cli.js "" (realpath (command --search npm)))
test -f $npm_path/package.json || set --local npm_version_default (command npm --version)
command node --eval "
console.log(process.version)
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
console.log(process.execPath.replace(require('os').homedir(), '~'))
"
end

9
.config/git/config Normal file
View File

@ -0,0 +1,9 @@
[init]
defaultbranch = main
[user]
email = hok7zv@tutanota.com
name = hok7z
[core]
editor = nvim
pager = less
excludesfile = .gitignore

View File

@ -0,0 +1,11 @@
[Filechooser Settings]
LocationMode=path-bar
ShowHidden=true
ShowSizeColumn=true
GeometryX=380
GeometryY=135
GeometryWidth=840
GeometryHeight=630
SortColumn=name
SortOrder=ascending
StartupMode=recent

19
.config/gtk-2.0/gtkrc Normal file
View File

@ -0,0 +1,19 @@
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
include "/home/q/.gtkrc-2.0.mine"
gtk-theme-name="Tokyonight-Dark-B"
gtk-icon-theme-name="Papirus"
gtk-font-name="Cantarell 11"
gtk-cursor-theme-name="Adwaita"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-rgba="rgb"

10
.config/gtk-3.0/gtk.css Normal file
View File

@ -0,0 +1,10 @@
.window-frame, .window-frame:backdrop {
box-shadow: 0 0 0 black;
border-style: none;
margin: 0;
border-radius: 0;
}
.titlebar {
border-radius: 0;
}

View File

@ -0,0 +1,18 @@
[Settings]
gtk-theme-name=Tokyonight-Dark-B
gtk-icon-theme-name=Papirus
gtk-font-name=Cantarell 11
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=rgb

Binary file not shown.

View File

@ -0,0 +1,11 @@
This is the IPython startup directory
.py and .ipy files in this directory will be run *prior* to any code or files specified
via the exec_lines or exec_files configurables whenever you load this profile.
Files will be run in lexicographical order, so you can control the execution order of files
with a prefix, e.g.::
00-first.py
50-middle.py
99-last.ipy

101
.config/kitty/kitty.conf Normal file
View File

@ -0,0 +1,101 @@
#font_family Comic Mono
#bold_font Comic Mono
#font_size 13
# font_family Iosevka
# bold_font Iosevka
# italic_font Iosevka
# bold_italic_font Iosevka
# font_size 15
font_family JetBrains Mono
bold_font JetBrains Mono
italic_font JetBrains Mono
bold_italic_font JetBrains Mono
font_size 14
background_opacity 0.9
# font_family FiraCode Nerd Font
# bold_font FiraCode Nerd Font Mono
# italic_font FiraCode Nerd Font Mono
# bold_italic_font FiraCode Nerd Font Mono
# font_size 13
remember_window_size yes
initial_window_width 148c
initial_window_height 42c
draw_minimal_borders no
window_margin_width 1
disable_ligatures never
enable_audio_bell no
tab_bar_edge top
hide_window_decorations yes
editor nvim
enabled_layouts tall, grid, fat
tab_bar_style separator
active_tab_font_style bold
active_tab_background #666
tab_separator " ┃ "
scrollback_pager nvim -R
touch_scroll_multiplier 5.0
## name: Tokyo Night Storm
## author: Folke Lemaitre
background #24283b
foreground #c0caf5
selection_background #364A82
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5
# Tabs
active_tab_background #7aa2f7
active_tab_foreground #1f2335
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #1D202F
# normal
color0 #1D202F
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6
# bright
color8 #414868
color9 #f7768e
color10 #9ece6a
color11 #e0af68
color12 #7aa2f7
color13 #bb9af7
color14 #7dcfff
color15 #c0caf5
# extended colors
color16 #ff9e64
color17 #db4b4b
map ctrl+shift+enter new_window_with_cwd
map ctrl+shift+space new_window_with_cwd
map ctrl+alt+h move_window left
map ctrl+alt+j move_window down
map ctrl+alt+k move_window up
map ctrl+alt+l move_window right
map ctrl+shift+h neighboring_window left
map ctrl+shift+j neighboring_window down
map ctrl+shift+k neighboring_window up
map ctrl+shift+l neighboring_window right
map ctrl+shift+alt+l next_layout
map ctrl+shift+i show_scrollback
map ctrl+shift+] next_tab
map ctrl+shift+[ previous_tab
map ctrl+alt+] move_tab_forward
map ctrl+alt+[ move_tab_backward

3
.config/nvim/ginit.vim Normal file
View File

@ -0,0 +1,3 @@
GuiFont! Iosevka:h15
GuiTabline 0
GuiPopupmenu 0

13
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,13 @@
local core = {
"options",
"mappings",
"autocmds",
"plugins"
}
for _,source in ipairs(core) do
local status_ok,fault = pcall(require,'core.' .. source)
if not status_ok then
vim.notify("Failed to load " .. source .."\n\n" .. fault )
end
end

View File

@ -0,0 +1,20 @@
vim.api.nvim_create_autocmd({"WinEnter","BufEnter"},{
callback = function()
vim.opt.statusline = "%F"
end
})
vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter","WinEnter","CmdwinEnter"},{
callback = function()
if vim.fn.expand("%") == "NvimTree_1" then
vim.opt.statusline = " NvimTree"
end
end,
})
vim.api.nvim_create_autocmd({"BufEnter","BufWinEnter"},{
pattern = {"*.json"},
callback = function()
vim.lsp.buf.formatting()
end,
})

View File

@ -0,0 +1,88 @@
return {
kind = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = ""
},
diagnostic = {
default = {
{ name = "Error",icon = "", color = "Default" },
{ name = "Warn", icon = "", color = "Default" },
{ name = "Info", icon = "", color = "Default" },
{ name = "Hint", icon = "", color = "Default" },
},
catppuccin = {
{ name = "Error", icon = "", color = "Default" },
{ name = "Warn", icon = "", color = "Default" },
{ name = "Info", icon = "", color = "Default" },
{ name = "Hint", icon = "", color = "Default" }
},
},
ui = {
ArrowClosed = "",
ArrowOpen = "",
Lock = "",
Circle = "",
BigCircle = "",
BigUnfilledCircle = "",
Close = "",
NewFile = "",
Search = "",
Lightbulb = "",
Project = "",
Dashboard = "",
History = "",
Comment = "",
Bug = "",
Code = "",
Telescope = "",
Gear = "",
Package = "",
List = "",
SignIn = "",
SignOut = "",
Check = "",
Fire = "",
Note = "",
BookMark = "",
Pencil = "",
ChevronRight = "",
Table = "",
Calendar = "",
CloudDownload = "",
},
notify = {
ERROR = "",
WARN = "",
INFO = "",
DEBUG = "",
TRACE = "",
},
}

View File

@ -0,0 +1,58 @@
local keymap = vim.keymap.set
vim.g.mapleader = " "
keymap("n","<space>,",":nohlsearch<CR>")
keymap("n","<leader>m",":MarkdownPreview<CR>")
-- Block arrows
vim.api.nvim_set_keymap('', '<up>', '<nop>', {noremap = true})
vim.api.nvim_set_keymap('', '<down>', '<nop>', {noremap = true})
vim.api.nvim_set_keymap('', '<left>', '<nop>', {noremap = true})
vim.api.nvim_set_keymap('', '<right>', '<nop>',{noremap = true})
-- resize
keymap("n","<C-k>",":resize -2<CR>")
keymap("n","<C-j>",":resize 2<CR>")
keymap("n","<C-h>",":vertical resize -2<CR>")
keymap("n","<C-l>",":vertical resize 2<CR>")
-- tabs
keymap("n","<leader>tn",":tabnew <CR>")
keymap("n","<leader>tc",":tabclose<CR>")
-- NvimTree --
keymap("n","<C-n>",":NvimTreeToggle<CR>")
keymap("n","<leader>n",":NvimTreeFindFile<CR>")
keymap("n","<C-]>","gh defx#do_action('cd',getcwd())<CR>")
-- Telescope --
keymap("n","<leader>ff","<cmd> Telescope find_files <cr>")
keymap("n","<leader>fg","<cmd> Telescope live_grep <cr>")
keymap("n","<leader>fb","<cmd> Telescope buffers <cr>")
keymap("n","<leader>fh","<cmd> Telescope help_tags <cr>")
-- barbar.nvim
keymap('n', '<A-,>', ':BufferPrevious<CR>')
keymap('n', '<A-.>', ':BufferNext<CR>')
-- Re-order to previous/next
keymap('n', '<A-<>', ':BufferMovePrevious<CR>')
keymap('n', '<A->>', ' :BufferMoveNext<CR>')
-- Goto buffer in position...
keymap('n', '<A-1>', ':BufferGoto 1<CR>')
keymap('n', '<A-2>', ':BufferGoto 2<CR>')
keymap('n', '<A-3>', ':BufferGoto 3<CR>')
keymap('n', '<A-4>', ':BufferGoto 4<CR>')
keymap('n', '<A-5>', ':BufferGoto 5<CR>')
keymap('n', '<A-6>', ':BufferGoto 6<CR>')
keymap('n', '<A-7>', ':BufferGoto 7<CR>')
keymap('n', '<A-8>', ':BufferGoto 8<CR>')
keymap('n', '<A-9>', ':BufferGoto 9<CR>')
keymap('n', '<A-0>', ':BufferLast<CR>')
-- Close buffer
keymap('n', '<A-c>', ':BufferClose<CR>')

View File

@ -0,0 +1,77 @@
local opt = vim.opt
vim.g.did_load_filetypes = 1
opt.encoding = "utf-8"
opt.clipboard = "unnamedplus"
opt.swapfile = false
vim.g.icons = require("core.icons")
local ok,notify = pcall(require,"notify")
if ok then
vim.notify = notify
end
opt.termguicolors = true
opt.listchars = {eol = '', tab = '', trail = '·'}
local ok,utils = pcall(require,"core.utils")
if (not ok) then
vim.notify("Can't load utils")
end
-- utils.run_colorscheme("vscode",function()
-- -- https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#custom-menu-direction
-- utils.highlight("CmpItemAbbrDeprecated", {guibg=NONE,gui=strikethrough,guifg=#808080})
--
-- utils.highlight("CmpItemAbbrMatch", {guibg=NONE,guifg=#569CD6})
-- utils.highlight("CmpItemAbbrMatchFuzzy", {guibg=NONE,guifg=#569CD6})
--
-- utils.highlight("CmpItemKindVariable", {guibg=NONE,guifg=#9CDCFE})
-- utils.highlight("CmpItemKindInterface", {guibg=NONE,guifg=#9CDCFE})
-- utils.highlight("CmpItemKindText", {guibg=NONE,guifg=#9CDCFE})
--
-- utils.highlight("CmpItemKindFunction", {guibg=NONE,guifg=#C586C0})
-- utils.highlight("CmpItemKindMethod", {guibg=NONE,guifg=#C586C0})
--
-- utils.highlight("CmpItemKindKeyword", {guibg=NONE guifg=#D4D4D4})
-- utils.highlight("CmpItemKindProperty", {guibg=NONE guifg=#D4D4D4})
-- utils.highlight("CmpItemKindUnit", {guibg=NONE guifg=#D4D4D4})
--
-- vim.g.diagnostic_signs = vim.g.icons.diagnostics.default
-- end)
-- utils.run_colorscheme("github-dark",function()
-- require("github-theme").setup({
-- theme_style = "dark_default",
-- function_style = "italic",
-- sidebars = { "qf", "vista_kind", "terminal", "packer" },
-- hide_inactive_statusline = false,
-- })
--
-- vim.g.diagnostic_signs = {
-- {name = "Error",icon = " ", color = "Default"},
-- {name = "Warn", icon = " ", color = "Default"},
-- {name = "Info", icon = " ", color = "Default"},
-- {name = "Hint", icon = " ", color = "Default"},
-- }
-- end)
utils.run_colorscheme("catppuccin",function()
vim.g.catppucin_flavor = "mocha" -- latte, frappe, macchiato, mocha
vim.g.diagnostics_signs = vim.g.icons.diagnostic.catppuccin
end)
-- statusline = require("core.statusline")
-- opt.statusline = "%!luaeval('statusline.active()')"
opt.number = true
opt.mouse = "a"
opt.relativenumber = true
opt.tabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
opt.ts = 4
opt.sw = 4
opt.splitright = true

View File

@ -0,0 +1,292 @@
local ok,packer = pcall(require,"packer")
if not ok then
vim.notify("Failed to load packer\n\n")
return
end
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*/core/plugins.lua",
callback = function(arg)
vim.cmd("source "..arg.file)
vim.cmd("PackerInstall")
end,
})
packer.startup{
function(use)
use {"wbthomason/packer.nvim"}
use {"nathom/filetype.nvim"}
-- Colorchemes
use {"catppuccin/nvim",as = "catppuccin"}
use {"rebelot/kanagawa.nvim"}
use {"tiagovla/tokyodark.nvim"}
use {"folke/tokyonight.nvim"}
use {"navarasu/onedark.nvim"}
use {"projekt0n/github-nvim-theme"}
use {"Mofiqul/vscode.nvim"}
use {
"norcalli/nvim-colorizer.lua",
config = function() require'colorizer'.setup() end
}
use {"dstein64/vim-startuptime"}
use {
"lukas-reineke/indent-blankline.nvim",
config = function()
require("indent_blankline").setup{
show_end_of_line = true,
space_char_blankline = " ",
}
end
}
use {
"windwp/nvim-autopairs",
config = function() require("nvim-autopairs").setup() end
}
use {
"nacro90/numb.nvim",
config = function() require('numb').setup() end
}
use {
"numToStr/Comment.nvim",
config = function() require('Comment').setup() end
}
use {
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup{keymaps = {}}
end
}
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function() require("todo-comments").setup() end
}
use {"davidgranstrom/nvim-markdown-preview"}
use {
"nvim-telescope/telescope.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = function()
local actions = require('telescope.actions')
require('telescope').setup{
defaults = {
mappings = {
n = {
["q"] = actions.close
},
},
}
}
end
}
use {
"akinsho/toggleterm.nvim", tag = 'v2.*',
config = function() require("toggleterm").setup() end
}
use {
"kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" },
config = function() require("plugins.nvim-tree") end
}
use {
"rcarriga/nvim-notify",
config = function()
local notify = require("notify")
notify.setup{
level = "info",
stages = "fade_in_slide_out",
on_open = nil,
on_close = nil,
render = "default",
timeout = 5000,
max_width = nil,
max_height = nil,
background_colour = "Normal",
minimum_width = 50,
icons = vim.g.icons.notify,
}
end
}
-- TODO: write own statusline
-- use {
-- "nvim-lualine/lualine.nvim",
-- requires = { 'kyazdani42/nvim-web-devicons',opt = true},
-- config = function() require("plugins.lualine") end
-- }
use {
'romgrk/barbar.nvim',
requires = {'kyazdani42/nvim-web-devicons'},
config = function() require("plugins.barbar") end,
}
use {
'pwntester/octo.nvim',
requires = {
'nvim-lua/plenary.nvim',
},
config = function() require"octo".setup() end
}
use {
"sindrets/diffview.nvim",
requires = 'nvim-lua/plenary.nvim'
}
use {
"nvim-treesitter/nvim-treesitter",
requires = {
"nvim-treesitter/playground",
"nvim-treesitter/nvim-treesitter-textobjects",
},
run = function() vim.cmd("TSUpdate") end,
config = function() require("plugins.treesitter") end
}
-- Language Server Protocol
use {
"neovim/nvim-lspconfig",
config = function() require("plugins.lsp") end
}
use {
"j-hui/fidget.nvim",
config = function() require"fidget".setup() end
}
use {
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-cmdline",
},
config = function() require("plugins.cmp") end
}
use {
"onsails/lspkind-nvim",
config = function()
local lspkind = require("lspkind")
lspkind.init{
mode = 'symbol_text',
preset = 'codicons',
symbol_map = vim.g.icons.kind
}
end
}
use {
"L3MON4D3/LuaSnip",
requires = {
"rafamadriz/friendly-snippets",
},
config = function()
require("luasnip/loaders/from_vscode").lazy_load()
end
}
use {
"ray-x/lsp_signature.nvim",
config = function()
local lsp_signature = require("lsp_signature")
lsp_signature.setup{
hint_enable = false,
verbose = true
}
end
}
use {
"SmiteshP/nvim-gps",
requires = "nvim-treesitter/nvim-treesitter",
config = function() require("nvim-gps").setup() end,
}
use {
"jose-elias-alvarez/null-ls.nvim",
config = function() require("plugins.null-ls") end
}
-- Debug Adapter Protocol
use {
"mfussenegger/nvim-dap",
requires = {
"arywz11/DAPInstall.nvim",
"rcarriga/nvim-dap-ui"
},
config = function() require("plugins.dap") end,
}
end,
config = {
display = {
open_fn = function()
return require("packer.util").float{border = "rounded"}
end
}
}
}
local function bootstrap()
local fn = vim.fn
local packer_install_path =
fn.stdpath("data").."/site/pack/packer/opt/packer.nvim"
local not_installed = fn.empty(fn.glob(packer_install_path)) == 1
if not_installed then
print("`packer.nvim` is not installed, installing...")
local repo = "https://github.com/wbthomason/packer.nvim"
vim.cmd(("!git clone %s %s"):format(repo, packer_install_path))
end
vim.cmd("packadd packer.nvim")
require("packer").startup {
load,
config = {
git = {clone_timeout = 240},
},
}
if not_installed then
vim.cmd("PackerSync")
end
end
return bootstrap

View File

@ -0,0 +1,154 @@
local fn = vim.fn
local api = vim.api
local M = {}
-- possible values are 'arrow' | 'rounded' | 'blank'
local active_sep = 'blank'
-- change them if you want to different separator
M.separators = {
arrow = { '', '' },
rounded = { '', '' },
blank = { '', '' },
}
-- highlight groups
M.colors = {
active = '%#StatusLine#',
inactive = '%#StatuslineNC#',
mode = '%#Mode#',
mode_alt = '%#ModeAlt#',
git = '%#Git#',
git_alt = '%#GitAlt#',
filetype = '%#Filetype#',
filetype_alt = '%#FiletypeAlt#',
line_col = '%#LineCol#',
line_col_alt = '%#LineColAlt#',
}
M.trunc_width = setmetatable({
mode = 80,
git_status = 90,
filename = 140,
line_col = 60,
}, {
__index = function()
return 80
end
})
M.is_truncated = function(_, width)
local current_width = api.nvim_win_get_width(0)
return current_width < width
end
M.modes = setmetatable({
['n'] = {'Normal', 'N'};
['no'] = {'N·Pending', 'N·P'} ;
['v'] = {'Visual', 'V' };
['V'] = {'V·Line', 'V·L' };
[''] = {'V·Block', 'V·B'}; -- this is not ^V, but it's , they're different
['s'] = {'Select', 'S'};
['S'] = {'S·Line', 'S·L'};
[''] = {'S·Block', 'S·B'}; -- same with this one, it's not ^S but it's 
['i'] = {'Insert', 'I'};
['ic'] = {'Insert', 'I'};
['R'] = {'Replace', 'R'};
['Rv'] = {'V·Replace', 'V·R'};
['c'] = {'Command', 'C'};
['cv'] = {'Vim·Ex ', 'V·E'};
['ce'] = {'Ex ', 'E'};
['r'] = {'Prompt ', 'P'};
['rm'] = {'More ', 'M'};
['r?'] = {'Confirm ', 'C'};
['!'] = {'Shell ', 'S'};
['t'] = {'Terminal ', 'T'};
}, {
__index = function()
return {'Unknown', 'U'} -- handle edge cases
end
})
M.get_current_mode = function(self)
local current_mode = api.nvim_get_mode().mode
if self:is_truncated(self.trunc_width.mode) then
return string.format(' %s ', self.modes[current_mode][2]):upper()
end
return string.format(' %s ', self.modes[current_mode][1]):upper()
end
M.get_git_status = function(self)
-- use fallback because it doesn't set this variable on the initial `BufEnter`
local signs = vim.b.gitsigns_status_dict or {head = '', added = 0, changed = 0, removed = 0}
local is_head_empty = signs.head ~= ''
if self:is_truncated(self.trunc_width.git_status) then
return is_head_empty and string.format('  %s ', signs.head or '') or ''
end
return is_head_empty and string.format(
' +%s ~%s -%s |  %s ',
signs.added, signs.changed, signs.removed, signs.head
) or ''
end
M.get_filename = function(self)
if self:is_truncated(self.trunc_width.filename) then return " %<%f " end
return " %<%F "
end
M.get_filetype = function()
local file_name, file_ext = fn.expand("%:t"), fn.expand("%:e")
local icon = require'nvim-web-devicons'.get_icon(file_name, file_ext, { default = true })
local filetype = vim.bo.filetype
if filetype == '' then return '' end
return string.format(' %s %s ', icon, filetype):lower()
end
M.get_line_col = function(self)
if self:is_truncated(self.trunc_width.line_col) then return ' %l:%c ' end
return ' Ln %l, Col %c '
end
M.set_active = function(self)
local colors = self.colors
local mode = colors.mode .. self:get_current_mode()
local mode_alt = colors.mode_alt .. self.separators[active_sep][1]
local git = colors.git .. self:get_git_status()
local git_alt = colors.git_alt .. self.separators[active_sep][1]
local filename = colors.inactive .. self:get_filename()
local filetype_alt = colors.filetype_alt .. self.separators[active_sep][2]
local filetype = colors.filetype .. self:get_filetype()
local line_col = colors.line_col .. self:get_line_col()
local line_col_alt = colors.line_col_alt .. self.separators[active_sep][2]
return table.concat({
colors.active, mode, mode_alt, git, git_alt,
"%=", filename, "%=",
filetype_alt, filetype, line_col_alt, line_col
})
end
M.set_inactive = function(self)
return self.colors.inactive .. '%= %F %='
end
M.set_explorer = function(self)
local title = self.colors.mode .. ''
local title_alt = self.colors.mode_alt .. self.separators[active_sep][2]
return table.concat({ self.colors.active, title, title_alt })
end
Statusline = setmetatable(M, {
__call = function(statusline, mode)
if mode == "active" then return statusline:set_active() end
if mode == "inactive" then return statusline:set_inactive() end
if mode == "explorer" then return statusline:set_explorer() end
end
})

View File

@ -0,0 +1,304 @@
local M = {}
local function printf(...) print(string.format(...)) end
local sprintf = string.format
local function cmdf(...) vim.cmd(sprintf(...)) end
local fn, api = vim.fn, vim.api
M.printf = printf
M.sprintf = sprintf
M.cmdf = cmdf
function M.get_cursor_pos() return {fn.line('.'), fn.col('.')} end
function M.debounce(func, timeout)
local timer_id
return function(...)
if timer_id ~= nil then
fn.timer_stop(timer_id)
end
local args = {...}
local function cb()
func(args)
timer_id = nil
end
timer_id = fn.timer_start(timeout, cb)
end
end
-- FIXME
function M.throttle(func, timeout)
local timer_id
local did_call = false
return function(...)
local args = {...}
if timer_id == nil then
func(unpack(args))
local function cb()
timer_id = nil
if did_call then
func(unpack(args))
did_call = false
end
end
timer_id = fn.timer_start(timeout, cb)
else
did_call = true
end
end
end
function M.run_colorscheme(colorscheme,callback)
local ok,err = pcall(function()
vim.cmd("colorscheme " .. colorscheme)
callback()
end)
if (not ok) then
vim.notify(err)
end
end
-- Convert UTF-8 hex code to character
function M.u(code)
if type(code) == 'string' then
code = tonumber('0x' .. code)
end
local c = string.char
if code <= 0x7f then
return c(code)
end
local t = {}
if code <= 0x07ff then
t[1] = c(bit.bor(0xc0, bit.rshift(code, 6)))
t[2] = c(bit.bor(0x80, bit.band(code, 0x3f)))
elseif code <= 0xffff then
t[1] = c(bit.bor(0xe0, bit.rshift(code, 12)))
t[2] = c(bit.bor(0x80, bit.band(bit.rshift(code, 6), 0x3f)))
t[3] = c(bit.bor(0x80, bit.band(code, 0x3f)))
else
t[1] = c(bit.bor(0xf0, bit.rshift(code, 18)))
t[2] = c(bit.bor(0x80, bit.band(bit.rshift(code, 12), 0x3f)))
t[3] = c(bit.bor(0x80, bit.band(bit.rshift(code, 6), 0x3f)))
t[4] = c(bit.bor(0x80, bit.band(code, 0x3f)))
end
return table.concat(t)
end
function _G.dump(...)
local args = {...}
if #args == 1 then
print(vim.inspect(args[1]))
else
print(vim.inspect(args))
end
end
function M.load(path)
local ok, mod = pcall(require, path)
if not ok then
printf('Error loading module `%s`', path)
print(mod)
else
local loadfunc
if mod == true then
-- Module doesn't export anything
return
elseif type(mod) == "table" and mod.setup ~= nil then
loadfunc = mod.setup
elseif type(mod) == "function" then
loadfunc = mod
end
local ok, err = pcall(loadfunc)
if not ok then
printf("Error loading module `%s`", path)
print(err)
end
end
end
-- Get information about highlight group
function M.hl_by_name(hl_group)
local hl = api.nvim_get_hl_by_name(hl_group, true)
if hl.foreground ~= nil then
hl.fg = sprintf('#%x', hl.foreground)
end
if hl.background ~= nil then
hl.bg = sprintf('#%x', hl.background)
end
return hl
end
function M.isempty(s)
return s == nil or s == ""
end
function M.get_buf_option(opt)
local status_ok, buf_option = pcall(vim.api.nvim_buf_get_option, 0, opt)
if not status_ok then
return nil
else
return buf_option
end
end
-- Define a new highlight group
-- TODO: rewrite to `nvim_set_hl()` when API will be stable
function M.highlight(cfg)
local command = "highlight"
if cfg.bang == true then
command = command .. '!'
end
if #cfg == 2 and type(cfg[1]) == 'string' and type(cfg[2]) == 'string' then
-- :highlight link
vim.cmd(command.." link "..cfg[1].." "..cfg[2])
return
end
local guifg = cfg.fg or cfg.guifg
local guibg = cfg.bg or cfg.guibg
local gui = cfg.gui
local guisp = cfg.guisp
if type(cfg.override) == 'string' then
local existing = api.nvim_get_hl_by_name(cfg.override, true)
if existing.foreground ~= nil then
guifg = sprintf('#%x', existing.foreground)
end
if existing.background ~= nil then
guibg = sprintf('#%x', existing.background)
end
if existing.special ~= nil then
guibg = sprintf('#%x', existing.background)
end
if existing.undercurl == true then
gui = "undercurl"
elseif existing.underline == true then
gui = "underline"
end
end
command = command .. ' ' .. cfg[1]
if guifg ~= nil then
command = command .. ' guifg=' .. guifg
end
if guibg ~= nil then
command = command .. ' guibg=' .. guibg
end
if gui ~= nil then
command = command .. ' gui=' .. gui
end
if guisp ~= nil then
command = command .. ' guisp=' .. guisp
end
vim.cmd(command)
end
local autocmd_fn_index = 0
-- WIP:
function M.autocmd(event_name, pattern, callback)
local fn_name = 'lua_autocmd' .. autocmd_fn_index
autocmd_fn_index = autocmd_fn_index + 1
_G[fn_name] = callback
cmdf('autocmd %s %s call v:lua.%s()', event_name, pattern, fn_name)
end
function M.glob_exists(path) return fn.empty(fn.glob(path)) == 0 end
do
local show_diagnostics = vim.lsp.diagnostic.show_line_diagnostics
local cursor_pos = M.get_cursor_pos()
local debounced = M.debounce(show_diagnostics, 300)
M.show_lsp_diagnostics = function()
local cursor_pos2 = M.get_cursor_pos()
-- TODO: doesn't work when both diagnostics and popup is shown
if cursor_pos[1] ~= cursor_pos2[1] and cursor_pos[2] ~= cursor_pos2[2] then
cursor_pos = cursor_pos2
debounced()
end
end
end
function M.id_generator(start)
local cnt = start or 0
return function()
local result = cnt
cnt = cnt + 1
return result
end
end
do
local map_func_counter = 0
function M.map(mode, lhs, fn, opts)
local name = 'map_func_' .. map_func_counter
_G[name] = fn
local rhs = ':call v:lua.' .. name .. '()<CR>'
api.nvim_set_keymap(mode, lhs, rhs, opts)
map_func_counter = map_func_counter + 1
end
end
for _, mode in ipairs {'', 'n', 'i', 'c', 'x'} do
M[mode .. 'noremap'] = function(lhs, fn, opts)
local mapopts = opts or {}
mapopts.noremap = true
return M.map(mode, lhs, fn, mapopts)
end
end
function M.log_time(fn, label)
return function(...)
local now = os.clock()
fn(...)
print(
((label and (label .. ' ')) or '') ..
(math.floor((os.clock() - now) * 1e6) / 1000) ..
"ms."
)
end
end
-- TODO: fix function
function M.require_mod(modname)
local ok,mod = pcall(require,modname)
local notify_ok,notify = pcall(require,"notify")
if (not ok) then
local errmsg = "Failed to load " .. modname
if (notify_ok) then
notify(
errmsg,
"error",
{
title = "require"
}
)
else
vim.notify(errmsg)
end
return
end
return mod
end
function M.index_of(t, v, eqfn)
eqfn = eqfn or (function(el) return el == v end)
for i, value in ipairs(t) do
if eqfn(value, v) then
return i
end
end
return -1
end
local globalfn_counter = 0
function M.defglobalfn(func)
assert(type(func) == "function")
local name = "_lua_fn_" .. globalfn_counter
_G[name] = func
globalfn_counter = globalfn_counter + 1
return name
end
return M

View File

@ -0,0 +1,66 @@
vim.g.bufferline = {
-- Enable/disable animations
animation = true,
-- Enable/disable auto-hiding the tab bar when there is a single buffer
auto_hide = false,
-- Enable/disable current/total tabpages indicator (top right corner)
tabpages = true,
-- Enable/disable close button
closable = true,
-- Enables/disable clickable tabs
-- - left-click: go to buffer
-- - middle-click: delete buffer
clickable = true,
-- Excludes buffers from the tabline
exclude_ft = {'javascript'},
exclude_name = {'package.json'},
-- Enable/disable icons
-- if set to 'numbers', will show buffer index in the tabline
-- if set to 'both', will show buffer index and icons in the tabline
icons = true,
-- If set, the icon color will follow its corresponding buffer
-- highlight group. By default, the Buffer*Icon group is linked to the
-- Buffer* group (see Highlighting below). Otherwise, it will take its
-- default value as defined by devicons.
icon_custom_colors = false,
-- Configure icons on the bufferline.
icon_separator_active = '',
icon_separator_inactive = '',
icon_close_tab = '',
icon_close_tab_modified = '',
icon_pinned = '',
-- If true, new buffers will be inserted at the start/end of the list.
-- Default is to insert after current buffer.
insert_at_end = false,
insert_at_start = false,
-- Sets the maximum padding width with which to surround each tab
maximum_padding = 1,
-- Sets the maximum buffer name length.
maximum_length = 30,
-- If set, the letters for each buffer in buffer-pick mode will be
-- assigned based on their name. Otherwise or in case all letters are
-- already assigned, the behavior is to assign letters in order of
-- usability (see order below)
semantic_letters = true,
-- New buffer letters are assigned in this order. This order is
-- optimal for the qwerty keyboard layout but might need adjustement
-- for other layouts.
letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',
-- Sets the name of unnamed buffers. By default format is "[Buffer X]"
-- where X is the buffer number. But only a static string is accepted here.
no_name_title = nil,
}

View File

@ -0,0 +1,62 @@
local ok,cmp = pcall(require,"cmp")
if not ok then
vim.notify("Failed to load cmp\n\n")
return
end
cmp.setup {
mapping = {
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({select = false}),
},
completion = {
autocomplete = true,
completeopt = "menu,menuone,noinsert",
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
},
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered()
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- local kind = string.format("%s %s",vim.g.icons.kind[vim_item.kind], vim_item.kind)
local kind = require("lspkind").cmp_format({mode = "symbol_text", maxwidth = 50})(entry, vim_item)
local strings = vim.split(kind.kind, "%s",{trimempty = true})
kind.kind = " " .. strings[1] .. " "
kind.menu = " (" .. strings[2] .. ")"
return kind
-- vim_item.menu = ({
-- nvim_lsp = "[LSP]",
-- nvim_lua = "[Lua]",
-- buffer = "[BUF]",
-- })[entry.source.name]
--
-- return vim_item
end
},
sources = {
{ name = "nvim_lsp"},
{ name = "luasnip" },
{ name = "emoji" },
{ name = "calc" },
},
}

View File

@ -0,0 +1,11 @@
local ok,dap = pcall(require,"dap")
if not ok then
vim.notify("Failed to load dap\n\n")
return
end
-- dap.adapters.python = {
-- type = "executable",
-- command =
-- args = { "-m","debugpy.adapter" }
-- }

View File

@ -0,0 +1,85 @@
local ok,nvim_lsp = pcall(require,"lspconfig")
if not ok then
vim.notify("Failed to load lspconfig\n\n")
return
end
local utils = require"core.utils"
local root_pattern = require"lspconfig.util".root_pattern
local sign = vim.fn.sign_define
local capabilities = vim.lsp.protocol.make_client_capabilities()
local handlers = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover,{border = "rounded"}),
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help,{border = "rounded"}),
}
local function DiagnosticSign(name,icon,color)
sign("DiagnosticSign"..name,{text=icon,texthl="DiagnosticSign"..name})
if (color ~= "Default") then
utils.highlight{"Diagnostic"..name,fg=color}
end
end
for _,sign in pairs(vim.g.diagnostics_signs) do
DiagnosticSign(sign.name,sign.icon,sign.color)
end
vim.diagnostic.config {
signs = true,
underline = true,
update_in_insert = false,
severity_sort = false,
virtual_text = {prefix = 'x'},
float = {border = "rounded"},
}
local on_attach = function(client,bufnr)
print("Attaching to:",client.name)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,...) end
local opts = {noremap = true,silent=true}
buf_set_keymap('n','gd','<cmd>lua vim.lsp.buf.definition()<CR>',opts)
buf_set_keymap('n','K', '<cmd>lua vim.lsp.buf.hover()<CR>',opts)
buf_set_keymap('n','[d','<cmd>lua vim.diagnostic.goto_prev()<CR>',opts)
buf_set_keymap('n',']d','<cmd>lua vim.diagnostic.goto_next()<CR>',opts)
buf_set_keymap('n','<leader>d','<cmd>lua vim.diagnostic.open_float({border="rounded"})<CR>',opts)
buf_set_keymap('n','<space>f','<cmd>lua vim.lsp.buf.formatting()<CR>',opts)
end
-- LSP Servers
nvim_lsp.clangd.setup {
filetypes = {"c","cpp","objc","objcpp"},
on_attach = on_attach,
handlers = handlers,
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities),
root_dir = root_pattern {
"CMakeList.txt",
"compile_flags.txt",
".git",
vim.fn.getcwd()
}
}
nvim_lsp.pyright.setup{
on_attach = on_attach,
handlers = handlers,
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities),
}
nvim_lsp.gopls.setup {
cmd = {"gopls","server"},
filetypes = {"go", "gomod"},
on_attach = on_attach,
handlers = handlers,
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities),
root_dir = root_pattern{
"go.mod",
".git",
vim.fn.getcwd(),
},
}

View File

@ -0,0 +1,38 @@
require('lualine').setup{
options = {
icons_enabled = true,
theme = 'catppuccin',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'filetype'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View File

@ -0,0 +1,30 @@
local ok,null_ls = pcall(require,"null-ls")
if not ok then
vim.notify("Failed to load null-ls\n\n")
return
end
local h = require("null-ls.helpers")
local m = require("null-ls.methods")
local formatting = null_ls.builtins.formatting
local jq_format = h.make_builtin {
name = "jq",
method = m.internal.FORMATTING,
filetypes = {"json"},
generator_opts = {
command = "jq",
args = {"-M", "."},
to_stdin = true,
},
factory = h.formatter_factory,
}
null_ls.setup{
sources = {
formatting.black,
jq_format
}
}

View File

@ -0,0 +1,128 @@
local ok,nvim_tree = pcall(require,"nvim-tree")
if not ok then
vim.notify("Failed to load nvim-tree\n\n")
return
end
nvim_tree.setup {
auto_reload_on_write = true,
disable_netrw = false,
hijack_cursor = false,
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false,
ignore_buffer_on_setup = false,
open_on_setup = false,
open_on_setup_file = false,
open_on_tab = false,
sort_by = "name",
update_cwd = false,
view = {
width = 30,
height = 30,
hide_root_folder = false,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
mappings = {
custom_only = false,
list = {},
},
},
renderer = {
indent_markers = {
enable = false,
icons = {
corner = "",
edge = "",
none = " ",
},
},
icons = {
webdev_colors = true,
git_placement = "before",
}
},
hijack_directories = {
enable = true,
auto_open = true,
},
update_focused_file = {
enable = false,
update_cwd = false,
ignore_list = {},
},
ignore_ft_on_setup = {},
system_open = {
cmd = "",
args = {},
},
diagnostics = {
enable = false,
show_on_dirs = false,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
filters = {
dotfiles = true,
custom = {},
exclude = {},
},
git = {
enable = true,
ignore = true,
timeout = 400,
},
actions = {
use_system_clipboard = true,
change_dir = {
enable = true,
global = false,
restrict_above_cwd = false,
},
open_file = {
quit_on_open = false,
resize_window = false,
window_picker = {
enable = true,
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" },
},
},
},
},
trash = {
cmd = "trash",
require_confirm = true,
},
log = {
enable = false,
truncate = false,
types = {
all = false,
config = false,
copy_paste = false,
diagnostics = false,
git = false,
profile = false,
},
},
}

View File

@ -0,0 +1,28 @@
local ok,nvim_treesitter_configs = pcall(require,"nvim-treesitter.configs")
if not ok then
vim.notify("Failed to load nvim-treesitter\n\n")
return
end
nvim_treesitter_configs.setup {
highlight = {
enable = true,
disable = {},
},
indent = {
enable = false,
disable = {},
},
ensure_installed = {
"c",
"cpp",
"vim",
"lua",
"bash",
"python",
"go"
},
}
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" }

506
.config/picom/picom.conf Normal file
View File

@ -0,0 +1,506 @@
#################################
# Animations #
#################################
# requires https://github.com/jonaburg/picom
# (These are also the default values)
transition-length = 300
transition-pow-x = 0.1
transition-pow-y = 0.1
transition-pow-w = 0.1
transition-pow-h = 0.1
size-transition = true
#################################
# Corners #
#################################
# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom
corner-radius = 16.0;
# rounded-corners-exclude = [
# #"window_type = 'normal'",
# "class_g = 'LibreWolf'",
# "class_g = 'kitty'",
# "class_g = 'Polybar'",
# "class_g = 'KotatogramDesktop'"
# ];
round-borders = 12;
round-borders-exclude = [
#"class_g = 'TelegramDesktop'",
];
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = false;
# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 7;
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
# shadow-opacity = .75
# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
shadow-offset-x = -7;
# The top offset for shadows, in pixels. (defaults to -15)
# shadow-offset-y = -15
shadow-offset-y = -7;
# Avoid drawing shadows on dock/panel windows. This option is deprecated,
# you should use the *wintypes* option in your config file instead.
#
# no-dock-shadow = false
# Don't draw shadows on drag-and-drop windows. This option is deprecated,
# you should use the *wintypes* option in your config file instead.
#
# no-dnd-shadow = false
# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0
# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0
# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0
# Do not paint shadows on shaped windows. Note shaped windows
# here means windows setting its shape through X Shape extension.
# Those using ARGB background is beyond our control.
# Deprecated, use
# shadow-exclude = 'bounding_shaped'
# or
# shadow-exclude = 'bounding_shaped && !rounded_corners'
# instead.
#
# shadow-ignore-shaped = ''
# Specify a list of conditions of windows that should have no shadow.
#
# examples:
# shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"class_g = 'slop'",
"class_g = 'Polybar'",
"_GTK_FRAME_EXTENTS@:c"
];
# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
# shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""
# Crop shadow of a window fully on a particular Xinerama screen to the screen.
# xinerama-shadow-crop = false
#################################
# Fading #
#################################
# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used.
# fading = false
fading = true;
# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
fade-in-step = 0.03;
# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
# fade-out-step = 0.03
fade-out-step = 0.03;
# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
# fade-delta = 10
# Specify a list of conditions of windows that should not be faded.
# don't need this, we disable fading for all normal windows with wintypes: {}
fade-exclude = [
"class_g = 'slop'" # maim
]
# Do not fade on window open/close.
# no-fading-openclose = false
# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false
#################################
# Transparency / Opacity #
#################################
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 0.8;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
frame-opacity = 0.7;
# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
# menu-opacity = 1.0
# menu-opacity is depreciated use dropdown-menu and popup-menu instead.
#If using these 2 below change their values in line 510 & 511 aswell
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
# inactive-opacity-override = true
inactive-opacity-override = false;
# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
active-opacity = 1.0;
# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
# inactive-dim = 0.0
# Specify a list of conditions of windows that should always be considered focused.
# focus-exclude = []
focus-exclude = [
"class_g = 'Cairo-clock'",
"class_g = 'Bar'", # lemonbar
"class_g = 'slop'" # maim
];
# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0
# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
# Note we don't make any guarantee about possible conflicts with other
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
# example:
# opacity-rule = [ "80:class_g = 'URxvt'" ];
#
# opacity-rule = []
opacity-rule = [
"80:class_g = 'Bar'", # lemonbar
"100:class_g = 'slop'", # maim
"100:class_g = 'XTerm'",
"100:class_g = 'URxvt'",
"100:class_g = 'kitty'",
"100:class_g = 'Alacritty'",
"80:class_g = 'Polybar'",
"100:class_g = 'code-oss'",
"100:class_g = 'Meld'",
"70:class_g = 'TelegramDesktop'",
"90:class_g = 'Joplin'",
"100:class_g = 'firefox'",
"100:class_g = 'Thunderbird'"
];
#################################
# Background-Blurring #
#################################
# Parameters for background blurring, see the *BLUR* section for more information.
# blur-method =
# blur-size = 12
#
# blur-deviation = false
# Blur background of semi-transparent / ARGB windows.
# Bad in performance, with driver-dependent behavior.
# The name of the switch may change without prior notifications.
#
# blur-background = true;
# Blur background of windows when the window frame is not opaque.
# Implies:
# blur-background
# Bad in performance, with driver-dependent behavior. The name may change.
#
# blur-background-frame = false;
# Use fixed blur strength rather than adjusting according to window opacity.
# blur-background-fixed = false;
# Specify the blur convolution kernel, with the following format:
# example:
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
#
# blur-kern = ''
# blur-kern = "3x3box";
blur: {
# requires: https://github.com/ibhagwan/picom
method = "kawase";
#method = "kernel";
strength = 7;
# deviation = 1.0;
# kernel = "11x11gaussian";
background = false;
background-frame = false;
background-fixed = false;
kern = "3x3box";
}
# Exclude conditions for background blur.
blur-background-exclude = [
#"window_type = 'dock'",
#"window_type = 'desktop'",
#"class_g = 'URxvt'",
#
# prevents picom from blurring the background
# when taking selection screenshot with `main`
# https://github.com/naelstrof/maim/issues/130
"class_g = 'slop'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
# General Settings #
#################################
# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false
# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
experimental-backends = true;
backend = "glx";
#backend = "xrender";
# Enable/disable VSync.
# vsync = false
vsync = true
# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
# dbus = false
# Try to detect WM windows (a non-override-redirect window with no
# child that has 'WM_STATE') and mark them as active.
#
# mark-wmwin-focused = false
mark-wmwin-focused = true;
# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
# mark-ovredir-focused = false
mark-ovredir-focused = true;
# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# detect-rounded-corners = false
detect-rounded-corners = true;
# Detect '_NET_WM_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_OPACITY' of client windows to frame windows.
#
# detect-client-opacity = false
detect-client-opacity = true;
# Specify refresh rate of the screen. If not specified or 0, picom will
# try detecting this with X RandR extension.
#
# refresh-rate = 60
refresh-rate = 0
# Limit picom to repaint at most once every 1 / 'refresh_rate' second to
# boost performance. This should not be used with
# vsync drm/opengl/opengl-oml
# as they essentially does sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#
# sw-opti =
# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
#
# use-ewmh-active-win = false
# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows. paint-on-overlay may make the flickering less obvious.
#
# unredir-if-possible = false
# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0
# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
# unredir-if-possible-exclude = []
# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# detect-transient = false
detect-transient = true
# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if
# detect-transient is enabled, too.
#
# detect-client-leader = false
detect-client-leader = true
# Resize damaged region by a specific number of pixels.
# A positive value enlarges it while a negative one shrinks it.
# If the value is positive, those additional pixels will not be actually painted
# to screen, only used in blur calculation, and such. (Due to technical limitations,
# with use-damage, those pixels will still be incorrectly painted to screen.)
# Primarily used to fix the line corruption issues of blur,
# in which case you should use the blur radius value here
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
# with a 5x5 one you use `--resize-damage 2`, and so on).
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
#
# resize-damage = 1
# Specify a list of conditions of windows that should be painted with inverted color.
# Resource-hogging, and is not well tested.
#
# invert-color-include = []
# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content (but never
# practically happened) and may not work with blur-background.
# My tests show a 15% performance boost. Recommended.
#
# glx-no-stencil = false
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes,
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
# Recommended if it works.
#
# glx-no-rebind-pixmap = false
# Disable the use of damage information.
# This cause the whole screen to be redrawn everytime, instead of the part of the screen
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
# The opposing option is use-damage
#
# no-use-damage = false
#use-damage = true (Causing Weird Black semi opaque rectangles when terminal is opened)
#Changing use-damage to false fixes the problem
use-damage = false
# Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers
# with GLX backend for some users.
#
# xrender-sync-fence = false
# GLX backend: Use specified GLSL fragment shader for rendering window contents.
# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
# in the source tree for examples.
#
# glx-fshader-win = ''
# Force all windows to be painted with blending. Useful if you
# have a glx-fshader-win that could turn opaque pixels transparent.
#
# force-win-blend = false
# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# no-ewmh-fullscreen = false
# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
#
# max-brightness = 1.0
# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them.
#
# transparent-clipping = false
# Set the log level. Possible values are:
# "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case doesn't matter.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# log-level = "debug"
log-level = "info";
# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = '/path/to/your/log/file'
# Show all X errors (for debugging)
# show-all-xerrors = false
# Write process ID to a file.
# write-pid-path = '/path/to/your/log/file'
# Window type settings
#
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
# "unknown", "desktop", "dock", "toolbar", "menu", "utility",
# "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
# "tooltip", "notification", "combo", and "dnd".
#
# Following per window-type options are available: ::
#
# fade, shadow:::
# Controls window-type-specific shadow and fade settings.
#
# opacity:::
# Controls default opacity of the window type.
#
# focus:::
# Controls whether the window of this type is to be always considered focused.
# (By default, all window types except "normal" and "dialog" has this on.)
#
# full-shadow:::
# Controls whether shadow is drawn under the parts of the window that you
# normally won't be able to see. Useful when the window has parts of it
# transparent, and you want shadows in those areas.
#
# redir-ignore:::
# Controls whether this type of windows should cause screen to become
# redirected again after been unredirected. If you have unredir-if-possible
# set, and doesn't want certain window to cause unnecessary screen redirection,
# you can set this to `true`.
#
wintypes:
{
normal = { fade = false; shadow = false; }
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.8; }
dropdown_menu = { opacity = 0.8; }
};

180
.config/polybar/config.ini Normal file
View File

@ -0,0 +1,180 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
background = #24283B
background-alt = #373B41
foreground = #f9f8fe
primary = #BB9AF7
secondary = #8ABEB7
alert = #A54242
disabled = #707880
[bar/example]
width = 100%
height = 23pt
radius = 12
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 0pt
border-color = #00000000
padding-left = 2
padding-right = 2
module-margin = 1
separator = |
separator-foreground = ${colors.disabled}
font-0 = RobotoMono Nerd Font Mono:size=10;2
font-1 = FontAwesome:style=Regular:pixelsize=10;2
modules-left = date
modules-right = pulseaudio xkeyboard updates-pacman-aurhelper weather memory
modules-center = xworkspaces
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
; tray-position = right
; wm-restack = generic
wm-restack = bspwm
; wm-restack = i3
; override-redirect = true
[module/xworkspaces]
type = internal/xworkspaces
label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 2
label-occupied = %name%
label-occupied-padding = 2
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 2
[module/weather]
type = custom/script
exec = ~/.config/polybar/scripts/weather/wthr
interval = 600
[module/updates-pacman-aurhelper]
type = custom/script
exec = ~/.config/polybar/scripts/updates-pacman-aurhelper.sh
interval = 7200
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}
[module/pulseaudio]
type = internal/pulseaudio
format-volume-prefix = " 墳 "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>
label-volume = %percentage%%
label-muted = muted
label-muted-foreground = ${colors.disabled}
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
label-layout =  %layout%
label-layout-foreground = ${colors.primary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}
[module/memory]
type = internal/memory
interval = 2
format-prefix = "  "
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "cpu "
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#2AC3DE} %{F-}%essid%
[module/date]
type = internal/date
interval = 1
date = %a,%b %d %I:%M %p
label-foreground = #41A6B5
;${colors.primary}
[settings]
screenchange-reload = true
pseudo-transparency = true
; vim:ft=dosini

View File

@ -0,0 +1,23 @@
#!/bin/sh
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
date=$(grep 'pacman -Suy' /var/log/pacman.log | tail -1 | tr -d '[' | cut -f 1 -d 'T')
if ! updates_aur=$(paru -Qum 2> /dev/null | wc -l); then
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then
updates_aur=0
fi
updates=$((updates_arch + updates_aur))
if [ "$updates" -gt 0 ]; then
echo "%{F#7dcfff} $updates $date%{F-}"
else
echo ""
fi

View File

@ -0,0 +1,2 @@
address = ""
app_id = ""

View File

@ -0,0 +1,31 @@
from typing import NamedTuple
from enum import Enum
from environs import Env
env = Env()
env.read_env()
# app_id:
app_id = env.str("app_id")
address = env.str("address")
class Color(NamedTuple):
hcolor:str
start_temp:int
end_temp:int
class Colors(Enum):
blue1 = Color("#7aa2f7",-20,10)
green1 = Color("#9ECE6A",10,21)
red1 = Color("#dc143c",22,50)
# Used nerd fonts icons
class WeatherIcons(Enum):
Thunderstorm = ""
Rain = ""
Snow = ""
Fog = ""
Clouds = ""
Clear = ""
Unknown = "NOT FOUND ICON"

View File

@ -0,0 +1,2 @@
class ApiServiceError(Exception):
"""Service Error"""

View File

@ -0,0 +1,22 @@
from config import WeatherIcons,Colors
from weather import Weather
from config import Color
def _select_icon(weather_status:str) -> str:
for icon in WeatherIcons:
if icon.name == weather_status:
return icon.value
return WeatherIcons.Other.value
def _select_color(temp:int) -> Color:
for color in Colors:
if (color.value.end_temp >= temp >= color.value.start_temp):
return color.value
return Color("#00000",-1,-1)
def format_weather(weather:Weather) -> str:
color = _select_color(weather.temp)
icon = _select_icon(weather.weatherType)
return "%{{F{0}}} {1} {2}°C %{{F-}}".format(
color.hcolor,icon,round(weather.temp)
)

View File

@ -0,0 +1,26 @@
from geopy.geocoders import Nominatim
from config import address
from exceptions import ApiServiceError
from typing import NamedTuple
class Location(NamedTuple):
lat:float
lon:float
def __get_location_response() -> dict:
try:
app = Nominatim(user_agent="UserAgent")
return app.geocode(address).raw
except:
raise ApiServiceError
def _parse_location_reponse(loc_dict:dict) -> Location:
return Location(
lat=loc_dict["lat"],
lon=loc_dict["lon"],
)
def get_location() -> Location:
response_json = __get_location_response()
return _parse_location_reponse(response_json)

View File

@ -0,0 +1,46 @@
import json
from json.decoder import JSONDecodeError
import urllib.request
from urllib.error import URLError
from exceptions import ApiServiceError
from config import app_id
from location import Location
from typing import NamedTuple
Celsius = int
class Weather(NamedTuple):
temp:Celsius
weatherType:str
windSpeed:int
def get_weather(loc:Location) -> Weather:
weather_response = _get_weather_response(loc)
return _parse_weather_response(weather_response)
def _get_weather_response(loc:Location) -> str:
url = (
"https://api.openweathermap.org/data/2.5/weather?"
"lat={latitude}&lon={longitude}"
"&appid=" + app_id + "&units=metric"
)
url = url.format(latitude=loc.lat,longitude=loc.lon)
try:
return urllib.request.urlopen(url).read()
except URLError:
raise ApiServiceError
def _parse_weather_response(response:str) -> Weather:
try:
weather_dict = json.loads(response)
except JSONDecodeError:
raise ApiServiceError
return Weather(
temp = round(weather_dict["main"]["temp"]),
weatherType = weather_dict["weather"][0]["main"],
windSpeed = weather_dict["wind"]["speed"],
)

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
from location import get_location
from weather import get_weather
from formatter import format_weather
import exceptions
def main() -> None:
try:
loc = get_location()
weather = get_weather(loc)
except exceptions.ApiServiceError:
print("%{F#f7768e}API Service ERROR%{F-}")
return
print(format_weather(weather))
if __name__ == '__main__':
main()

View File

@ -0,0 +1,5 @@
{
"venv":"env",
"venvPath":"",
"reportSelfClsParameterName":false
}

View File

@ -0,0 +1,80 @@
[General]
version=4.2.0
save_mode_on_exit=1
save_definitions_on_exit=1
ignore_locale=0
colorize=1
auto_update_exchange_rates=-1
spacious=1
vertical_space=1
excessive_parenthesis=0
short_multiplication=1
use_unicode_signs=1
lower_case_numbers=0
lower_case_e=0
imaginary_j=0
base_display=1
twos_complement=1
hexadecimal_twos_complement=0
spell_out_logical_operators=1
digit_grouping=0
decimal_comma=-1
dot_as_separator=-1
comma_as_separator=0
multiplication_sign=2
division_sign=0
[Mode]
min_deci=0
use_min_deci=0
max_deci=2
use_max_deci=0
precision=10
interval_arithmetic=1
interval_display=0
min_exp=-1
negative_exponents=0
sort_minus_last=1
number_fraction_format=-1
complex_number_form=0
use_prefixes=1
use_prefixes_for_all_units=0
use_prefixes_for_currencies=0
use_binary_prefixes=0
abbreviate_names=1
all_prefixes_enabled=0
denominator_prefix_enabled=1
place_units_separately=1
auto_post_conversion=3
mixed_units_conversion=3
local_currency_conversion=1
number_base=10
number_base_expression=10
read_precision=0
assume_denominators_nonzero=1
warn_about_denominators_assumed_nonzero=1
structuring=1
angle_unit=1
caret_as_xor=0
functions_enabled=1
variables_enabled=1
calculate_variables=1
calculate_functions=1
variable_units_enabled=1
sync_units=1
unknownvariables_enabled=0
units_enabled=1
allow_complex=1
allow_infinite=1
indicate_infinite_series=0
show_ending_zeroes=1
rounding_mode=0
approximation=-1
interval_calculation=1
in_rpn_mode=0
rpn_syntax=0
limit_implicit_multiplication=0
parsing_mode=0
default_assumption_type=4
default_assumption_sign=0

View File

@ -0,0 +1,30 @@
ls
1 USD to UAH
500 UAH to USD
65/5
24+48
72/4
55+56
111-333
-222
-222/4
333-56
111-29
111-28
55-83
(935+3*1)/18
(935+3*2)/18
(935+3*3)/18
(935+3*4)/18
(935+3*5)/18
(935+3*6)/18
29-3*1
29-3*2
29-3*3
29-3*4
29-3*5
29-3*6
29-3*7
29-3*8
29-3*9
29-3*10

View File

View File

View File

4
.config/ranger/rc.conf Normal file
View File

@ -0,0 +1,4 @@
set preview_images true
set preview_images_method kitty
default_linemode devicons

View File

@ -0,0 +1,2 @@
mime ^text, label editor = $EDITOR -- "$@"
mime ^text, label pager = "$PAGER" -- "$@"

9
.config/rofi/config.rasi Normal file
View File

@ -0,0 +1,9 @@
@theme "./nord.rasi"
configuration {
font: "Iosevka 13" ;
terminal: "kitty";
}
element-icon { size: 2ch ; }

93
.config/rofi/nord.rasi Normal file
View File

@ -0,0 +1,93 @@
/*
* ROFI color theme
*
* Based on Something Found in the Internet
*
* User: Contributors
* Copyright: *!
*/
configuration {
display-run: " ";
display-drun: " ";
display-window: " ";
drun-display-format: "{icon} {name}";
font: "JetBrainsMono Nerd Font Medium 10";
modi: "window,run,drun";
show-icons: true;
}
* {
polar-1: #2E3440;
polar-2: #3B4252;
polar-3: #434C5E;
polar-4: #4C566A;
snow-1: #D8DEE9;
snow-2: #E5E9F0;
snow-3: #ECEFF4;
frost-1: #8FBCBB;
frost-2: #88C0D0;
frost-3: #81A1C1;
frost-4: #5E81AC;
aurora-1: #BF616A;
aurora-2: #D08770;
aurora-3: #EBCB8B;
aurora-4: #A3BE8C;
aurora-5: #B48EAD;
background-color: @polar-1;
border: 0;
margin: 0;
padding: 0;
spacing: 0;
}
element {
padding: 12;
text-color: @frost-3;
}
element selected {
text-color: @aurora-3;
}
element-text {
padding: 2;
background-color: inherit;
text-color: inherit;
}
entry {
background-color: @polar-2;
padding: 12 0 12 3;
text-color: @frost-1;
}
inputbar {
children: [prompt, entry];
}
listview {
columns: 1;
lines: 8;
}
mainbox {
children: [inputbar, listview];
}
prompt {
background-color: @polar-2;
enabled: true;
font: "FontAwesome 12";
padding: 12 0 0 12;
text-color: @frost-1;
}
window {
transparency: "real";
}

3
.config/scripts/jazz.sh Executable file
View File

@ -0,0 +1,3 @@
url="https://youtu.be/XnzxEGLaPxs"
pkill -f $url || mpv --shuffle --no-video "$url"

5
.config/scripts/lofi.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
url="https://youtu.be/5qap5aO4i9A"
pkill -f $url || mpv --shuffle --no-video "$url"

200
.config/sxhkd/sxhkdrc Normal file
View File

@ -0,0 +1,200 @@
# wm independent hotkeys
# make sxhkd reload its configuration files:
# Default keybinds
# -------------------------------------------------------
super + e
pkill -USR1 -x sxhkd
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + {shift+c,shift + w}
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest window
super + g
bspc node -s biggest.window
# -------------------------------------------------------
# Start programs
# --------------------------------------------------------
super + Return
kitty
super + shift + n
kitty -e notetaker
super + n
kitty -e ranger
super + shift + t
kotatogram-desktop
super + shift + b
librewolf
super + shift + s
/home/q/bin/screenrecord
super + c
rofi -show calc -modi calc -no-show-match -no-sort
super + alt + l
/home/q/.config/scripts/lofi.sh
super + alt + j
/home/q/.config/scripts/jazz.sh
super + d
rofi -show drun -show-icons -modi drun
Print
flameshot gui
{super+alt+t}
kotatogram-desktop
{F9,super+alt+f}
librewolf
super + x
betterlockscreen -l dimblur
# --------------------------------------------------------
# Volume control
# ----------------------------------------------------------
# Down
{F2,XF86AudioLowerVolume}
pactl set-sink-volume @DEFAULT_SINK@ -10%
# Up
{F3,XF86AudioRaiseVolume}}
pactl set-sink-volume @DEFAULT_SINK@ +10%
# Mute
{F1,F86AudioMute}
pactl set-sink-mute @DEFAULT_SINK@ toggle
# Mute microfon
{F9,XF86AudioMicMute}
pactl set-source-mute @DEFAULT_SOURCE@ toggle
# --------------------------------------------------------------
# Brigness screen
# --------------------------------------------------------------
{F4,XF86MonBrightnessDown}
light -U 10
{F5, XF86MonBrightnessUp}
light -A 10
# --------------------------------------------------------------
# state/flags
# ----------------------------------------------------------------
# t - Taylind
# s - Normal
# f - floating
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
# ----------------------------------------------------------------
# focus/swap
# -----------------------------------------------------------------
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
# -----------------------------------------------------------------
# preselect
# ------------------------------------------------------------------
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# ------------------------------------------------------------------
# move/resize
# -------------------------------------------------------------------
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
# -------------------------------------------------------------------

View File

@ -0,0 +1 @@
/usr/lib/systemd/user/pipewire-pulse.service

View File

@ -0,0 +1 @@
/usr/lib/systemd/user/pipewire.service

View File

@ -0,0 +1 @@
/home/q/.config/systemd/user/ssh-agent.service

View File

@ -0,0 +1,13 @@
[Unit]
Description=Jupyter notebook server
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/usr/bin/jupyter lab
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
/usr/lib/systemd/user/pipewire-pulse.socket

View File

@ -0,0 +1 @@
/usr/lib/systemd/user/pipewire.socket

View File

@ -0,0 +1,10 @@
[Unit]
Description=SSH key agent
[Service]
Type=simple
Enviroment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target

View File

@ -0,0 +1,20 @@
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=default.target

View File

@ -0,0 +1,12 @@
[Unit]
Description=Telegram Bot API server
After=network-online.target
[Service]
Type=simple
EnvironmentFile=$HOME/.config/telegram-bot-api/config.env
WorkingDirectory=~
ExecStart=telegram-bot-api --api-id=${api_id} --api-hash=${api_hash} --local --http-stat-ip-address=${ip} --http-port=${port} --dir=$HOME/.config/telegram-bot-api/
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
ip=127.0.0.1
port=5326
api_id=123
api_hash=abcde123

25
.config/zsh/alias.zsh Normal file
View File

@ -0,0 +1,25 @@
alias v="vim"
alias nv="nvim"
alias gc="git clone"
alias ga="git add"
alias gt="git status"
alias gst="git status"
alias gdf="git diff"
alias ls="lsd"
alias la="lsd -a"
alias ll="lsd -l"
alias l="lsd -la"
alias cls=clear
alias tree="tree -CL 3"
alias sz="$HOME/.zshrc"
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias history="fc -l 1"
alias histclr="echo ' ' > ~/.config/zsh/history"

1
.config/zsh/history Normal file
View File

@ -0,0 +1 @@

2
.config/zsh/keybinds.zsh Normal file
View File

@ -0,0 +1,2 @@
bindkey '^A' beginning-of-line
# bindkey '^I' end-of-line

12
.config/zsh/prompt.zsh Normal file
View File

@ -0,0 +1,12 @@
function git_branch_name() {
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
if [[ $branch == "" ]];then
:
else
echo '- ('$branch')'
fi
}
setopt prompt_subst
PROMPT="%F{red}%n%f@%F{blue}%m%f %F{green}%~%f >> "

21
.config/zsh/zshenv.zsh Normal file
View File

@ -0,0 +1,21 @@
export EDITOR=nvim
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
export HISTSIZE=100000
export SAVEHIST=100000
export HISTFILE="$XDG_CONFIG_HOME/zsh/history"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
export IPYTHONDIR="${XDG_CONFIG_HOME}/ipython"
export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/pythonrc"
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter"
export GTK2_RC_FILES="${XDG_CONFIG_HOME}/gtk-2.0/gtkrc"
export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME}/npm/npmrc"

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.config/polybar/scripts/weather/__pycache__/
.config/polybar/scripts/weather/.env

1
.xinitrc Normal file
View File

@ -0,0 +1 @@
exec dbus-launch bspwm

10
.zshrc Executable file
View File

@ -0,0 +1,10 @@
source "$HOME/.config/zsh/zshenv.zsh"
zshfiles=("alias" "prompt" "keybinds")
for zshfile in $zshfiles
do
source "$zshconfigs/${zshfile}.zsh"
done
path+=('/home/q/bin')
export PATH

7
00-keyboard.conf Normal file
View File

@ -0,0 +1,7 @@
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us,ru,ua"
Option "XkbModel" "pc104"
Option "XkbOptions" "grp:caps_toggle"
EndSection

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# Dotfiles
- **wm:** [bspwm](https://github.com/hok7z/dotfiles/tree/main/.config/bspwm) & [sxhkd](https://github.com/hok7z/dotfiles/tree/main/.config/sxhkd)
- **terminal:** [kitty](https://github.com/hok7z/dotfiles/tree/main/.config/kitty)
- **editor:** [neovim](https://github.com/hok7z/dotfiles/tree/main/.config/nvim)
- **status bar:** [polybar](https://github.com/hok7z/dotfiles/tree/main/.config/polybar)
- **launcher:** [rofi](https://github.com/hok7z/dotfiles/tree/main/.config/rofi)
- **shell:** [fish](https://github.com/hok7z/dotfiles/tree/main/.config/fish) | [zsh](https://github.com/hok7z/dotfiles/tree/main/.config/zsh)
- [shell scripts](https://github.com/hok7z/dotfiles/tree/main/.config/scripts)
- [user systemd units](https://github.com/hok7z/dotfiles/tree/main/.config/systemd/user)

35
bin/battery Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
for pid in $(pidof -x battery); do
if [ "$pid" != $$ ]; then
kill -9 "$pid"
fi
done
notify_icons="/home/q/.config/dunst/icons"
# notify when below this percentage
warning_level=50
# how often to check battery status, in seconds
check_interval=300
while true; do
path_to_battery=$(upower -e | grep BAT)
battery_level=$(upower -i "$path_to_battery" | grep -E "percentage" | sed 's/[^0-9]//g')
discharging=$(upower -i "$path_to_battery" | grep -E "state" | grep -c "discharging")
time_to_empty=$(upower -i "$path_to_battery" | grep -E "time to empty" | sed 's/[^0-9,.]//g')
# check if battery is low and discharging
if [ "$battery_level" -lt "$warning_level" ] && [ "$discharging" -eq 1 ]
then
dunstify -a "Battery" \
"Low battery: ${battery_level}%" \
"Battery is low ($time_to_empty minuts left)" \
-r 100 \
-i "$notify_icons/battery-low.png"
mpv "/home/q/.config/alarm/low-battery-sound.mp3"
fi
sleep ${check_interval}s
done

4
bin/clean-pacman-cache Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
rm -rf ~/.cache/paru/clone
paru -Scc
sudo pacman -Rns $(pacman -Qtdq)

6
bin/ewrap Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env sh
if [ -n "$TMUX" ] ; then
tmux split-window -h "nvim \"$*\""
else
kitty -e "nvim \"$*\""
fi

15
bin/newpyproject Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
if [ $# -lt 1 ];then
echo "Failed get arguments"
echo "./newpyproject [project name]"
exit
fi
mkdir $1
cd $1
git init
poetry init
cp ~/.config/pyright/pyrightconfig.json .
venv_path=$(poetry env info -p)
echo -e $(jq -r --arg path "$venv_path" '.venvPath |= $path' pyrightconfig.json) > pyrightconfig.json

13
bin/notetaker Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
noteFileName="$HOME/notes/note-$(date +%Y-%m-%d).md"
if [ ! -f $noteFileName ];then
echo "Notes for $(date +%Y-%m-%d)" > $noteFileName
fi
nvim -c "norm Go" \
-c "norm Go## $(date +'%I:%m %p')" \
-c "norm G2o" \
-c "norm zz" \
-c "startinsert" $noteFileName

Some files were not shown because too many files have changed in this diff Show More