Compare commits

...

14 Commits

702 changed files with 2672 additions and 50084 deletions

13
.gitignore vendored
View File

@ -1,14 +1,3 @@
nvim/plugin
qutebrowser/bookmarks
qutebrowser/quickmarks
qutebrowser/qsettings
qutebrowser/qutepocket.secrets
vnc/tigervnc.history
buildfiles/st/st
buildfiles/x265/x265_git
buildfiles/x265/build
buildfiles/x265/build-10
buildfiles/x265/build-12
buildfiles/newtabber/newtabber
newtabber/newtabber
termux/font.ttf
btop/btop.log

1
bat/config Normal file
View File

@ -0,0 +1 @@
--theme="Catppuccin-mocha"

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Catppuccin</string>
@ -22,7 +22,7 @@
<key>gutterForegroundHighlight</key>
<string>#a6e3a1</string>
<key>lineHighlight</key>
<string>#1e1e2e</string>
<string>#585b70</string>
<key>selection</key>
<string>#6c7086</string>
<key>selectionBorder</key>
@ -149,8 +149,7 @@
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
</dict>
<dict></dict>
</dict>
<dict>
<key>name</key>
@ -957,4 +956,4 @@
<key>author</key>
<string>BrunDerSchwarzmagier</string>
</dict>
</plist>
</plist>

View File

@ -1,25 +0,0 @@
#!/usr/bin/env bash
bluecard=$(pactl list cards | grep 'Name: bluez_card' | awk '{ print $2 }')
if [ "$1" = "fixbt" ] && [ -n "$bluecard" ]; then
pactl set-card-profile "$bluecard" a2dp-sink
exit
fi
hdmisink=$(pactl list sinks | grep 'Name: ' | grep hdmi | awk '{ print $2 }')
bluesink=$(pactl list sinks | grep 'Name: ' | grep bluez | awk '{ print $2 }')
analogsink=$(pactl list sinks | grep 'Name: ' | grep analog | awk '{ print $2 }')
currentsink=$(pactl get-default-sink)
case "$currentsink" in
"$hdmisink") nextsink="${bluesink:-$analogsink}";;
*) nextsink="$hdmisink";;
esac
pactl set-default-sink "$nextsink"
if [ "$nextsink" = "$bluesink" ]; then
pactl set-card-profile "$bluecard" a2dp-sink
fi

View File

@ -1,2 +0,0 @@
#!/bin/sh
col -bx < "$1" | bat --language man -p

View File

@ -1,10 +0,0 @@
#!/bin/sh
# battery percentage
battpct="$(upower --show-info $(upower --enumerate | grep -i 'BAT') | grep -E "percentage" | awk '{print $2}')"
battpct="${battpct%\%}"
# battery status (charging/charged/etc)
batstat="$(upower --show-info $(upower --enumerate | grep -i 'BAT') | grep -E "state" | awk '{print $2}')"
notify-send "Battery: ${battpct}% ($batstat)"

View File

@ -1,500 +0,0 @@
#!/usr/bin/env bash
# Rofi extension for BitWarden-cli
NAME="$(basename "$0")"
VERSION="0.4"
DEFAULT_CLEAR=5
BW_HASH=
# Options
CLEAR=$DEFAULT_CLEAR # Clear password after N seconds (0 to disable)
SHOW_PASSWORD=no # Show part of the password in the notification
AUTO_LOCK=900 # 15 minutes, default for bitwarden apps
# Holds the available items in memory
ITEMS=
# Stores which command will be used to emulate keyboard type
AUTOTYPE_MODE=
# Stores which command will be used to deal with clipboards
CLIPBOARD_MODE=
# Specify what happens when pressing Enter on an item.
# Defaults to copy_password, can be changed to (auto_type all) or (auto_type password)
ENTER_CMD=copy_password
# Keyboard shortcuts
KB_SYNC="Alt+r"
KB_URLSEARCH="Alt+u"
KB_NAMESEARCH="Alt+n"
KB_FOLDERSELECT="Alt+c"
KB_TOTPCOPY="Alt+t"
KB_LOCK="Alt+L"
KB_TYPEALL="Alt+1"
KB_TYPEUSER="Alt+2"
KB_TYPEPASS="Alt+3"
# Item type classification
TYPE_LOGIN=1
TYPE_NOTE=2
TYPE_CARD=3
TYPE_IDENTITY=4
# Populated in parse_cli_arguments
ROFI_OPTIONS=()
DEDUP_MARK="(+)"
# Source helper functions
DIR="$(dirname "$(readlink -f "$0")")"
source "$DIR/lib-bwmenu"
ask_password() {
mpw=$(printf '' | rofi -dmenu -p "Master Password" -password -lines 0) || exit $?
echo "$mpw" | bw unlock 2>/dev/null | grep 'export' | sed -E 's/.*export BW_SESSION="(.*==)"$/\1/' || exit_error $? "Could not unlock vault"
}
get_session_key() {
if [ $AUTO_LOCK -eq 0 ]; then
keyctl purge user bw_session &>/dev/null
BW_HASH=$(ask_password)
else
if ! key_id=$(keyctl request user bw_session 2>/dev/null); then
session=$(ask_password)
[[ -z "$session" ]] && exit_error 1 "Could not unlock vault"
key_id=$(echo "$session" | keyctl padd user bw_session @u)
fi
if [ $AUTO_LOCK -gt 0 ]; then
keyctl timeout "$key_id" $AUTO_LOCK
fi
BW_HASH=$(keyctl pipe "$key_id")
fi
}
# source the hash file to gain access to the BitWarden CLI
# Pre fetch all the items
load_items() {
if ! ITEMS=$(bw list items --session "$BW_HASH" 2>/dev/null); then
exit_error $? "Could not load items"
fi
}
exit_error() {
local code="$1"
local message="$2"
rofi -e "$message"
exit "$code"
}
# Show the Rofi menu with options
# Reads items from stdin
rofi_menu() {
actions=(
-kb-custom-1 $KB_SYNC
-kb-custom-2 $KB_NAMESEARCH
-kb-custom-3 $KB_URLSEARCH
-kb-custom-4 $KB_FOLDERSELECT
-kb-custom-8 $KB_TOTPCOPY
-kb-custom-9 $KB_LOCK
)
msg="<b>$KB_SYNC</b>: sync | <b>$KB_URLSEARCH</b>: urls | <b>$KB_NAMESEARCH</b>: names | <b>$KB_FOLDERSELECT</b>: folders | <b>$KB_TOTPCOPY</b>: totp | <b>$KB_LOCK</b>: lock"
[[ ! -z "$AUTOTYPE_MODE" ]] && {
actions+=(
-kb-custom-5 $KB_TYPEALL
-kb-custom-6 $KB_TYPEUSER
-kb-custom-7 $KB_TYPEPASS
)
msg+="
<b>$KB_TYPEALL</b>: Type all | <b>$KB_TYPEUSER</b>: Type user | <b>$KB_TYPEPASS</b>: Type pass"
}
rofi -dmenu -p 'Name' \
-i -no-custom \
-mesg "$msg" \
"${actions[@]}" \
"${ROFI_OPTIONS[@]}"
}
# Show items in a rofi menu by name of the item
show_items() {
if item=$(
echo "$ITEMS" \
| jq -r ".[] | select( has( \"login\" ) ) | \"\\(.name)\"" \
| dedup_lines \
| rofi_menu
); then
item_array="$(array_from_name "$item")"
"${ENTER_CMD[@]}" "$item_array"
else
rofi_exit_code=$?
item_array="$(array_from_name "$item")"
on_rofi_exit "$rofi_exit_code" "$item_array"
fi
}
# Similar to show_items() but using the item's ID for deduplication
show_full_items() {
if item=$(
echo "$ITEMS" \
| jq -r ".[] | select( has( \"login\" )) | \"\\(.id): name: \\(.name), username: \\(.login.username)\"" \
| rofi_menu
); then
item_id="$(echo "$item" | cut -d ':' -f 1)"
item_array="$(array_from_id "$item_id")"
"${ENTER_CMD[@]}" "$item_array"
else
rofi_exit_code=$?
item_id="$(echo "$item" | cut -d ':' -f 1)"
item_array="$(array_from_id "$item_id")"
on_rofi_exit "$rofi_exit_code" "$item_array"
fi
}
# Show items in a rofi menu by url of the item
# if url occurs in multiple items, show the menu again with those items only
show_urls() {
if url=$(
echo "$ITEMS" \
| jq -r '.[] | select(has("login")) | .login | select(has("uris")).uris | .[].uri' \
| rofi_menu
); then
item_array="$(bw list items --url "$url" --session "$BW_HASH")"
"${ENTER_CMD[@]}" "$item_array"
else
rofi_exit_code="$?"
item_array="$(bw list items --url "$url" --session "$BW_HASH")"
on_rofi_exit "$rofi_exit_code" "$item_array"
fi
}
show_folders() {
folders=$(bw list folders --session "$BW_HASH")
if folder=$(echo "$folders" | jq -r '.[] | .name' | rofi_menu); then
folder_id=$(echo "$folders" | jq -r ".[] | select(.name == \"$folder\").id")
ITEMS=$(bw list items --folderid "$folder_id" --session "$BW_HASH")
show_items
else
rofi_exit_code="$?"
folder_id=$(echo "$folders" | jq -r ".[] | select(.name == \"$folder\").id")
item_array=$(bw list items --folderid "$folder_id" --session "$BW_HASH")
on_rofi_exit "$rofi_exit_code" "$item_array"
fi
}
# re-sync the BitWarden items with the server
sync_bitwarden() {
bw sync --session "$BW_HASH" &>/dev/null || exit_error 1 "Failed to sync bitwarden"
load_items
show_items
}
# Evaluate the rofi exit codes
on_rofi_exit() {
case "$1" in
10) sync_bitwarden;;
11) load_items; show_items;;
12) show_urls;;
13) show_folders;;
17) copy_totp "$2";;
18) lock_vault;;
14) auto_type all "$2";;
15) auto_type username "$2";;
16) auto_type password "$2";;
*) exit "$1";;
esac
}
# Auto type using xdotool/ydotool
# $1: what to type; all, username, password
# $2: item array
auto_type() {
if not_unique "$2"; then
ITEMS="$2"
show_full_items
else
sleep 0.3
case "$1" in
all)
type_word "$(echo "$2" | jq -r '.[0].login.username')"
type_tab
type_word "$(echo "$2" | jq -r '.[0].login.password')"
;;
username)
type_word "$(echo "$2" | jq -r '.[0].login.username')"
;;
password)
type_word "$(echo "$2" | jq -r '.[0].login.password')"
;;
esac
fi
}
# Set $AUTOTYPE_MODE to a command that will emulate keyboard input
select_autotype_command() {
if [[ -z "$AUTOTYPE_MODE" ]]; then
if [ "$XDG_SESSION_TYPE" = "wayland" ] && hash ydotool 2>/dev/null; then
AUTOTYPE_MODE=(sudo ydotool)
elif [ "$XDG_SESSION_TYPE" != "wayland" ] && hash xdotool 2>/dev/null; then
AUTOTYPE_MODE=xdotool
fi
fi
}
type_word() {
"${AUTOTYPE_MODE[@]}" type "$1"
}
type_tab() {
"${AUTOTYPE_MODE[@]}" key Tab
}
# Set $CLIPBOARD_MODE to a command that will put stdin into the clipboard.
select_copy_command() {
if [[ -z "$CLIPBOARD_MODE" ]]; then
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
hash wl-copy 2>/dev/null && CLIPBOARD_MODE=wayland
elif hash xclip 2>/dev/null; then
CLIPBOARD_MODE=xclip
elif hash xsel 2>/dev/null; then
CLIPBOARD_MODE=xsel
fi
[ -z "$CLIPBOARD_MODE" ] && exit_error 1 "No clipboard command found. Please install either xclip, xsel, or wl-clipboard."
fi
}
clipboard-set() {
clipboard-${CLIPBOARD_MODE}-set
}
clipboard-get() {
clipboard-${CLIPBOARD_MODE}-get
}
clipboard-clear() {
clipboard-${CLIPBOARD_MODE}-clear
}
clipboard-xclip-set() {
xclip -selection clipboard -r
}
clipboard-xclip-get() {
xclip -selection clipboard -o
}
clipboard-xclip-clear() {
echo -n "" | xclip -selection clipboard -r
}
clipboard-xsel-set() {
xsel --clipboard --input
}
clipboard-xsel-get() {
xsel --clipboard
}
clipboard-xsel-clear() {
xsel --clipboard --delete
}
clipboard-wayland-set() {
wl-copy
}
clipboard-wayland-get() {
wl-paste
}
clipboard-wayland-clear() {
wl-copy --clear
}
# Copy the password
# copy to clipboard and give the user feedback that the password is copied
# $1: json array of items
copy_password() {
if not_unique "$1"; then
ITEMS="$1"
show_full_items
else
pass="$(echo "$1" | jq -r '.[0].login.password')"
show_copy_notification "$(echo "$1" | jq -r '.[0]')"
echo -n "$pass" | clipboard-set
if [[ $CLEAR -gt 0 ]]; then
sleep "$CLEAR"
if [[ "$(clipboard-get)" == "$pass" ]]; then
clipboard-clear
fi
fi
fi
}
# Copy the TOTP
# $1: item array
copy_totp() {
if not_unique "$1"; then
ITEMS="$item_array"
show_full_items
else
id=$(echo "$1" | jq -r ".[0].id")
if ! totp=$(bw --session "$BW_HASH" get totp "$id"); then
exit_error 1 "$totp"
fi
echo -n "$totp" | clipboard-set
notify-send "TOTP Copied"
fi
}
# Lock the vault by purging the key used to store the session hash
lock_vault() {
keyctl purge user bw_session &>/dev/null
}
# Show notification about the password being copied.
# $1: json item
show_copy_notification() {
local title
local body=""
local extra_options=()
title="<b>$(echo "$1" | jq -r '.name')</b> copied"
if [[ $SHOW_PASSWORD == "yes" ]]; then
pass=$(echo "$1" | jq -r '.login.password')
body="${pass:0:4}****"
fi
if [[ $CLEAR -gt 0 ]]; then
body="$body<br>Will be cleared in ${CLEAR} seconds."
# Keep notification visible while the clipboard contents are active.
extra_options+=("-t" "$((CLEAR * 1000))")
fi
# not sure if icon will be present everywhere, /usr/share/icons is default icon location
notify-send "$title" "$body" "${extra_options[@]}" -i /usr/share/icons/hicolor/64x64/apps/bitwarden.png
}
parse_cli_arguments() {
# Use GNU getopt to parse command line arguments
if ! ARGUMENTS=$(getopt -o c:C --long auto-lock:,clear:,no-clear,show-password,state-path:,help,version -- "$@"); then
exit_error 1 "Failed to parse command-line arguments"
fi
eval set -- "$ARGUMENTS"
while true; do
case "$1" in
--help )
cat <<-USAGE
$NAME $VERSION
Usage:
$NAME [options] -- [rofi options]
Options:
--help
Show this help text and exit.
--version
Show version information and exit.
--auto-lock <SECONDS>
Automatically lock the Vault <SECONDS> seconds after last unlock.
Use 0 to lock immediatly.
Use -1 to disable.
Default: 900 (15 minutes)
-c <SECONDS>, --clear <SECONDS>, --clear=<SECONDS>
Clear password from clipboard after this many seconds.
Defaults: ${DEFAULT_CLEAR} seconds.
-C, --no-clear
Don't automatically clear the password from the clipboard. This disables
the default --clear option.
--show-password
Show the first 4 characters of the copied password in the notification.
Quick Actions:
When hovering over an item in the rofi menu, you can make use of Quick Actions.
$KB_SYNC Resync your vault
$KB_URLSEARCH Search through urls
$KB_NAMESEARCH Search through names
$KB_FOLDERSELECT Search through folders
$KB_TOTPCOPY Copy the TOTP
$KB_TYPEALL Autotype the username and password [needs xdotool or ydotool]
$KB_TYPEUSER Autotype the username [needs xdotool or ydotool]
$KB_TYPEPASS Autotype the password [needs xdotool or ydotool]
$KB_LOCK Lock your vault
Examples:
# Default options work well
$NAME
# Immediatly lock the Vault after use
$NAME --auto-lock 0
# Never lock the Vault
$NAME --auto-lock -1
# Place rofi on top of screen, like a Quake console
$NAME -- -location 2
USAGE
shift
exit 0
;;
--version )
echo "$NAME $VERSION"
shift
exit 0
;;
--auto-lock )
AUTO_LOCK=$2
shift 2
;;
-c | --clear )
CLEAR="$2"
shift 2
;;
-C | --no-clear )
CLEAR=0
shift
;;
--show-password )
SHOW_PASSWORD=yes
shift
;;
-- )
shift
ROFI_OPTIONS=("$@")
break
;;
* )
exit_error 1 "Unknown option $1"
esac
done
}
parse_cli_arguments "$@"
get_session_key
select_autotype_command
select_copy_command
load_items
show_items

View File

@ -1,30 +0,0 @@
#!/bin/bash
# Helper functions
# Extract item or items matching .name, including deduplication
# $1: item name, prepended or not with deduplication mark
array_from_name() {
item_name="$(echo "$1" | sed "s/$DEDUP_MARK //")"
echo "$ITEMS" | jq -r ". | map(select((.name == \"$item_name\") and (.type == $TYPE_LOGIN)))"
}
# Extract item matching .id
# $1: string starting with ".id:"
array_from_id() {
echo "$ITEMS" | jq -r ". | map(select(.id == \"$1\"))"
}
# Count the number of items in an array. Return true if more than 1 or none
# $1: Array of items
not_unique() {
item_count=$(echo "$1" | jq -r '. | length')
! [[ $item_count -eq 1 ]]
}
# Pipe a document and deduplicate lines.
# Mark those duplicated by prepending $DEDUP_MARK
dedup_lines() {
sort | uniq -c \
| sed "s/^\s*1 //" \
| sed -r "s/^\s*[0-9]+ /$DEDUP_MARK /"
}

View File

@ -1,24 +0,0 @@
#!/usr/bin/env bash
winid=$(xdotool search --classname QuakeConsole)
mongeom=$(herbstclient attr monitors.focus.geometry)
monw=${mongeom%x*}
monw=$(( monw - 4 ))
curtag=$(herbstclient attr tags.focus.name)
if [ -z "$winid" ]; then
(
rules=( floating=on floating_geometry="${monw}x512+1+1" )
herbstclient rule once pid=$BASHPID maxage=10 "${rules[@]}"
exec st -c QuakeConsole -n QuakeConsole -t QuakeConsole
) &
else
hcid=$(printf "0x%x" "$winid")
visible=$(herbstclient attr clients."$hcid".visible)
wintag=$(herbstclient attr clients."$hcid".tag)
if [ "$visible" = "false" ] || [ "$wintag" != "$curtag" ]; then
herbstclient chain , lock , set_attr clients."$hcid".floating_geometry "${monw}x512+1+1" , bring "$winid" , unlock
else
herbstclient set_attr clients."$hcid".minimized true
fi
fi

View File

@ -1,73 +0,0 @@
#!/usr/bin/env sh
VERSION="0.0.2"
usage() {
echo 'stickyctl'
echo
echo "Version: $VERSION"
echo
echo 'stickyctl is a script to manage making windows (floating'
echo 'or tiled) sticky in herbstluftwm so it is visible on any'
echo 'tag.'
echo
echo 'Herbstluftwm autostart requirements:'
echo 'The following attributes need to be defined in the'
echo 'autostart file. This holds the window ID of the sticky'
echo 'window. It should be of type string'
echo ' my_sticky'
echo
echo 'Usage:'
echo ' stick Makes the focused window sticky.'
echo
echo ' unstick Clears the window ID and un-stick the'
echo ' window.'
echo
echo ' get-sticky Called when switching tags and gets'
echo ' the sticky window and pulls it to the'
echo ' current tag.'
echo
echo ' status Shows if a window is sticky. Use with'
echo ' status bars.'
echo
echo ' locate Focuses the sticky window.'
echo
echo ' reset Resets the my_sticky attribute in case'
echo ' the sticky window is closed without'
echo ' un-sticking it.'
exit 0
}
hc() {
herbstclient "$@"
}
case "$@" in
stick)
hc set_attr my_sticky $(hc attr clients.focus.winid)
notify-send -u normal "Sticky" "Window is <b><span foreground=\"#c0f83e\">STICKY</span></b>"
;;
unstick)
hc set_attr my_sticky ''
notify-send -u normal "Sticky" "Window is <b><span foreground=\"#c0f83e\">NOT STICKY</span></b>"
;;
get-sticky)
focused=$(hc get_attr clients.focus.winid)
hc bring $(hc attr my_sticky)
hc jumpto $focused
;;
status)
[[ -n $(hc attr my_sticky) ]] && echo "%{F#ffff52} %{F-} |" || echo ""
;;
locate)
hc jumpto "$(hc attr my_sticky)"
;;
reset)
hc set_attr my_sticky ''
notify-send -u critical -t 5000 "Sticky" "Sticky-Control is <b><span foreground=\"#ff4a52\">RESET</span></b>"
;;
*)
usage
;;
esac

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
cd ~/.timewarrior/
git add --all .
git commit -m 'timew-backup'
git push

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
sudo modprobe v4l2loopback devices=1 exclusive_caps=1 video_nr=4 card_label="virt_webcam"
ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video-webcam -vcodec copy -pix_fmt yuyv422 -f v4l2 /dev/video4
sudo rmmod v4l2loopback

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
running=$(pgrep xnots)
curtag=$(herbstclient attr tags.focus.name)
if [ -z "$running" ]; then
exec xnots
else
visible=
for winid in $(xdotool search --class XNots); do
hcid=$(printf "0x%x" "$winid")
if [ -z "$visible" ]; then
visible=$(herbstclient attr clients."$hcid".visible)
fi
wintag=$(herbstclient attr clients."$hcid".tag)
if [ "$visible" = false ] || [ "$wintag" != "$curtag" ]; then
herbstclient bring "$winid"
else
herbstclient set_attr clients."$hcid".minimized true
fi
done
fi

View File

@ -1,7 +0,0 @@
#!/bin/sh
if command -v st 2>/dev/null; then
st -f "monospace:pixelsize=26:antialias=true:autohint=true" -e nvim ~/writing +TZAtaraxis -c "lua require('telescope').setup { defaults = { layout_strategy = 'vertical', layout_config = { vertical = { preview_cutoff = 10 }}}}"
else
nvim ~/writing +TZAtaraxis -c "lua require('telescope').setup { defaults = { layout_strategy = 'vertical', layout_config = { vertical = { preview_cutoff = 10 }}}}"
fi

View File

@ -1,212 +0,0 @@
#? Config file for btop v. 1.2.13
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "/home/rudism/.config/btop/themes/catppuccin_mocha.theme"
#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = True
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True
#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
#* Use whitespace " " as separator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = False
#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = True
#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"
#* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace.
shown_boxes = "cpu mem net proc"
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 2000
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "cpu lazy"
#* Reverse sorting order, True or False.
proc_reversed = False
#* Show processes as a tree.
proc_tree = False
#* Use the cpu graph colors in the process list.
proc_colors = True
#* Use a darkening gradient in the process list.
proc_gradient = True
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = False
#* Show process memory as bytes instead of percent.
proc_mem_bytes = True
#* Show cpu graph for each process.
proc_cpu_graphs = True
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False
#* Show proc box on left side of screen instead of right.
proc_left = False
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
proc_filter_kernel = False
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "total"
#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "total"
#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True
#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False
#* Show cpu box at bottom of screen instead of top.
cpu_bottom = False
#* Shows the system uptime in the CPU box.
show_uptime = True
#* Show cpu temperature.
check_temp = True
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""
#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = False
#* Show CPU frequency.
show_cpu_freq = True
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%X"
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True
#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
disks_filter = ""
#* Show graphs instead of meters for memory values.
mem_graphs = True
#* Show mem box below net box instead of above.
mem_below_net = False
#* Count ZFS ARC in cached and available memory.
zfs_arc_cached = True
#* If swap memory should be shown in memory box.
show_swap = True
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = True
#* If mem box should be split to also show disks info.
show_disks = True
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True
#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = True
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
zfs_hide_datasets = False
#* Set to true to show available disk space for privileged users.
disk_free_priv = False
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = False
#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = False
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""
#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100
net_upload = 100
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = True
#* Starts with the Network Interface specified here.
net_iface = ""
#* Show battery stats in top right if battery is present.
show_battery = True
#* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto"
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "WARNING"

View File

@ -1,42 +0,0 @@
theme[main_bg]="#1E1E2E"
theme[main_fg]="#CDD6F4"
theme[title]="#CDD6F4"
theme[hi_fg]="#89B4FA"
theme[selected_bg]="#45475A"
theme[selected_fg]="#89B4FA"
theme[inactive_fg]="#7F849C"
theme[graph_text]="#F5E0DC"
theme[meter_bg]="#45475A"
theme[proc_misc]="#F5E0DC"
theme[cpu_box]="#74C7EC"
theme[mem_box]="#A6E3A1"
theme[net_box]="#CBA6F7"
theme[proc_box]="#F2CDCD"
theme[div_line]="#6C7086"
theme[temp_start]="#F9E2AF"
theme[temp_mid]="#FAB387"
theme[temp_end]="#F38BA8"
theme[cpu_start]="#74C7EC"
theme[cpu_mid]="#89DCEB"
theme[cpu_end]="#94E2D5"
theme[free_start]="#94E2D5"
theme[free_mid]="#94E2D5"
theme[free_end]="#A6E3A1"
theme[cached_start]="#F5C2E7"
theme[cached_mid]="#F5C2E7"
theme[cached_end]="#CBA6F7"
theme[available_start]="#F5E0DC"
theme[available_mid]="#F2CDCD"
theme[available_end]="#F2CDCD"
theme[used_start]="#FAB387"
theme[used_mid]="#FAB387"
theme[used_end]="#F38BA8"
theme[download_start]="#B4BEFE"
theme[download_mid]="#B4BEFE"
theme[download_end]="#CBA6F7"
theme[upload_start]="#B4BEFE"
theme[upload_mid]="#B4BEFE"
theme[upload_end]="#CBA6F7"
theme[process_start]="#74C7EC"
theme[process_mid]="#89DCEB"
theme[process_end]="#94E2D5"

View File

@ -1,5 +0,0 @@
## Build Files
- `st` builds [st](https://st.suckless.org/) with my custom config and installs to `/usr/local`
- `x265` builds a multi-bitrate [x265](https://bitbucket.org/multicoreware/x265_git) with numa support and installs to `/home/rudism/.local`
- `newtabber` is my config and publish script for [my new tab generator](https://code.sitosis.com/rudism/newtabber)

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
builddir="$(dirname "$0")"
pushd "$builddir"
if [ -d "./st" ]; then
git -C "./st" pull
else
git clone "https://git.suckless.org/st"
fi
cp config.h ./st/
cd st
make
sudo make install
popd

View File

@ -1,472 +0,0 @@
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "monospace:pixelsize=16:antialias=true:autohint=true";
static int borderpx = 2;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
/* alt screens */
int allowaltscreen = 1;
/* allow certain non-interactive (insecure) window operations such as:
setting the clipboard text */
int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 8;
static double maxlatency = 33;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0;
/* default TERM value */
char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"#45475A",
"#F38BA8",
"#A6E3A1",
"#F9E2AF",
"#89B4FA",
"#F5C2E7",
"#94E2D5",
"#BAC2DE",
/* 8 bright colors */
"#585B70",
"#F38BA8",
"#A6E3A1",
"#F9E2AF",
"#89B4FA",
"#F5C2E7",
"#94E2D5",
"#A6ADC8",
[256] = "#CDD6F4", /* default foreground colour */
[257] = "#1E1E2E", /* default background colour */
[258] = "#F5E0DC", /*575268*/
};
/*
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 256;
unsigned int defaultbg = 257;
unsigned int defaultcs = 258;
static unsigned int defaultrcs = 258;
/*
* Default shape of cursor
* 2: Block ("")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("")
*/
static unsigned int cursorshape = 4;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80;
static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7;
static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
/*{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },*/
{ TERMMOD, XK_Prior, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ XK_ANY_MOD, 0xFF57, clipcopy, {.i = 0} },
{ XK_ANY_MOD, 0xFF6D, clippaste, {.i = 0} },
};
/*
* Special keys (change & recompile st.info accordingly)
*
* Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = {
/* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
};
/*
* Selection types' masks.
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress.
* ButtonRelease and MotionNotify.
* If no match is found, regular selection is used.
*/
static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask,
};
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -1,58 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
builddir="$(dirname "$0")"
pushd "$builddir"
rm -rf ./build ./build-10 ./build-12
if [ ! -d "./x265_git" ]; then
git clone --depth 1 --branch 3.4.1 "https://bitbucket.org/multicoreware/x265_git.git"
fi
cmake -S x265_git/source -B build-12 \
-DCMAKE_INSTALL_PREFIX='/home/rudism/.local' \
-DCMAKE_ASM_NASM_FLAGS='-w-macro-params-legacy' \
-DENABLE_ASSEMBLY='ON' \
-DENABLE_LIBNUMA='ON' \
-DHIGH_BIT_DEPTH='ON' \
-DMAIN12='ON' \
-DEXPORT_C_API='OFF' \
-DENABLE_CLI='OFF' \
-DENABLE_SHARED='OFF' \
-Wno-dev
make -C build-12
cmake -S x265_git/source -B build-10 \
-DCMAKE_INSTALL_PREFIX='/home/rudism/.local' \
-DCMAKE_ASM_NASM_FLAGS='-w-macro-params-legacy' \
-DENABLE_ASSEMBLY='ON' \
-DENABLE_LIBNUMA='ON' \
-DHIGH_BIT_DEPTH='ON' \
-DEXPORT_C_API='OFF' \
-DENABLE_CLI='OFF' \
-DENABLE_SHARED='OFF' \
-Wno-dev
make -C build-10
cmake -S x265_git/source -B build \
-DCMAKE_INSTALL_PREFIX:PATH='/home/rudism/.local' \
-DCMAKE_ASM_NASM_FLAGS='-w-macro-params-legacy' \
-DENABLE_ASSEMBLY='ON' \
-DENABLE_SHARED='ON' \
-DENABLE_LIBNUMA='ON' \
-DENABLE_HDR10_PLUS='ON' \
-DEXTRA_LIB='x265_main10.a;x265_main12.a' \
-DEXTRA_LINK_FLAGS='-L.' \
-DLINKED_10BIT='ON' \
-DLINKED_12BIT='ON' \
-Wno-dev
ln -s ../build-10/libx265.a build/libx265_main10.a
ln -s ../build-12/libx265.a build/libx265_main12.a
make -C build
make -C build install
popd

View File

@ -1,21 +0,0 @@
[global]
width = (100, 600)
offset = 50x50
corner_radius = 15
font = Monospace 18
frame_color = "#89B4FA"
separator_color= frame
[urgency_low]
background = "#1E1E2E"
foreground = "#CDD6F4"
[urgency_normal]
background = "#1E1E2E"
foreground = "#CDD6F4"
[urgency_critical]
background = "#1E1E2E"
foreground = "#CDD6F4"
frame_color = "#FAB387"

View File

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fontconfig>
<alias>
<family>monospace</family>
<prefer>
<family>Drafting* Mono</family>
<family>Unifont</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
<family>Unifont</family>
</prefer>
</alias>
<alias>
<family>Helvetica</family>
<prefer>
<family>DejaVu Sans</family>
</prefer>
</alias>
<alias>
<family>Times</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>Georgia</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>Charter</family>
<prefer>
<family>DejaVu Serif</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
<family>Unifont</family>
</prefer>
</alias>
<match target="font">
<test name="spacing" compare="eq">
<const>mono</const>
</test>
<edit name="embolden" mode="assign">
<bool>false</bool>
</edit>
</match>
</fontconfig>

View File

@ -1 +0,0 @@
pinentry-program /usr/bin/pinentry-curses

View File

@ -1,181 +0,0 @@
#!/usr/bin/env bash
PATH="$PATH:$HOME/.local/bin"
hc() {
herbstclient "$@"
}
# don't need sticky win on pinebook
hc new_attr string my_sticky
refresh_panel="pgrep -f 'bash.*panel\.sh' | xargs -n1 kill -s USR1"
hc emit_hook reload
if hc silent new_attr bool my_picom_is_running; then
picom -b
fi
hc lock
hsetroot -solid "#1e1e2e"
feh --bg-fill ~/.config/herbstluftwm/wallpaper.png
xobpipe="$XDG_RUNTIME_DIR/xobpipe"
# theme
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set always_show_frame on
hc set frame_bg_transparent off
hc attr theme.active.color '#a6e3a1'
hc attr theme.normal.color '#89b4fa'
hc attr theme.urgent.color '#f38ba8'
hc attr theme.inner_color black
hc attr theme.border_width 1
hc attr theme.floating.border_width 2
hc attr theme.floating.outer_width 1
hc attr theme.floating.outer_color black
hc attr theme.background_color '#1e1e2e'
hc set window_gap 0
hc set frame_padding 0
hc set smart_window_surroundings on
hc set smart_frame_surroundings on
hc set mouse_recenter_gap 0
hc set frame_active_opacity 1
hc set frame_normal_opacity 1
hc set frame_bg_active_color '#0000000000'
hc set snap_distance 0
hc set snap_gap 0
hc unlock
# remove all existing keybindings
hc keyunbind --all
hc set default_frame_layout horizontal
hc set_layout horizontal
# keybindings
Mod=Mod4 # Use the super key as the main modifier
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Control-r reload
hc keybind $Mod-Shift-c close
hc keybind $Mod-Return spawn st
hc keybind $Mod-grave spawn $HOME/skynet/bin/quake-term
hc keybind $Mod-Control-grave spawn $HOME/skynet/bin/xnots-toggle
hc keybind $Mod-Alt-Return spawn ~/skynet/bin/zenvim
hc keybind $Mod-Control-Return spawn firefox
hc keybind Print spawn flameshot gui
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-d spawn rofi -show drun -show-icons
hc keybind $Mod-r spawn rofi -show run
hc keybind $Mod-F1 spawn sh -c 'CM_LAUNCHER=rofi clipmenu'
hc keybind $Mod-F2 spawn rofi -show calc -modi calc -no-show-match -no-sort
hc keybind $Mod-F3 spawn sh -c 'clipctl disable; bwmenu; clipctl enable'
hc keybind XF86AudioPlay spawn playerctl play-pause
hc keybind XF86AudioPause spawn playerctl pause-pause
hc keybind XF86AudioRaiseVolume spawn sh -c "pamixer -i 5; pamixer --get-volume > \"$xobpipe\"; $refresh_panel"
hc keybind XF86AudioLowerVolume spawn sh -c "pamixer -d 5; pamixer --get-volume > \"$xobpipe\"; $refresh_panel"
hc keybind XF86AudioMute spawn sh -c "pamixer -t; pamixer --get-volume-human | sed 's/muted/0/' > \"$xobpipe\"; $refresh_panel"
hc keybind XF86Launch7 spawn sh -c "sleep 0.15 && xdotool keydown ctrl key w keyup ctrl"
hc keybind XF86PowerOff spawn battlvl
hc keybind XF86MonBrightnessUp spawn sh -c "light -A 5; light > \"$xobpipe\""
hc keybind XF86MonBrightnessDown spawn sh -c "light -U 5; light > \"$xobpipe\""
# mouse
hc mouseunbind --all
hc set focus_follows_mouse true
hc set focus_follows_monitor_boundaries true
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button3 resize
# basic movement in tiling and floating mode
# focusing clients
hc keybind $Mod-Left focus left
hc keybind $Mod-Down focus down
hc keybind $Mod-Up focus up
hc keybind $Mod-Right focus right
# moving clients in tiling and floating mode
hc keybind $Mod-Shift-Left shift left
hc keybind $Mod-Shift-Down shift down
hc keybind $Mod-Shift-Up shift up
hc keybind $Mod-Shift-Right shift right
hc keybind $Mod-j spawn ~/skynet/bin/stickyctl stick
hc keybind $Mod-Shift-j spawn ~/skynet/bin/stickyctl unstick
# tags
tag_names=( {1..9} 0 )
tag_keys=( {1..9} 0 )
hc rename default "${tag_names[0]}" || true
for i in "${!tag_names[@]}" ; do
hc add "${tag_names[$i]}"
key="${tag_keys[$i]}"
if ! [ -z "$key" ] ; then
hc keybind "$Mod-$key" chain , lock , use_index "$i" , spawn ~/skynet/bin/stickyctl get-sticky , unlock
hc keybind "$Mod-Shift-$key" move_index "$i"
fi
done
# cycle through tags
hc keybind $Mod-Control-Right use_index +1 --skip-visible
hc keybind $Mod-Control-Left use_index -1 --skip-visible
hc keybind XF86Paste use_index +1 --skip_visible
hc keybind XF86Copy use_index -1 --skip_visible
# layouting
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
# The following cycles through the available layouts within a frame, but skips
# layouts, if the layout change wouldn't affect the actual window positions.
# I.e. if there are two windows within a frame, the grid layout is skipped.
hc keybind $Mod-space or , and . compare tags.focus.curframe_wcount = 2 . cycle_layout +1 vertical horizontal max vertical grid , cycle_layout +1
# focus
hc keybind $Mod-BackSpace cycle_monitor
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-Alt-Tab jumpto urgent
# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=on # normally focus new clients
hc rule floatplacement=smart
#hc rule focus=off # normally do not focus new clients
# give focus to most common terminals
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
hc rule class='nvim-zen' fullscreen=on
hc rule class='mpv' floating=on
hc rule class='sim_arduboy' floating=on
hc rule class='XNots' floating=on
hc rule class='Pithos' floating=on
hc set tree_style '╾│ ├└╼─┐'
# unlock, just to be sure
hc unlock
# do multi monitor setup here, e.g.:
# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
# or simply:
hc detect_monitors
# restart panel
~/.config/herbstluftwm/killpanel.sh
{ exec ~/.config/herbstluftwm/panel.sh; } &
# restart xob
pgrep xob | xargs -n1 kill -9
if [ ! -p "$xobpipe" ]; then
mkfifo "$xobpipe"
fi
{ tail -f "$xobpipe" | xob; } &

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
pgrep -f 'panel_text' | xargs -n1 kill -9
pgrep -f 'lemonbar' | xargs -n1 kill -9
pgrep -f 'xobpipe' | xargs -n1 kill -9
pgrep -f 'trayer' | xargs -n1 kill -9
pgrep -f 'bash.*panel\.sh' | xargs -n1 kill -9

View File

@ -1,452 +0,0 @@
#!/usr/bin/env bash
hostname=$(hostname)
hc() { herbstclient "$@" ;}
panel_height=20
for monitor in $(hc list_monitors | cut -d: -f1); do
hc pad "$monitor" "$panel_height" 0 0 0
done
{ sleep 1; exec trayer --SetPartialStrut false --edge top --height 20 --widthtype request --align right --tint 0x11111b --transparent true --alpha 0; } &
fggreen='%{F#a6e3a1}'
fgblue='%{F#89b4fa}'
fgred='%{F#f38ba8}'
fgdark='%{F#313244}'
fgend='%{F-}'
bggreen='%{B#a6e3a1}'
bgblue='%{B#89b4fa}'
bgred='%{B#f38ba8}'
bglight='%{B#313244}'
bgend='%{B-}'
ulblue='%{U#89b4fa+u}'
ulend='%{-u}'
handle_signal() {
FORCE_REFRESH=1
}
handle_kill() {
kill 0
rm "$fifo"
exit 0
}
trap handle_signal SIGUSR1
trap handle_kill SIGINT
fifo="/tmp/panel_text"
if [ ! -p "$fifo" ]; then
mkfifo "$fifo"
fi
msgfifo="/tmp/panel_msg"
if [ ! -p "$msgfifo" ]; then
mkfifo "$msgfifo"
fi
# process to handle lemonbar clicks
{
while IFS= read -r line; do
IFS="-" read -r -a command <<< "$line"
if [ "${command[0]}" = "tag" ]; then
# not sure how to specify a monitor, but probably don't need to anyway
monitor="${command[1]}"
index=$(( "${command[2]}" - 1 ))
if [ "$index" -eq -1 ]; then
index=9
fi
herbstclient chain , lock , focus_monitor "$monitor" , use_index "$index" , spawn stickyctl get-sticky , unlock
fi
done < "$msgfifo"
} &
tail -f "$fifo" | stdbuf -oL lemonbar -d -p -a 100 -g "x${panel_height}" -f "Drafting* Mono:pixelsize=18:antialias=true" -f "Unifont:pixelsize=18:antialias=true" -B "#11111b" -F "#cdd6f4" > "$msgfifo" &
append_segment() {
local seconds=$1
local name=$2
local param=$3
shift
local now=$SECONDS
local escparam
segment_text=''
escparam="${param//\//_}"
eval "local lastrun=\$${name}${escparam}_lastrun"
if [ -z "$lastrun" ]; then
lastrun=0
fi
if [ -n "$FORCE_REFRESH" ] || [ "$lastrun" -eq 0 ] || (( SECONDS - lastrun >= seconds )); then
"$@"
eval "${name}${escparam}_lastrun=\$now"
eval "${name}${escparam}_lastoutput=\"$segment_text\""
panel_text="$panel_text$segment_text"
else
eval "panel_text=\"\$panel_text\$${name}${escparam}_lastoutput\""
fi
}
append_separator() {
panel_text="$panel_text "
}
append_percent_icon() {
local pct=$1
segment_text="$segment_text$bglight"
if (( pct < 12 )); then
segment_text="$segment_text"
elif (( pct < 25 )); then
segment_text="$segment_text"
elif (( pct < 38 )); then
segment_text="$segment_text"
elif (( pct < 51 )); then
segment_text="$segment_text"
elif (( pct < 64 )); then
segment_text="$segment_text"
elif (( pct < 77 )); then
segment_text="$segment_text"
elif (( pct < 90 )); then
segment_text="$segment_text"
else
segment_text="$segment_text"
fi
segment_text="$segment_text$bgend%{O5}"
}
append_battery_icon() {
local pct=$1
segment_text="$segment_text$bglight"
if (( pct < 10 )); then
segment_text="$segment_text"
elif (( pct < 20 )); then
segment_text="$segment_text"
elif (( pct < 30 )); then
segment_text="$segment_text"
elif (( pct < 40 )); then
segment_text="$segment_text"
elif (( pct < 50 )); then
segment_text="$segment_text"
elif (( pct < 60 )); then
segment_text="$segment_text"
elif (( pct < 70 )); then
segment_text="$segment_text"
elif (( pct < 80 )); then
segment_text="$segment_text"
elif (( pct < 90 )); then
segment_text="$segment_text"
else
segment_text="$segment_text"
fi
segment_text="$segment_text$bgend%{O5}"
}
segment_tags() {
local monitor=$1
local tags
local prefix
local tagclass
IFS=$'\t' read -ra tags <<< "$(hc tag_status "$monitor")"
segment_text=''
for i in "${tags[@]}"; do
prefix=${i:0:1}
case $prefix in
'.') tagclass=$fgend$bgend ;;
'+') tagclass=$bgblue$fgdark ;;
'#') tagclass=$bggreen$fgdark ;;
'!') tagclass=$bgred$fgdark ;;
'-') tagclass=$ulblue$bglight$fgblue ;;
'%') tagclass=$ulblue$bglight$fgblue ;;
*) tagclass=$bglight ;;
esac
segment_text="$segment_text%{A:tag-$monitor-${i:1}:}$tagclass%{O8}${i:1}%{O8}%{A}$fgend$bgend$ulend"
done
}
segment_timew() {
local curday
local active
local twclass
local twicon
if hash timew 2>/dev/null; then
active=$(timew get dom.active)
if [ "$active" = "1" ]; then
twicon=""
twclass=$fggreen
else
twicon=""
twclass=$fgred
fi
curday=$(timew summary | tail -n2 | head -n1 | awk '{ print $1 }')
if [ "$curday" = "No" ]; then
curday='0:00'
else
curday="${curday%:*}"
fi
segment_text="${twclass}${twicon}${fgend}%{O5}$curday"
fi
}
segment_keyboard() {
local kblayout
local kbclass
local kbicon
kblayout=$(setxkbmap -query | grep variant | awk '{ print $2 }' | tr -d ',')
if [ "$kblayout" = "dvorak" ]; then
kbclass=$fgred
kbicon=""
else
kbclass=$fggreen
kbicon=""
fi
segment_text="$kbclass$kbicon$fgend"
}
segment_network() {
local net
local neticon
local btpower
local btconn
local bticon
local nasavpn
local nasaicon
local vnc
local vncicon
# network device
net=$(ip route get 1.1.1.1 | grep -Po '(?<=dev\s)\w+' | cut -f1 -d ' ')
if ! [ "$net" ]; then
neticon="%{O3}$fgred$fgend"
else
neticon="%{O3}$fggreenﯱ$fgend"
fi
if hash bluetoothctl 2>/dev/null; then
# bluetooth status
btpower=$(bluetoothctl show | grep Powered | awk '{ print $2 }')
if [ "$btpower" = "yes" ]; then
btconn=$(bluetoothctl devices | cut -f2 -d' ' | while read uuid; do bluetoothctl info $uuid; done | grep "Connected: yes")
if [ -z "$btconn" ]; then
bticon="${fggreen}$fgend"
else
bticon="${fgblue}$fgend"
fi
else
bticon="${fgred}$fgend"
fi
fi
if hash docker 2>/dev/null; then
nasavpn=$(docker ps --format "{{.Names}}" | grep nasavpn)
if [ -n "$nasavpn" ]; then
nasaicon="%{O3}${fggreen}$fgend"
else
nasaicon="%{O3}${fgred}$fgend"
fi
vnc=$(docker ps --format "{{.Names}}" | grep novnc)
if [ -n "$vnc" ]; then
vncicon="%{O3}${fggreen}$fgend"
else
vncicon="%{O3}${fgred}$fgend"
fi
fi
segment_text="$bticon$nasaicon$vncicon$neticon"
}
segment_memory() {
local mempct
local memclass
mempct=$(free | grep Mem | awk '{ print int($3/$2 * 100.0 + 0.5) }')
if [ "$mempct" -gt 75 ]; then
memclass=$fgred
elif [ "$mempct" -gt 50 ]; then
memclass=$fgblue
else
memclass=$fggreen
fi
segment_text=$memclass
append_percent_icon "$mempct"
segment_text="${segment_text}$fgend"
}
segment_disk() {
local dpath=$1
local diskpct
local diskclass
local diskicon
if [ "$dpath" = "/" ]; then
diskicon=""
else
diskicon=""
fi
diskpct=$(df --output=pcent "$dpath" | sed 1d | sed 's/^[ \t]*//' | sed 's/%.*//')
if [ "$diskpct" -gt 90 ]; then
diskclass=$fgred
elif [ "$diskpct" -gt 75 ]; then
diskclass=$fgblue
else
diskclass=$fggreen
fi
segment_text=$diskclass
append_percent_icon "$diskpct"
segment_text="${segment_text}$diskicon$fgend"
}
segment_cpu() {
local cpupct
local cpuclass
cpupct=$(awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1); }' <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat) | awk '{print int($1+0.5)}')
if [ "$cpupct" -gt 90 ]; then
cpuclass=$fgred
elif [ "$cpupct" -gt 25 ]; then
cpuclass=$fgblue
else
cpuclass=$fggreen
fi
segment_text=$cpuclass
append_percent_icon "$cpupct"
segment_text="${segment_text}$fgend"
}
segment_audio() {
local audiohdmi
local audiobt
local audicon
local volpct
if hash pactl 2>/dev/null; then
# audio output device (hdmi/analog)
audiohdmi=$(pactl get-default-sink | grep hdmi)
audiobt=$(pactl get-default-sink | grep bluez)
fi
if [ -n "$audiobt" ]; then
audclass=$fgblue
audicon='﫽'
else
audclass=$fggreen
if [ "$hostname" != "ellison" ]; then
if [ -z "$audiohdmi" ]; then
audicon=''
else
audicon='蓼'
fi
else
audicon='蓼'
fi
fi
if hash pamixer 2>/dev/null; then
volpct=$(pamixer --get-volume-human | sed 's/%//')
if [ "$volpct" = "muted" ]; then
audclass=$fgred
volpct="0"
fi
fi
segment_text=$audclass
append_percent_icon "$volpct"
segment_text="$segment_text$audicon$fgend"
}
segment_battery() {
local battpct
local batstat
local baticon
local batclass
if hash upower 2>/dev/null; then
# battery charge percent
battpct="$(upower --show-info $(upower --enumerate | grep -i 'BAT') | grep -E "percentage" | awk '{print $2}')"
battpct="${battpct%\%}"
# battery status (charging/charged/etc)
batstat="$(upower --show-info $(upower --enumerate | grep -i 'BAT') | grep -E "state" | awk '{print $2}')"
if (( battpct > 80 )); then
batclass=$fggreen
elif (( battpct < 20 )); then
batclass=$fgred
else
batclass=$fgblue
fi
segment_text="$batclass"
if [ "$batstat" = "charging" ]; then
segment_text="${segment_text}"
elif [ "$batstat" = "fully-charged" ]; then
segment_text="${segment_text}"
else
append_battery_icon "$battpct"
fi
segment_text="$segment_text$fgend"
else
segment_text="$fggreenﮣ$fgend"
fi
}
segment_date() {
segment_text="$(date +$'%a %b %d') $fgblue$(date +$'%H:%M')$fgend"
}
last_text=''
while true; do
{
full_text=''
for monitor in $(herbstclient list_monitors | cut -d: -f1); do
panel_text="%{S$monitor}%{l}"
append_segment 0 segment_tags "$monitor"
panel_text="$panel_text%{l}%{r}"
append_segment 60 segment_timew
append_separator
append_segment 60 segment_keyboard
append_separator
append_segment 10 segment_network
append_separator
panel_text="$panel_text%{A:conky:}"
append_segment 10 segment_memory
append_separator
append_segment 60 segment_disk "/"
append_separator
if [ "$hostname" != "ellison" ]; then
append_segment 60 segment_disk "/home"
append_separator
fi
append_segment 5 segment_cpu
append_separator
append_segment 60 segment_audio
append_separator
append_segment 30 segment_battery
panel_text="$panel_text%{A}"
append_separator
append_segment 60 segment_date
if [ "$monitor" -eq 0 ]; then
tray_width=$(xdotool search --classname panel | xargs -n1 xprop -id | grep 'program specified minimum size' | cut -d ' ' -f 5)
tray_width=$(( tray_width + 5 ))
panel_text="$panel_text%{O$tray_width}"
fi
panel_text="$panel_text%{r}"
full_text="$full_text$panel_text"
done
if [ "$full_text" != "$last_text" ]; then
echo -e "$full_text"
last_text="$full_text"
fi
} >> "$fifo"
unset FORCE_REFRESH
sleep 1
done

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 MiB

17
kde/clear-shortcuts Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# 1. run this script to clear all default KDE shortcuts
# 2. add missing applications to shortcuts config
# (yakuake, flameshot, konsole, bitwarden)
# 3. import kde-shortcuts.kksrc
hotkeysRC="$HOME/.config/kglobalshortcutsrc"
# Remove application launching shortcuts.
sed -i 's/_launch=[^,]*/_launch=none/g' "$hotkeysRC"
# Remove other global shortcuts.
sed -i 's/^\([^_][^=]*\)=[^,]*,/\1=none,/g' "$hotkeysRC"
# Reload hotkeys.
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &

67
kde/kde-shortcuts.kksrc Normal file
View File

@ -0,0 +1,67 @@
[bitwarden.desktop][Global Shortcuts]
_launch=Meta+B
[kwin][Global Shortcuts]
Switch Window Down=Meta+T
Switch Window Left=Meta+H
Switch Window Right=Meta+N
Switch Window Up=Meta+C
Switch to Desktop 1=Meta+1
Switch to Desktop 10=Meta+0
Switch to Desktop 2=Meta+2
Switch to Desktop 3=Meta+3
Switch to Desktop 4=Meta+4
Switch to Desktop 5=Meta+5
Switch to Desktop 6=Meta+6
Switch to Desktop 7=Meta+7
Switch to Desktop 8=Meta+8
Switch to Desktop 9=Meta+9
Walk Through Windows=Meta+Tab
Walk Through Windows (Reverse)=Meta+Shift+Tab
Window Close=Meta+X
Window Maximize=Meta+F
Window Quick Tile Bottom=Meta+E
Window Quick Tile Left=Meta+O
Window Quick Tile Right=Meta+U
Window Quick Tile Top=Meta+.
Window to Desktop 1=Meta+F1
Window to Desktop 10=Meta+F10
Window to Desktop 2=Meta+F2
Window to Desktop 3=Meta+F3
Window to Desktop 4=Meta+F4
Window to Desktop 5=Meta+F5
Window to Desktop 6=Meta+F6
Window to Desktop 7=Meta+F7
Window to Desktop 8=Meta+F8
Window to Desktop 9=Meta+F9
view_zoom_in=Meta+_
view_zoom_out=Meta+-
[org.kde.konsole.desktop][Global Shortcuts]
_launch=Meta+Return
[yakuake][Global Shortcuts]
toggle-window-state=Meta+`
[org.kde.krunner.desktop][Global Shortcuts]
_launch=Meta+Space
[org.flameshot.Flameshot.desktop][Global Shortcuts]
Capture=Print
[kmix][Global Shortcuts]
decrease_volume=Volume Down
increase_volume=Volume Up
mute=Volume Mute
[org_kde_powerdevil][Global Shortcuts]
Decrease Screen Brightness=Monitor Brightness Down
Increase Screen Brightness=Monitor Brightness Up
PowerOff=Power Off
[mediacontrol][Global Shortcuts]
nextmedia=Media Next
pausemedia=Media Pause
playpausemedia=Media Play
previousmedia=Media Previous
stopmedia=Media Stop

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -8,14 +8,17 @@
{ "title": "Notes", "url": "https://notes.sitosis.com", "icon": "journal-text" },
{ "title": "Read", "url": "https://read.sitosis.com/", "icon": "book" },
{ "title": "Bitwarden", "url": "https://pass.sitosis.com/", "icon": "fingerprint" },
{ "title": "ChatPad", "url": "https://k.rdsm.ca/", "icon": "robot" },
{ "title": "ChatGPT", "url": "https://k.rdsm.ca/", "icon": "robot" },
{ "title": "Router", "url": "https://router.ln0.us/", "icon": "router" },
{ "title": "Wifi", "url": "https://home.ln0.us:8443/", "icon": "wifi" },
{ "title": "Location", "url": "https://loc.sitosis.com/", "icon": "geo-alt-fill" },
{ "title": "Jellyfin", "url": "https://home.ln0.us:8920/", "icon": "collection-play" },
{ "title": "Nebula", "url": "https://nebula.app/myshows", "icon": "film" },
{ "title": "YouTube", "url": "https://www.youtube.com/feed/subscriptions", "icon": "youtube" },
{ "title": "Audiobooks", "url": "https://rdsm.ca/audio", "icon": "cassette-fill" },
{ "title": "Audiobooks", "url": "https://audio.home.ln0.us/", "icon": "cassette-fill" },
{ "title": "Pandora", "url": "https://www.pandora.com/", "icon": "music-note-list" },
{ "title": "Radiostasis", "url": "https://radiostasis.com/", "icon": "broadcast-pin" }
{ "title": "Radiostasis", "url": "https://radiostasis.com/", "icon": "broadcast-pin" },
{ "title": "Net Authority", "url": "https://netauthority.org/", "icon": "mastodon" },
{ "title": "Waking Up", "url": "https://app.wakingup.com/", "icon": "flower1" },
{ "title": "Light Phone", "url": "https://dashboard.thelightphone.com/devices/4234ac50-9d96-433c-9f25-c8d3ff15c7c5", "icon": "phone" }
]

4
nvim/install-packer Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim

3
nvim/lua/.luarc.json Normal file
View File

@ -0,0 +1,3 @@
{
"workspace.checkThirdParty": false
}

1
nvim/lua/node_modules/.bin/typescript-language-server generated vendored Symbolic link
View File

@ -0,0 +1 @@
../typescript-language-server/lib/cli.mjs

18
nvim/lua/node_modules/.package-lock.json generated vendored Normal file
View File

@ -0,0 +1,18 @@
{
"name": "lua",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/typescript-language-server": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/typescript-language-server/-/typescript-language-server-3.3.1.tgz",
"integrity": "sha512-sm9KNsjYMxzXTNhkNK05K3BN1NkYlOFF4TgqVvzk8l9E2I5SBE7Odrhe3LzCA/78MASO1nWfXx3u96wAhLIhsw==",
"bin": {
"typescript-language-server": "lib/cli.mjs"
},
"engines": {
"node": ">=14.17"
}
}
}
}

View File

@ -0,0 +1,514 @@
# Changelog
All notable changes to this project will be documented in this file.
## [3.3.1](https://github.com/typescript-language-server/typescript-language-server/compare/v3.3.0...v3.3.1) (2023-03-27)
### Bug Fixes
* don't report InternalError on tsserver error response ([#709](https://github.com/typescript-language-server/typescript-language-server/issues/709)) ([3e63165](https://github.com/typescript-language-server/typescript-language-server/commit/3e6316546eb5c8b6fd2fb8c26c88b7b6a6331472))
## [3.3.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.2.0...v3.3.0) (2023-02-20)
### Features
* start separate tsServer instance for semantic requests ([#688](https://github.com/typescript-language-server/typescript-language-server/issues/688)) ([fa65b84](https://github.com/typescript-language-server/typescript-language-server/commit/fa65b847f4a87672cc28302f38fd86e8f56d6112))
### Bug Fixes
* **completions:** include `filterText` property by default ([#693](https://github.com/typescript-language-server/typescript-language-server/issues/693)) ([c07426a](https://github.com/typescript-language-server/typescript-language-server/commit/c07426adc8b079273c267e18d11993d53d482886))
## [3.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.1.0...v3.2.0) (2023-02-14)
### Features
* `source.removeUnusedImports.ts` and `source.sortImports.ts` actions ([#681](https://github.com/typescript-language-server/typescript-language-server/issues/681)) ([a43b2df](https://github.com/typescript-language-server/typescript-language-server/commit/a43b2df471572ca2e25b12899f65fca77853af35))
* provide filterText property in completions ([#678](https://github.com/typescript-language-server/typescript-language-server/issues/678)) ([af44f8b](https://github.com/typescript-language-server/typescript-language-server/commit/af44f8b1b5a252ca9ba019691ad81dc2e5006468))
* support `workspace/willRenameFiles` request ([#685](https://github.com/typescript-language-server/typescript-language-server/issues/685)) ([c3f3529](https://github.com/typescript-language-server/typescript-language-server/commit/c3f3529be45a1630fe7903a5af9e732855f2c664))
### Bug Fixes
* **completions:** don't set `filterText` after all ([#686](https://github.com/typescript-language-server/typescript-language-server/issues/686)) ([4c5d295](https://github.com/typescript-language-server/typescript-language-server/commit/4c5d295d4f71f6b5d8f2c58e908d5cc79cb9e3d2))
* **completions:** don't set commitCharacters unless client supports those ([#684](https://github.com/typescript-language-server/typescript-language-server/issues/684)) ([af10a97](https://github.com/typescript-language-server/typescript-language-server/commit/af10a977f38626797dbadca935c71f92556fdb39))
* **deps:** update devdependency typescript to ^4.9.5 ([#677](https://github.com/typescript-language-server/typescript-language-server/issues/677)) ([916c326](https://github.com/typescript-language-server/typescript-language-server/commit/916c326d576b9f13a05563495dffa27b4d02ee6e))
* line offset off by one when at the last line ([#683](https://github.com/typescript-language-server/typescript-language-server/issues/683)) ([0db9a5f](https://github.com/typescript-language-server/typescript-language-server/commit/0db9a5faa4bc03560506ffd030e795a35e45e3f8))
## [3.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.3...v3.1.0) (2023-01-30)
### Features
* send `$/typescriptVersion` notification with TypeScript version ([#674](https://github.com/typescript-language-server/typescript-language-server/issues/674)) ([b081112](https://github.com/typescript-language-server/typescript-language-server/commit/b081112f12a35fa70aae3a134191dea025de64da))
* support for canceling LSP requests ([#672](https://github.com/typescript-language-server/typescript-language-server/issues/672)) ([1daf209](https://github.com/typescript-language-server/typescript-language-server/commit/1daf209121fc20bbc0a64ec0491cd40582cb9a4b))
## [3.0.3](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.2...v3.0.3) (2023-01-23)
### Bug Fixes
* restore tsserver version logging on initialization ([#669](https://github.com/typescript-language-server/typescript-language-server/issues/669)) ([232219c](https://github.com/typescript-language-server/typescript-language-server/commit/232219cd0fe138558ed98e22aa7314e0941e4f10))
## [3.0.2](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.1...v3.0.2) (2023-01-14)
### Bug Fixes
* remove hard dependency on typescript ([#661](https://github.com/typescript-language-server/typescript-language-server/issues/661)) ([9a2e2c8](https://github.com/typescript-language-server/typescript-language-server/commit/9a2e2c83d4992cd90cebc706618a9af604fcf1a9))
### Refactors
* bundle with rollup and switch to jest for testing ([#663](https://github.com/typescript-language-server/typescript-language-server/issues/663)) ([2c9eb63](https://github.com/typescript-language-server/typescript-language-server/commit/2c9eb632659a3bb9995095576afe88e84833bbdd))
## [3.0.1](https://github.com/typescript-language-server/typescript-language-server/compare/v3.0.0...v3.0.1) (2022-12-30)
### Bug Fixes
* cancel pending geterr request before triggering new ([#651](https://github.com/typescript-language-server/typescript-language-server/issues/651)) ([95b92e5](https://github.com/typescript-language-server/typescript-language-server/commit/95b92e5d15f47eea77e08765a1e378dbcd90d1f0))
## [3.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.3.0...v3.0.0) (2022-12-29)
### ⚠ BREAKING CHANGES
* Remove experimental and legacy implementations of inlay hints and call hierarchy. Use to the official `textDocument/inlayHint` and `textDocument/prepareCallHierarchy` implementations instead.
### Features
* drop experimental `textDocument/calls`, `typescript/inlayHints` ([#647](https://github.com/typescript-language-server/typescript-language-server/issues/647)) ([b15f8a7](https://github.com/typescript-language-server/typescript-language-server/commit/b15f8a7cca8470b0ef9e9878e94fba95e278d372))
* implement support for spec version of Call Hierarchy ([#649](https://github.com/typescript-language-server/typescript-language-server/issues/649)) ([3ce0e17](https://github.com/typescript-language-server/typescript-language-server/commit/3ce0e17e72f32913739c9d67d3dfb6092f09a2aa))
## [2.3.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.2.0...v2.3.0) (2022-12-27)
### Features
* implement `textDocument/selectionRange` request ([#642](https://github.com/typescript-language-server/typescript-language-server/issues/642)) ([a5598c6](https://github.com/typescript-language-server/typescript-language-server/commit/a5598c68aac961cbd6294133a9235e4db5b95929))
### Bug Fixes
* **completions:** don't insert call snippet if already a call ([#646](https://github.com/typescript-language-server/typescript-language-server/issues/646)) ([5d34de5](https://github.com/typescript-language-server/typescript-language-server/commit/5d34de5fd38ce5a9dcafc4a385ccb39b0a89f2b0))
## [2.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.1.0...v2.2.0) (2022-12-09)
### Features
* communicate with tsserver &gt;=4.9.0 using IPC ([#630](https://github.com/typescript-language-server/typescript-language-server/issues/630)) ([06abfde](https://github.com/typescript-language-server/typescript-language-server/commit/06abfdeb133127f4567efb77a2bf725549e9d957))
* support `textDocument/prepareRename` request ([#628](https://github.com/typescript-language-server/typescript-language-server/issues/628)) ([9c66794](https://github.com/typescript-language-server/typescript-language-server/commit/9c6679438d6190b72a15f32c0eb83cacd7780213))
* update typescript to 4.9.3 ([#629](https://github.com/typescript-language-server/typescript-language-server/issues/629)) ([0005648](https://github.com/typescript-language-server/typescript-language-server/commit/00056483da3f1089a3a426f08bc66651178c3665))
### Bug Fixes
* **deps:** update devdependency typescript to ^4.9.4 ([#637](https://github.com/typescript-language-server/typescript-language-server/issues/637)) ([d2b18b6](https://github.com/typescript-language-server/typescript-language-server/commit/d2b18b6d318c4b441e42f4f977ba6bd4eca36d58))
* surface stderr output from the tsserver process ([#624](https://github.com/typescript-language-server/typescript-language-server/issues/624)) ([adf2689](https://github.com/typescript-language-server/typescript-language-server/commit/adf268927a2f4b5e689572be9bedc349573aadd5))
## [2.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v2.0.1...v2.1.0) (2022-10-17)
### Features
* add `_typescript.configurePlugin` workspace command ([#607](https://github.com/typescript-language-server/typescript-language-server/issues/607)) ([59a5217](https://github.com/typescript-language-server/typescript-language-server/commit/59a52174148f3dc95fa2969971a1f95c6e432812))
* add `tsserver.logVerbosity` and `tsserver.path` to `initializationOptions` ([#611](https://github.com/typescript-language-server/typescript-language-server/issues/611)) ([a03eab5](https://github.com/typescript-language-server/typescript-language-server/commit/a03eab5f1442ad68745d6bec464191a66ab85fc7))
* add support for `[@link](https://github.com/link)` references in JSDoc ([#612](https://github.com/typescript-language-server/typescript-language-server/issues/612)) ([3722b51](https://github.com/typescript-language-server/typescript-language-server/commit/3722b51c0ad8e758c4e42f622bbe25ae981071e1))
* add workspace implicit project defaults configuration ([#605](https://github.com/typescript-language-server/typescript-language-server/issues/605)) ([c6b3947](https://github.com/typescript-language-server/typescript-language-server/commit/c6b39473ed5343f99434506ee034fd0d45a5364d))
### Bug Fixes
* loading progress sometimes getting stuck ([#603](https://github.com/typescript-language-server/typescript-language-server/issues/603)) ([8cf4381](https://github.com/typescript-language-server/typescript-language-server/commit/8cf43810e0ff7a32d3499afc6da2344939b2d6de))
* respect user-provided tsserver.js path from `--tsserver-path` ([#610](https://github.com/typescript-language-server/typescript-language-server/issues/610)) ([417339f](https://github.com/typescript-language-server/typescript-language-server/commit/417339fa66bc1910c80888c3f909e3d059da8ee5))
## [2.0.1](https://github.com/typescript-language-server/typescript-language-server/compare/v2.0.0...v2.0.1) (2022-10-07)
### Bug Fixes
* disable IPC communication until TypeScript bug is fixed ([#600](https://github.com/typescript-language-server/typescript-language-server/issues/600)) ([a6153a6](https://github.com/typescript-language-server/typescript-language-server/commit/a6153a66e88bed52704761f92dd4168605ef9a45))
## [2.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.2.0...v2.0.0) (2022-09-28)
### ⚠ BREAKING CHANGES
* Replace the CLI argument `--tsserver-log-file` with `tsserver.logDirectory` option provided through `initializationOptions` of the `initialize` request.
### Features
* add `tsserver.logDirectory` to `initializationOptions` ([#588](https://github.com/typescript-language-server/typescript-language-server/issues/588)) ([114d430](https://github.com/typescript-language-server/typescript-language-server/commit/114d4309cb1450585f991604118d3eff3690237c))
* add `tsserver.trace` init option for tracing tsserver ([#586](https://github.com/typescript-language-server/typescript-language-server/issues/586)) ([e3e8930](https://github.com/typescript-language-server/typescript-language-server/commit/e3e893094e501e3d6a72148e05f11286d688d2bd))
### Bug Fixes
* **completions:** don't create snippet kind without `completeFunctionCalls` ([#595](https://github.com/typescript-language-server/typescript-language-server/issues/595)) ([7f69c27](https://github.com/typescript-language-server/typescript-language-server/commit/7f69c27eb8cce71d3db006623757a74f93d76dd3))
* **completions:** remove filterText override for bracket accessor ([#593](https://github.com/typescript-language-server/typescript-language-server/issues/593)) ([1ed4e2e](https://github.com/typescript-language-server/typescript-language-server/commit/1ed4e2eccf0b52e10204b5c2617d4944ae513afd))
* wrong import completion when insert/replace supported ([#592](https://github.com/typescript-language-server/typescript-language-server/issues/592)) ([4fe902a](https://github.com/typescript-language-server/typescript-language-server/commit/4fe902a9e28ec4c3ccc14a9e75488efeb8079544))
## [1.2.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.2...v1.2.0) (2022-09-12)
### Features
* Add insert replace support for completions ([#583](https://github.com/typescript-language-server/typescript-language-server/issues/583)) ([fdf9d11](https://github.com/typescript-language-server/typescript-language-server/commit/fdf9d11200c49a160ed3c3bd523e4792bc98e99d))
* add support for new features from TypeScript 4.8 ([#576](https://github.com/typescript-language-server/typescript-language-server/issues/576)) ([7e88db3](https://github.com/typescript-language-server/typescript-language-server/commit/7e88db301a56d6d2dcd0fc1872d6baa386210497))
* include "triggerReason" and "kind" in code action requests ([#579](https://github.com/typescript-language-server/typescript-language-server/issues/579)) ([f872078](https://github.com/typescript-language-server/typescript-language-server/commit/f872078fa3b40d8b9b90f737fec7a4c808f1ccc7))
* support communicating with tsserver using IPC ([#585](https://github.com/typescript-language-server/typescript-language-server/issues/585)) ([8725b9b](https://github.com/typescript-language-server/typescript-language-server/commit/8725b9bee4432b7520ebd9adc67f4c65303b2c8c))
* support for codeAction disabledSupport client capability ([#578](https://github.com/typescript-language-server/typescript-language-server/issues/578)) ([f93b849](https://github.com/typescript-language-server/typescript-language-server/commit/f93b8493eeafda32c865c93e99025c8ca11c3226))
### Bug Fixes
* only use optionalReplacementSpan if client supports InsertReplace ([#584](https://github.com/typescript-language-server/typescript-language-server/issues/584)) ([899ba6b](https://github.com/typescript-language-server/typescript-language-server/commit/899ba6b5c5f13faac8eec6478ced4d9f8d90836d))
## [1.1.2](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.1...v1.1.2) (2022-08-25)
### Bug Fixes
* definition request crashing on getting span ([#574](https://github.com/typescript-language-server/typescript-language-server/issues/574)) ([4e1c82b](https://github.com/typescript-language-server/typescript-language-server/commit/4e1c82b82878316a12ff6b524d7dd5ab54b86acd))
## [1.1.1](https://github.com/typescript-language-server/typescript-language-server/compare/v1.1.0...v1.1.1) (2022-08-22)
### Bug Fixes
* move deepmerge to dependencies ([06109d4](https://github.com/typescript-language-server/typescript-language-server/commit/06109d4646d94bdf1bbeb2768e18f1323ae1b630))
## [1.1.0](https://github.com/typescript-language-server/typescript-language-server/compare/v1.0.0...v1.1.0) (2022-08-21)
### Features
* add "Go To Source Definition" command ([#560](https://github.com/typescript-language-server/typescript-language-server/issues/560)) ([9bcdaf2](https://github.com/typescript-language-server/typescript-language-server/commit/9bcdaf2b0b09da9aa4d7e6ed79bdcd742b3cfc17))
* support `textDocument/inlayHint` request from 3.17.0 spec ([#566](https://github.com/typescript-language-server/typescript-language-server/issues/566)) ([9a2fd4e](https://github.com/typescript-language-server/typescript-language-server/commit/9a2fd4e34b6c50c57b974f617018dcefdb469788))
* support LocationLink[] for textDocument/definition response ([#563](https://github.com/typescript-language-server/typescript-language-server/issues/563)) ([196f328](https://github.com/typescript-language-server/typescript-language-server/commit/196f328cd9fd7a06998151d59bed0b945cc68b40))
### Bug Fixes
* don't trigger error on empty Source Definition response ([#568](https://github.com/typescript-language-server/typescript-language-server/issues/568)) ([146a6ba](https://github.com/typescript-language-server/typescript-language-server/commit/146a6ba97f0792701ff8afcc431d3a1dfdb978a6))
* make wording in the typescript lookup error more generic ([585a05e](https://github.com/typescript-language-server/typescript-language-server/commit/585a05e43a0b530f10e488aed634fac0436109ae)), closes [#554](https://github.com/typescript-language-server/typescript-language-server/issues/554)
* snippet completions returned to clients that don't support them ([#556](https://github.com/typescript-language-server/typescript-language-server/issues/556)) ([050d335](https://github.com/typescript-language-server/typescript-language-server/commit/050d3350e16fe78b7c60d7443ed3ad6d2cc4730d))
* update signature help feature to v3.15.0 LSP spec ([#555](https://github.com/typescript-language-server/typescript-language-server/issues/555)) ([da074a6](https://github.com/typescript-language-server/typescript-language-server/commit/da074a618ca6c29819834a0344682094d6ff08f6))
## [1.0.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.2...v1.0.0) (2022-08-06)
### ⚠ BREAKING CHANGES
* Ship as an ES module. Might be breaking for programmatic users of this server. Read more about consuming ES module packages at gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
* **deps:** LSP libraries updated to match the 3.17 version of the LSP spec. Requires minimum Node 14.
### Features
* add support for CompletionItem.labelDetails ([#534](https://github.com/typescript-language-server/typescript-language-server/issues/534)) ([3c140d9](https://github.com/typescript-language-server/typescript-language-server/commit/3c140d958507300d7d186adb84f5b0baa549edb2))
### Bug Fixes
* declare quickfix/refactor CodeAction capabilities ([#553](https://github.com/typescript-language-server/typescript-language-server/issues/553)) ([e76fc64](https://github.com/typescript-language-server/typescript-language-server/commit/e76fc6493295649d6ada83c8a5f6d88abe2a6167))
* handle shutdown lifecycle properly ([#536](https://github.com/typescript-language-server/typescript-language-server/issues/536)) ([ac8536b](https://github.com/typescript-language-server/typescript-language-server/commit/ac8536bf8eb805bfc28e484a8f4827b5375d6824))
### Miscellaneous Chores
* **deps:** update LSP libraries to match 3.17 spec ([#532](https://github.com/typescript-language-server/typescript-language-server/issues/532)) ([bdbdd83](https://github.com/typescript-language-server/typescript-language-server/commit/bdbdd8379815583aa28d2a770034253050ba24de))
### Code Refactoring
* ship as an ES module ([#547](https://github.com/typescript-language-server/typescript-language-server/issues/547)) ([0dfd411](https://github.com/typescript-language-server/typescript-language-server/commit/0dfd41125c04868b547a3893334bb0bb822e0517))
## [0.11.2](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.1...v0.11.2) (2022-06-24)
### Bug Fixes
* apply refactoring returns -1 positions in ranges ([#502](https://github.com/typescript-language-server/typescript-language-server/issues/502)) ([5f52db0](https://github.com/typescript-language-server/typescript-language-server/commit/5f52db0383d6c326cd321c13fc969ab9d3958011))
## [0.11.1](https://github.com/typescript-language-server/typescript-language-server/compare/v0.11.0...v0.11.1) (2022-06-13)
### Bug Fixes
* completion for strings with trigger character ([#492](https://github.com/typescript-language-server/typescript-language-server/issues/492)) ([76bf9a4](https://github.com/typescript-language-server/typescript-language-server/commit/76bf9a4817ffa1e340422cfd5177dbcb96528ddb))
## [0.11.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.10.1...v0.11.0) (2022-06-06)
### Features
* add support for rename prefixText and suffixText on rename ([#478](https://github.com/typescript-language-server/typescript-language-server/issues/478)) ([b3c8535](https://github.com/typescript-language-server/typescript-language-server/commit/b3c85354c71dc36e1d4775bf61d7064a6b85e958))
### [0.10.1](https://github.com/typescript-language-server/typescript-language-server/compare/v0.10.0...v0.10.1) (2022-05-18)
### Bug Fixes
* pin old version of LSP libraries for node <14 compatibility ([#467](https://github.com/typescript-language-server/typescript-language-server/issues/467)) ([55600e1](https://github.com/typescript-language-server/typescript-language-server/commit/55600e12635c01d5a531b776b33d10f9e622a7a6))
## [0.10.0](https://github.com/typescript-language-server/typescript-language-server/compare/v0.9.7...v0.10.0) (2022-05-11)
### Features
* add support for locale option ([#461](https://github.com/typescript-language-server/typescript-language-server/issues/461)) ([be6a95d](https://github.com/typescript-language-server/typescript-language-server/commit/be6a95ddf6abf8cb68689a6995e3e55858eacb23))
### [0.9.7](https://github.com/typescript-language-server/typescript-language-server/compare/v0.9.6...v0.9.7) (2022-02-27)
### Bug Fixes
* add more logging for resolving user-specified tsserver ([#412](https://github.com/typescript-language-server/typescript-language-server/issues/412)) ([7139a32](https://github.com/typescript-language-server/typescript-language-server/commit/7139a32da05b6e3dfcd3252bde934dc499412d3d))
* help users resolve no valid tsserver version error ([#337](https://github.com/typescript-language-server/typescript-language-server/issues/337)) ([d835543](https://github.com/typescript-language-server/typescript-language-server/commit/d835543e455a51ec159457a1479a550712574099))
## [0.9.6] - 2022-02-02
- **fix**: don't transform zipfile URIs from Vim (#386)
## [0.9.5] - 2022-01-27
- **fix**: don't transform Yarn zipfile URIs (#384)
## [0.9.4] - 2022-01-19
- **fix**: call configure before completion resolve (#377)
## [0.9.3] - 2022-01-16
- **fix**: wait for tsserver configuration requests to finish (#372)
## [0.9.2] - 2022-01-14
- **fix**: use correct name for the addMissingImports code action (#371)
## [0.9.1] - 2022-01-07
- **fix**: don't use the postinstall script
## [0.9.0] - 2022-01-07
- **feat**: implement additional code actions for handling auto-fixing (#318)
- **feat**: report progress when loading the project (#326)
- **feat**: add new preferences from typescript 4.5.3 (#304)
- **fix**: correct matching of "only" kinds provided by the client (#334)
- **fix**: pass format options for organizing import (#348)
- **fix**: use snippet type for jsx attribute completions (#362)
## [0.8.1] - 2021-11-25
- **fix**: lookup workspace typescript in dirs higher up the tree also (#314)
## [0.8.0] - 2021-11-21
- **feat**: implement semantic tokens support (#290)
- **feat**: add support for snippet completions for methods/functions (#303)
- **feat**: ability to ignore diagnostics by code (#272)
Adds new `diagnostics.ignoredCodes` workspace setting to ignore specific diagnostics.
- **feat**: add `npmLocation` option to specify NPM location (#293)
- **fix**: don't announce support for codeActionKinds (#289)
- **fix**: mark import completions as snippets (#291)
- **fix**: specify minimum node version to be v12 (#301)
- **fix**: ensure that the `tsserver` subprocess uses forked node instance (#292)
Potentially **BREAKING**. The lookup of `tsserver` was refactored to never use `spawn` logic but instead always `fork` the current node instance. See more info in the PR.
- **fix**: exit the server if tsserver process crashes (#305)
- **fix**: respect "includeDeclaration" for references request (#306)
## [0.7.1] - 2021-11-10
- fix: add missing `semver` dependency (#288)
## [0.7.0] - 2021-11-09
### Breaking
Changes to default options sent to tsserver could affect behavior (hopefully for the better). Read changes below for more details.
### Changes
- **feat**: include import specifier for import completions (#281)
For completions that import from another package, the completions will include a "detail" field with the name of the module.
Also aligned some other logic with the typescript language services used in VSCode:
* annotate the completions with the local name of the import when completing a path in import foo from '...'
* update completion "sortText" regardless if the completion "isRecommended"
- **feat**: allow skip destructive actions on running OrganizeImports (#228)
Add support for the new skipDestructiveCodeActions argument to TypeScript's organize imports feature - [1] to support [2].
Support is added in two places:
* Automatically inferring the proper value based on diagnostics for the file when returning code actions.
* Supporting sending it when manually executing the organize imports action.
Also added documentation to the readme about the supported commands that can be manually executed.
[1] https://github.com/microsoft/TypeScript/issues/43051
[2] https://github.com/apexskier/nova-typescript/issues/273
- **feat**: support running server on files without root workspace (#286)
The tsserver seems to be good at inferring the project configuration when opening single files without a workspace so don't crash on missing `rootPath`.
- **feat**: add `disableAutomaticTypingAcquisition` option to disable automatic type acquisition (#285)
- **feat**: update default tsserver options (#284)
Set the following additional options by default:
```
allowRenameOfImportPath: true,
displayPartsForJSDoc: true,
generateReturnInDocTemplate: true,
includeAutomaticOptionalChainCompletions: true,
includeCompletionsForImportStatements: true,
includeCompletionsWithSnippetText: true,
```
This aligns more with the default options of the typescript language services in VSCode.
- **feat**: announce support for "source.organizeImports.ts-ls" action (#283)
Announcing support for that code action allows editors that support
running code actions on save to automatically run the code action if
the user has configured the editor with settings like
```js
"codeActionsOnSave": {
"source.organizeImports": true,
// or
"source.organizeImports.ts-ls": true,
},
```
- **chore**: change default log level from "warn" to "info" (#287)
## [0.6.5] - 2021-11-03
- fix: normalize client and tsserver paths (#275)
This should ensure consistent behavior regradless of the platform. Previously some functionality could be malfunctioning on Windows depending on the LSP client used due to using non-normalized file paths.
- Handle the `APPLY_COMPLETION_CODE_ACTION` command internally (#270)
This means that the clients that have implemented a custom handling for the `_typescript.applyCompletionCodeAction` command can remove that code.
Without removing the custom handling everything should work as before but some edge cases might work better when custom handling is removed.
- fix: ignore empty code blocks in content returned from `textDocument/hover` (#276)
- fix: remove unsupported --node-ipc and --socket options (#278)
## [0.6.4] - 2021-10-12
- Fix broken logging (#267)
- Add support for `workspace/didChangeConfiguration` and setting formatting options per language (#268)
- Add option to set inlayHints preferences by language (#266)
## [0.6.3] - 2021-10-27
- Implement experimental inlay hints (#259) ([documentation](https://github.com/typescript-language-server/typescript-language-server#typescriptinlayhints-experimental-supported-from-typescript-v442))
- Send diagnostics even to clients that don't signal support (#261) (reverts #229)
## [0.6.2] - 2021-08-16
- Mark completion items as deprecated if JSDoc says so (#227)
- Add a `maxTsServerMemory` option (#252)
- (chore) Add Windows and Mac CI runner (#248)
## [0.6.1] - 2021-08-16
- Fix Windows path regression introduced in #220 (#249)
## [0.6.0] - 2021-08-12
- Refactor code actions to better support filtering against "only" (#170)
- Support Yarn PnP (#220)
- Update internal Typescript dependency from 3.9.0 to 4.3.4 (#226)
- Only publish diagnostics if client supports the capability (#229)
- Add support for "unnecessary" and "deprecated" diagnostic tags (#230)
- Upgrade vscode-languageserver (#231)
- Lookup tsserver using direct path rather than through .bin alias (#234)
- Don't pass deprecated options to Completion request
## [0.5.4] - 2021-07-01
- Remove hardcoded request timeouts
- Forward user preferences in `initializationOptions`
- Use `require.resolve` for module resolution (#195)
## [0.5.0] - 2021-01-16
- Fix empty documentHighlight results due to inconsistent path delimiters
- Update command line option `tssserver-log-verbosity` to support `off`
- Call compilerOptionsForInferredProjects during initialization (set good defaults when tsconfig.json missing)
- Remove warnings from LSP completion results
- Add support for formatting range (textDocument/rangeFormatting)
- Ensure TSP request cancellation cancels timeout handling
## [0.4.0] - 2019-08-28
- Upgraded to LSP 5.3.0 and Monaco 0.17.0. [#115](https://github.com/theia-ide/typescript-language-server/pull/115)
## [0.3.7] - 2018-11-18
- Let documentSymbol return the correct results when mergeable elements are used [#77](https://github.com/theia-ide/typescript-language-server/pull/77)
- Return correct ranges for hierarchical document symbol [#79](https://github.com/theia-ide/typescript-language-server/pull/79)
- Return null when resolving completion request at an invalid location [#81](https://github.com/theia-ide/typescript-language-server/pull/81)
- Initial call hierarchy support [#85](https://github.com/theia-ide/typescript-language-server/pull/85)
- Allowing starting tsserver as a module using cp.fork [#88](https://github.com/theia-ide/typescript-language-server/pull/88)
Thanks to [@AlexTugarev](https://github.com/AlexTugarev) and [@keyboardDrummer](https://github.com/keyboardDrummer)
## [0.3.6] - 2018-09-18
- Respect URIs received from clients [#75](https://github.com/theia-ide/typescript-language-server/pull/75)
## [0.3.5] - 2018-09-14
- Fixed publishing diagnostics for all opened documents [#71](https://github.com/theia-ide/typescript-language-server/pull/71) - thanks to [@keyboardDrummer](https://github.com/keyboardDrummer)
- Support global tsserver plugins [#73](https://github.com/theia-ide/typescript-language-server/pull/73)
- Configure a tsserver log file via `TSSERVER_LOG_FILE` env variable [#73](https://github.com/theia-ide/typescript-language-server/pull/73)
## [0.3.4] - 2018-09-12
- Restore containerName for non-hierarchical symbols [#69](https://github.com/theia-ide/typescript-language-server/pull/69)
## [0.3.3] - 2018-09-11
- Fix updating documents on `didChange` notification [#65](https://github.com/theia-ide/typescript-language-server/pull/65)
- Debounce triggering diagnostics if a client is spamming with edits [#65](https://github.com/theia-ide/typescript-language-server/pull/65)
## [0.3.2] - 2018-09-06
- Hierarchical document symbols support [#62](https://github.com/theia-ide/typescript-language-server/pull/62)
## [0.3.1] - 2018-09-04
- Allow a client to enable tsserver logging [#59](https://github.com/theia-ide/typescript-language-server/pull/59)
## [0.3.0] - 2018-08-23
- Setup the monorepo with yarn workspaces and ts project references [#48](https://github.com/theia-ide/typescript-language-server/pull/48)
- Added a Monaco based example [#48](https://github.com/theia-ide/typescript-language-server/pull/48)
- Aligned `completion/completionResolve` with VS Code behaviour [#50](https://github.com/theia-ide/typescript-language-server/pull/50)
- Interrupt diagnostics to improve response time for other requests, as completion and signature help [#51](https://github.com/theia-ide/typescript-language-server/pull/51)
- Applied refactorings support [#51](https://github.com/theia-ide/typescript-language-server/pull/51)
- Suggest diagnostics support [#51](https://github.com/theia-ide/typescript-language-server/pull/51)
- Diagnostics buffering [#51](https://github.com/theia-ide/typescript-language-server/pull/51)
- Tolerating non-file URIs [#51](https://github.com/theia-ide/typescript-language-server/pull/51)
- Organize imports support [#51](https://github.com/theia-ide/typescript-language-server/pull/51)
- Added `Apply Rename File` command [#56](https://github.com/theia-ide/typescript-language-server/pull/56)
[0.4.0]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.7...v0.4.0
[0.3.7]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.6...v0.3.7
[0.3.6]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.5...v0.3.6
[0.3.5]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.4...v0.3.5
[0.3.4]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/theia-ide/typescript-language-server/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/theia-ide/typescript-language-server/compare/961d937f3ee3ea6b68cb98a6c235c6beea5f2fa5...v0.3.1
[0.3.0]: https://github.com/theia-ide/typescript-language-server/compare/v0.2.0...961d937f3ee3ea6b68cb98a6c235c6beea5f2fa5

View File

@ -0,0 +1,240 @@
Parts of the code copied from the https://github.com/microsoft/vscode repository are licensed under the following license:
BEGIN LICENSE ----------------------------------------------------------------
MIT License
Copyright (c) 2015 - present Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
END LICESE -------------------------------------------------------------------
This applies to files that include the following license header:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
The rest of the code licensed under:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,576 @@
[![Build Status](https://travis-ci.org/theia-ide/typescript-language-server.svg?branch=master)](https://travis-ci.org/theia-ide/typescript-language-server)
[![Discord](https://img.shields.io/discord/873659987413573634)](https://discord.gg/AC7Vs6hwFa)
# TypeScript Language Server
[Language Server Protocol](https://github.com/Microsoft/language-server-protocol) implementation for TypeScript wrapping `tsserver`.
[![https://nodei.co/npm/typescript-language-server.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/typescript-language-server.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/typescript-language-server)
Based on concepts and ideas from https://github.com/prabirshrestha/typescript-language-server and originally maintained by [TypeFox](https://typefox.io)
Maintained by a [community of contributors](https://github.com/typescript-language-server/typescript-language-server/graphs/contributors) like you
<!-- MarkdownTOC -->
- [Installing](#installing)
- [Running the language server](#running-the-language-server)
- [CLI Options](#cli-options)
- [initializationOptions](#initializationoptions)
- [workspace/didChangeConfiguration](#workspacedidchangeconfiguration)
- [Code actions on save](#code-actions-on-save)
- [Workspace commands \(`workspace/executeCommand`\)](#workspace-commands-workspaceexecutecommand)
- [Go to Source Definition](#go-to-source-definition)
- [Apply Workspace Edits](#apply-workspace-edits)
- [Apply Code Action](#apply-code-action)
- [Apply Refactoring](#apply-refactoring)
- [Organize Imports](#organize-imports)
- [Rename File](#rename-file)
- [Configure plugin](#configure-plugin)
- [Inlay hints \(`textDocument/inlayHint`\)](#inlay-hints-textdocumentinlayhint)
- [TypeScript Version Notification](#typescript-version-notification)
- [Supported Protocol features](#supported-protocol-features)
- [Development](#development)
- [Build](#build)
- [Test](#test)
- [Watch](#watch)
- [Publishing](#publishing)
<!-- /MarkdownTOC -->
## Installing
```sh
npm install -g typescript-language-server typescript
```
## Running the language server
```
typescript-language-server --stdio
```
## CLI Options
```
Usage: typescript-language-server [options]
Options:
-V, --version output the version number
--stdio use stdio (required option)
--log-level <log-level> A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `3`.
--tsserver-log-verbosity <verbosity> [deprecated] Specify tsserver log verbosity (off, terse, normal, verbose). Defaults to `normal`. example: --tsserver-log-verbosity=verbose
--tsserver-path <path> [deprecated] Specify path to tsserver directory. example: --tsserver-path=/Users/me/typescript/lib/
-h, --help output usage information
```
> The `--tsserver-log-verbosity` and `--tsserver-path` options are deprecated and it is recommended to pass those through corresponding `tsserver.*` `initializationOptions` instead.
> Note: The path passed to `--tsserver-path` should be a path to the `[...]/typescript/lib/tssserver.js` file or to the `[...]/typescript/lib/` directory and not to the shell script `[...]/node_modules/.bin/tsserver`. Though for backward-compatibility reasons, the server will try to do the right thing even when passed a path to the shell script.
## initializationOptions
The language server accepts various settings through the `initializationOptions` object passed through the `initialize` request. Refer to your LSP client's documentation on how to set these. Here is the list of supported options:
| Setting | Type | Description |
|:------------------|:---------|:--------------------------------------------------------------------------------------|
| hostInfo | string | Information about the host, for example `"Emacs 24.4"` or `"Sublime Text v3075"`. **Default**: `undefined` |
| completionDisableFilterText | boolean | Don't set `filterText` property on completion items. **Default**: `false` |
| disableAutomaticTypingAcquisition | boolean | Disables tsserver from automatically fetching missing type definitions (`@types` packages) for external modules. |
| maxTsServerMemory | number | The maximum size of the V8's old memory section in megabytes (for example `4096` means 4GB). The default value is dynamically configured by Node so can differ per system. Increase for very big projects that exceed allowed memory usage. **Default**: `undefined` |
| npmLocation | string | Specifies the path to the NPM executable used for Automatic Type Acquisition. |
| locale | string | The locale to use to show error messages. |
| plugins | object[] | An array of `{ name: string, location: string }` objects for registering a Typescript plugins. **Default**: [] |
| preferences | object | Preferences passed to the Typescript (`tsserver`) process. See below for more |
| tsserver | object | Options related to the `tsserver` process. See below for more |
The `tsserver` setting specifies additional options related to the internal `tsserver` process, like tracing and logging.
```ts
interface TsserverOptions {
/**
* The path to the directory where the `tsserver` log files will be created.
* If not provided, the log files will be created within the workspace, inside the `.log` directory.
* If no workspace root is provided when initializating the server and no custom path is specified then
* the logs will not be created.
*
* @default undefined
*/
logDirectory?: string;
/**
* Verbosity of the information logged into the `tsserver` log files.
*
* Log levels from least to most amount of details: `'terse'`, `'normal'`, `'requestTime`', `'verbose'`.
* Enabling particular level also enables all lower levels.
*
* @default 'off'
*/
logVerbosity?: 'off' | 'terse' | 'normal' | 'requestTime' | 'verbose';
/**
* The path to the `tsserver.js` file or the typescript lib directory. For example: `/Users/me/typescript/lib/tsserver.js`.
*/
path?: string;
/**
* The verbosity of logging of the tsserver communication.
* Delivered through the LSP messages and not related to file logging.
*
* @default 'off'
*/
trace?: 'off' | 'messages' | 'verbose';
/**
* Whether a dedicated server is launched to more quickly handle syntax related operations, such as computing diagnostics or code folding.
*
* Allowed values:
* - auto: Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.
* - never: Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.
*
* @default 'auto'
*/
useSyntaxServer?: 'auto' | 'never';
}
```
The `preferences` object is an object specifying preferences for the internal `tsserver` process. Those options depend on the version of Typescript used but at the time of writing Typescript v4.4.3 contains these options:
```ts
interface UserPreferences {
/**
* Glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.
* Relative paths are resolved relative to the workspace root.
* @since 4.8.2
*/
autoImportFileExcludePatterns: [],
disableSuggestions: boolean;
quotePreference: "auto" | "double" | "single";
/**
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
* This affects lone identifier completions but not completions on the right hand side of `obj.`.
*/
includeCompletionsForModuleExports: boolean;
/**
* Enables auto-import-style completions on partially-typed import statements. E.g., allows
* `import write|` to be completed to `import { writeFile } from "fs"`.
*/
includeCompletionsForImportStatements: boolean;
/**
* Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
*/
includeCompletionsWithSnippetText: boolean;
/**
* If enabled, the completion list will include completions with invalid identifier names.
* For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
*/
includeCompletionsWithInsertText: boolean;
/**
* Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
* member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
* values, with insertion text to replace preceding `.` tokens with `?.`.
*/
includeAutomaticOptionalChainCompletions: boolean;
/**
* If enabled, completions for class members (e.g. methods and properties) will include
* a whole declaration for the member.
* E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
* `class A { foo }`.
* @since 4.5.2
* @default true
*/
includeCompletionsWithClassMemberSnippets: boolean;
/**
* If enabled, object literal methods will have a method declaration completion entry in addition
* to the regular completion entry containing just the method name.
* E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
* in addition to `const objectLiteral: T = { foo }`.
* @since 4.7.2
* @default true
*/
includeCompletionsWithObjectLiteralMethodSnippets: boolean;
/**
* Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
* If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
* Only supported if the client supports `textDocument.completion.completionItem.labelDetailsSupport` capability
* and a compatible TypeScript version is used.
* @since 4.7.2
* @default true
*/
useLabelDetailsInCompletionEntries: boolean;
/**
* Allows import module names to be resolved in the initial completions request.
* @default false
*/
allowIncompleteCompletions: boolean;
importModuleSpecifierPreference: "shortest" | "project-relative" | "relative" | "non-relative";
/** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
importModuleSpecifierEnding: "auto" | "minimal" | "index" | "js";
allowTextChangesInNewFiles: boolean;
lazyConfiguredProjectsFromExternalProject: boolean;
providePrefixAndSuffixTextForRename: boolean;
provideRefactorNotApplicableReason: boolean;
allowRenameOfImportPath: boolean;
includePackageJsonAutoImports: "auto" | "on" | "off";
/**
* Preferred style for JSX attribute completions:
* - `"auto"` - Insert `={}` or `=\"\"` after attribute names based on the prop type.
* - `"braces"` - Insert `={}` after attribute names.
* - `"none"` - Only insert attribute names.
* @since 4.5.2
* @default 'auto'
*/
jsxAttributeCompletionStyle: "auto" | "braces" | "none";
displayPartsForJSDoc: boolean;
generateReturnInDocTemplate: boolean;
includeInlayParameterNameHints: "none" | "literals" | "all";
includeInlayParameterNameHintsWhenArgumentMatchesName: boolean;
includeInlayFunctionParameterTypeHints: boolean,
includeInlayVariableTypeHints: boolean;
/**
* When disabled then type hints on variables whose name is identical to the type name won't be shown. Requires using TypeScript 4.8+ in the workspace.
* @since 4.8.2
* @default false
*/
includeInlayVariableTypeHintsWhenTypeMatchesName: boolean;
includeInlayPropertyDeclarationTypeHints: boolean;
includeInlayFunctionLikeReturnTypeHints: boolean;
includeInlayEnumMemberValueHints: boolean;
}
```
From the `preferences` options listed above, this server explicilty sets the following options (all other options use their default values):
```js
{
allowIncompleteCompletions: true,
allowRenameOfImportPath: true,
allowTextChangesInNewFiles: true,
displayPartsForJSDoc: true,
generateReturnInDocTemplate: true,
includeAutomaticOptionalChainCompletions: true,
includeCompletionsForImportStatements: true,
includeCompletionsForModuleExports: true,
includeCompletionsWithClassMemberSnippets: true,
includeCompletionsWithObjectLiteralMethodSnippets: true,
includeCompletionsWithInsertText: true,
includeCompletionsWithSnippetText: true,
jsxAttributeCompletionStyle: "auto",
providePrefixAndSuffixTextForRename: true,
provideRefactorNotApplicableReason: true,
}
```
## workspace/didChangeConfiguration
Some of the preferences can be controlled through the `workspace/didChangeConfiguration` notification. Below is a list of supported options that can be passed. Note that the settings are specified separately for the typescript and javascript files so `[language]` can be either `javascript` or `typescript`.
```ts
// Formatting preferences
[language].format.baseIndentSize: number;
[language].format.convertTabsToSpaces: boolean;
[language].format.indentSize: number;
[language].format.indentStyle: 'None' | 'Block' | 'Smart';
[language].format.insertSpaceAfterCommaDelimiter: boolean;
[language].format.insertSpaceAfterConstructor: boolean;
[language].format.insertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
[language].format.insertSpaceAfterKeywordsInControlFlowStatements: boolean;
[language].format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: boolean;
[language].format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: boolean;
[language].format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: boolean;
[language].format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
[language].format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
[language].format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
[language].format.insertSpaceAfterSemicolonInForStatements: boolean;
[language].format.insertSpaceAfterTypeAssertion: boolean;
[language].format.insertSpaceBeforeAndAfterBinaryOperators: boolean;
[language].format.insertSpaceBeforeFunctionParenthesis: boolean;
[language].format.insertSpaceBeforeTypeAnnotation: boolean;
[language].format.newLineCharacter: string;
[language].format.placeOpenBraceOnNewLineForControlBlocks: boolean;
[language].format.placeOpenBraceOnNewLineForFunctions: boolean;
[language].format.semicolons: 'ignore' | 'insert' | 'remove';
[language].format.tabSize: number;
[language].format.trimTrailingWhitespace: boolean;
// Inlay Hints preferences
[language].inlayHints.includeInlayEnumMemberValueHints: boolean;
[language].inlayHints.includeInlayFunctionLikeReturnTypeHints: boolean;
[language].inlayHints.includeInlayFunctionParameterTypeHints: boolean;
[language].inlayHints.includeInlayParameterNameHints: 'none' | 'literals' | 'all';
[language].inlayHints.includeInlayParameterNameHintsWhenArgumentMatchesName: boolean;
[language].inlayHints.includeInlayPropertyDeclarationTypeHints: boolean;
[language].inlayHints.includeInlayVariableTypeHints: boolean;
[language].inlayHints.includeInlayVariableTypeHintsWhenTypeMatchesName: boolean;
/**
* Complete functions with their parameter signature.
*
* This functionality relies on LSP client resolving the completion using the `completionItem/resolve` call. If the
* client can't do that before inserting the completion then it's not safe to enable it as it will result in some
* completions having a snippet type without actually being snippets, which can then cause problems when inserting them.
*
* @default false
*/
completions.completeFunctionCalls: boolean;
// Diagnostics code to be omitted when reporting diagnostics.
// See https://github.com/microsoft/TypeScript/blob/master/src/compiler/diagnosticMessages.json for a full list of valid codes.
diagnostics.ignoredCodes: number[];
/**
* Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
*
* @default false
*/
implicitProjectConfiguration.checkJs: boolean;
/**
* Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
*
* @default false
*/
implicitProjectConfiguration.experimentalDecorators: boolean;
/**
* Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.
*
* @default 'ESNext'
*/
implicitProjectConfiguration.module: string;
/**
* Enable/disable [strict function types](https://www.typescriptlang.org/tsconfig#strictFunctionTypes) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
*
* @default true
*/
implicitProjectConfiguration.strictFunctionTypes: boolean;
/**
* Enable/disable [strict null checks](https://www.typescriptlang.org/tsconfig#strictNullChecks) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.
*
* @default true
*/
implicitProjectConfiguration.strictNullChecks: boolean;
/**
* Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.
*
* @default 'ES2020'
*/
implicitProjectConfiguration.target: string;
```
## Code actions on save
Server announces support for the following code action kinds:
- `source.fixAll.ts` - despite the name, fixes a couple of specific issues: unreachable code, await in non-async functions, incorrectly implemented interface
- `source.removeUnused.ts` - removes declared but unused variables
- `source.addMissingImports.ts` - adds imports for used but not imported symbols
- `source.removeUnusedImports.ts` - removes unused imports
- `source.sortImports.ts` - sorts imports
- `source.organizeImports.ts` - organizes and removes unused imports
This allows editors that support running code actions on save to automatically run fixes associated with those kinds.
Those code actions, if they apply in the current code, should also be presented in the list of "Source Actions" if the editor exposes those.
The user can enable it with a setting similar to (can vary per-editor):
```js
"codeActionsOnSave": {
"source.organizeImports.ts": true,
// or just
"source.organizeImports": true,
}
```
## Workspace commands (`workspace/executeCommand`)
See [LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand).
Most of the time, you'll execute commands with arguments retrieved from another request like `textDocument/codeAction`. There are some use cases for calling them manually.
`lsp` refers to the language server protocol types, `tsp` refers to the typescript server protocol types.
### Go to Source Definition
- Request:
```ts
{
command: `_typescript.goToSourceDefinition`
arguments: [
lsp.DocumentUri, // String URI of the document
lsp.Position, // Line and character position (zero-based)
]
}
```
- Response:
```ts
lsp.Location[] | null
```
(This command is supported from Typescript 4.7.)
### Apply Workspace Edits
- Request:
```ts
{
command: `_typescript.applyWorkspaceEdit`
arguments: [lsp.WorkspaceEdit]
}
```
- Response:
```ts
lsp.ApplyWorkspaceEditResult
```
### Apply Code Action
- Request:
```ts
{
command: `_typescript.applyCodeAction`
arguments: [
tsp.CodeAction, // TypeScript Code Action object
]
}
```
- Response:
```ts
void
```
### Apply Refactoring
- Request:
```ts
{
command: `_typescript.applyRefactoring`
arguments: [
tsp.GetEditsForRefactorRequestArgs,
]
}
```
- Response:
```ts
void
```
### Organize Imports
- Request:
```ts
{
command: `_typescript.organizeImports`
arguments: [
// The "skipDestructiveCodeActions" argument is supported from Typescript 4.4+
[string] | [string, { skipDestructiveCodeActions?: boolean }],
]
}
```
- Response:
```ts
void
```
### Rename File
- Request:
```ts
{
command: `_typescript.applyRenameFile`
arguments: [
{ sourceUri: string; targetUri: string; },
]
}
```
- Response:
```ts
void
```
### Configure plugin
- Request:
```ts
{
command: `_typescript.configurePlugin`
arguments: [pluginName: string, configuration: any]
}
```
- Response:
```ts
void
```
## Inlay hints (`textDocument/inlayHint`)
For the request to return any results, some or all of the following options need to be enabled through `preferences`:
```ts
export interface InlayHintsOptions extends UserPreferences {
includeInlayParameterNameHints: 'none' | 'literals' | 'all';
includeInlayParameterNameHintsWhenArgumentMatchesName: boolean;
includeInlayFunctionParameterTypeHints: boolean;
includeInlayVariableTypeHints: boolean;
includeInlayVariableTypeHintsWhenTypeMatchesName: boolean;
includeInlayPropertyDeclarationTypeHints: boolean;
includeInlayFunctionLikeReturnTypeHints: boolean;
includeInlayEnumMemberValueHints: boolean;
}
```
## TypeScript Version Notification
Right after initializing, the server sends a custom `$/typescriptVersion` notification that carries information about the version of TypeScript that is utilized by the server. The editor can then display that information in the UI.
The `$/typescriptVersion` notification params include two properties:
- `version` - a semantic version (for example `4.8.4`)
- `source` - a string specifying whether used TypeScript version comes from the local workspace (`workspace`), is explicitly specified through a `initializationOptions.tsserver.path` setting (`user-setting`) or was bundled with the server (`bundled`)
## Supported Protocol features
- [x] textDocument/codeAction
- [x] textDocument/completion (incl. `completion/resolve`)
- [x] textDocument/definition
- [x] textDocument/didChange (incremental)
- [x] textDocument/didClose
- [x] textDocument/didOpen
- [x] textDocument/didSave
- [x] textDocument/documentHighlight
- [x] textDocument/documentSymbol
- [x] textDocument/executeCommand
- [x] textDocument/formatting
- [x] textDocument/hover
- [x] textDocument/inlayHint (no support for `inlayHint/resolve` or `workspace/inlayHint/refresh`)
- [x] textDocument/prepareCallHierarchy
- [x] callHierarchy/incomingCalls
- [x] callHierarchy/outgoingCalls
- [x] textDocument/prepareRename
- [x] textDocument/rangeFormatting
- [x] textDocument/references
- [x] textDocument/rename
- [x] textDocument/selectionRange
- [x] textDocument/signatureHelp
- [x] workspace/symbol
- [x] workspace/didChangeConfiguration
- [x] workspace/executeCommand
## Development
### Build
```sh
yarn
```
### Test
- `yarn test` - run all tests
- `yarn test:watch` - run all tests and enable watch mode for developing
By default only console logs of level `warning` and higher are printed to the console. You can override the `CONSOLE_LOG_LEVEL` level in `package.json` to either `log`, `info`, `warning` or `error` to log other levels.
### Watch
```sh
yarn watch
```
### Publishing
New version of the package is published automatically on pushing new tag to the upstream repo.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,84 @@
{
"name": "typescript-language-server",
"version": "3.3.1",
"description": "Language Server Protocol (LSP) implementation for TypeScript using tsserver",
"author": "TypeFox and others",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/typescript-language-server/typescript-language-server.git"
},
"type": "module",
"engines": {
"node": ">=14.17"
},
"files": [
"lib"
],
"bin": {
"typescript-language-server": "./lib/cli.mjs"
},
"scripts": {
"clean": "rimraf lib *.tsbuildinfo",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules CONSOLE_LOG_LEVEL=warning jest",
"test:watch": "cross-env NODE_OPTIONS=--experimental-vm-modules CONSOLE_LOG_LEVEL=warning jest --watch",
"lint": "eslint --ext \".js,.ts\" src",
"fix": "eslint --ext \".js,.ts\" --fix src",
"build": "concurrently -n compile,lint -c blue,green \"yarn compile\" \"yarn lint\"",
"compile": "rimraf lib && rollup --config rollup.config.ts --configPlugin typescript",
"watch": "rimraf lib && rollup --config rollup.config.ts --configPlugin typescript --watch",
"postversion": "git push --follow-tags",
"prepare": "cd test-data/jsx && yarn"
},
"eslintIgnore": [
"!.eslintrc.cjs"
],
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn test && yarn build",
"post-merge": "yarn"
}
},
"devDependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.0.0",
"@types/deepmerge": "^2.2.0",
"@types/fs-extra": "^11.0.1",
"@types/jest": "^29.5.0",
"@types/node": "^16.18.21",
"@types/semver": "^7.3.13",
"@types/which": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"babel-jest": "^29.5.0",
"commander": "^10.0.0",
"concurrently": "^7.6.0",
"cross-env": "^7.0.3",
"deepmerge": "^4.3.1",
"eslint": "^8.36.0",
"eslint-plugin-jest": "^27.2.1",
"fs-extra": "^11.1.1",
"husky": "4.x",
"jest": "^29.5.0",
"p-debounce": "^4.0.0",
"pkg-up": "^4.0.0",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"semver": "^7.3.8",
"source-map-support": "^0.5.21",
"tempy": "^3.0.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"tslib": "^2.5.0",
"typescript": "^4.9.5",
"vscode-languageserver": "^8.1.0",
"vscode-languageserver-protocol": "^3.17.3",
"vscode-languageserver-textdocument": "1.0.8",
"vscode-uri": "^3.0.7",
"which": "^3.0.0"
}
}

View File

@ -3,8 +3,27 @@ local util = lsp.util
local lspcap = require('cmp_nvim_lsp')
.default_capabilities(vim.lsp.protocol.make_client_capabilities())
local lspatt = function(_, bufnr)
local lspatt = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- disabling semantic highlighting for omnisharp https://github.com/OmniSharp/omnisharp-roslyn/issues/2483
if client.name == "omnisharp" then
local tokenModifiers = client.server_capabilities.semanticTokensProvider.legend.tokenModifiers
for i, v in ipairs(tokenModifiers) do
local tmp = string.gsub(v, ' ', '_')
tokenModifiers[i] = string.gsub(tmp, '-_', '')
end
local tokenTypes = client.server_capabilities.semanticTokensProvider.legend.tokenTypes
for i, v in ipairs(tokenTypes) do
local tmp = string.gsub(v, ' ', '_')
tokenTypes[i] = string.gsub(tmp, '-_', '')
end
--client.server_capabilities.semanticTokensProvider = {
-- legend = {},
-- vim_lsp_semantic_tokens = {},
--}
end
end
-- color scheme setup
@ -63,7 +82,6 @@ lsp.openscad_ls.setup {
capabilities = lspcap,
on_attach = lspatt,
}
local pid = vim.fn.getpid()
lsp.omnisharp.setup {
capabilities = lspcap,
on_attach = lspatt,
@ -73,11 +91,12 @@ lsp.omnisharp.setup {
end
return util.root_pattern("*.sln")(file) or util.root_pattern("*.csproj")(file) or util.root_pattern("omnisharp.json")(file)
end,
cmd = { "/home/rudism/.local/share/omnisharp/OmniSharp" }, --"--languageserver" , "--hostPID", tostring(pid) },
cmd = { "/usr/bin/omnisharp" }, --"--languageserver" , "--hostPID", tostring(pid) },
}
lsp.tsserver.setup {
capabilities = lspcap,
on_attach = lspatt,
cmd = { "npx", "typescript-language-server", "--stdio" },
}
lsp.yamlls.setup {
capabilities = lspcap,

View File

@ -1,5 +0,0 @@
shadow = false;
fading = false;
inactive-opacity = 1.0;
frame-opacity = 1.0;
vsync = true;

View File

@ -1,17 +0,0 @@
shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
fading = true;
fade-in-step = 0.1;
fade-out-step = 0.1;
inactive-opacity = 1.0;
frame-opacity = 1.0;
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
dock = { shadow = false; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.9; }
dropdown_menu = { opacity = 0.9; }
};

View File

@ -1,170 +0,0 @@
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/01 - Flurries.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/02 - Frosty the Snowman.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/03 - Sleigh Ride.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/04 - God Rest Ye Merry Gentlemen.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/05 - Jingle Bells.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/06 - Oh Holy Night.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/07 - Rudolph the Red Nosed Reindeer.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/08 - Sleddin' Hill.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/09 - Little Drummer Boy.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/10 - Winter Wonderland.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/11 - O Come O Come Emmanuel.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/12 - Carol of the Bells.mp3
/<microSD0>/MUSIC/August Burns Red/August Burns Red Presents Sleddin' Hill, A Holiday Album (2012)/13 - We Wish You a Merry Christmas.mp3
/<microSD0>/MUSIC/Austrian Death Machine/A Very Brutal Christmas (2008)/01 - Jingle Bells.mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/01 Deck the Halls (Nos Galan).mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/02 Hanukkah.mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/03 O Christmas Tree (Oh Chanukuh).mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/04 Jingle Bells (One Horse Open Sleigh).mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/05 Joy to the World.mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/06 Greensleeves (What Child Is This).mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/07 God Rest Ye Merry Gentlemen.mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/08 Ave Maria (Well-Tempered Clavier).mp3
/<microSD0>/MUSIC/ComputeHer & 8 Bit Weapon/It's a Chiptune Holiday! (2009)/Folder.gif
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/01 Get Into the Spirit.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/02 We Three Kings.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/03 Oh Come, O Come, Emanuel.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/04 Winter Song.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/06 Christmas for Everyone.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/07 I Don't Care.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/08 Light of the World.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/09 Oh Holy Night.mp3
/<microSD0>/MUSIC/Halford/Halford III- Winter Songs (2009)/10 Come All Ye Faithful.mp3
/<microSD0>/MUSIC/J.J. Hrubovcak/Death Metal Christmas (2013)/01 - Unrest for Melancholy Men (God Rest Ye Merry Gentlemen).mp3
/<microSD0>/MUSIC/J.J. Hrubovcak/Death Metal Christmas (2013)/02 - Earthen Kings (We Three Kings).mp3
/<microSD0>/MUSIC/J.J. Hrubovcak/Death Metal Christmas (2013)/03 - Nutcracker Dance of the Sugar Plum Fairy.mp3
/<microSD0>/MUSIC/J.J. Hrubovcak/Death Metal Christmas (2013)/04 - Greensleeves.mp3
/<microSD0>/MUSIC/J.J. Hrubovcak/Death Metal Christmas (2013)/05 - O Come, O Come, Azrael (O Come, O Come, Emmanuel).mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/01 - Little Drummer Boy.mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/02 - Deck the Joy (To the Halls).mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/03 - O Come Emannuel.mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/04 - Rudolph vs. Frosty.mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/05 - Angels From the Realms of Glory.mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/06 - All I Want For Christmas.mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/07 - Christmas Medley (Remix).mp3
/<microSD0>/MUSIC/Theocracy/Club of Souls - Christmas Music (2012)/08 - Wynter Fever.mp3
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/01 - An Angel Came Down.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/02 - O Come All Ye FaithfulO Holy Night (Instrumental).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/03 - A Star to Follow.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/04 - First Snow (Instrumental).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/05 - The Silent Nutcracker (Instrumental).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/06 - A Mad Russian's Christmas (Instrumental).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/07 - The Prince of Peace.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/08 - Christmas EveSarajevo 1224 (Instrumental).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/09 - Good King Joy.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/10 - Ornament.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/11 - The First Noel (Instrumental).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/12 - Old City Bar.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/13 - Promises to Keep.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/14 - This Christmas Day.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/15 - An Angel Returned.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/16 - O Holy Night.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/Christmas Eve and Other Stories (1996)/17 - God Rest Ye Merry Gentlemen.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/01 - The Ghosts of Christmas Eve.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/02 - Boughs of Holly.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/03 - The World that She Sees.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/04 - The World that He Sees.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/05 - Midnight Christmas Eve.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/06 - The March of the Kings Hark the Herald Angel.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/07 - The Three Kings and I (What Really Happened).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/08 - Christmas Canon.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/09 - Joy Angels We Have Heard On High.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/10 - Find Our Way Home.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/11 - Appalachian Snowfall.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/12 - The Music Box.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/13 - The Snow Came Down.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/14 - Christmas in the Air.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/15 - Dream Child (A Christmas Dream).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/16 - An Angel's Share.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Christmas Attic (1998)/17 - Music Box Blues.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/01 - Faith Noel.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/02 - The Lost Christmas Eve.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/03 - Christmas Dreams.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/04 - Wizards in Winter.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/05 - Remember.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/06 - Anno Domine.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/07 - Christmas Concerto.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/08 - Queen of the Winter Night.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/09 - Christmas Nights in Blue.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/10 - Christmas Jazz.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/11 - Christmas Jam.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/12 - Siberian Sleigh Ride.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/13 - What is Christmas.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/14 - For the Sake of Our Brother.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/15 - The Wisdom of Snow.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/16 - Wish Liszt (Toy Shop Madness).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/17 - Back to a Reason (Part II).ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/18 - Christmas Bells, Carousels & Time.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/19 - What Child is This.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/20 - O' Come All Ye Faithful.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/21 - Christmas Canon Rock.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/22 - Different Wings.ogg
/<microSD0>/MUSIC/Trans-Siberian Orchestra/The Lost Christmas Eve (2004)/23 - Midnight Clear.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/01 - Have Yourself a Merry Little Christmas.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/02 - O Come All Ye Faithful.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/03 - White Christmas.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/04 - I'll Be Home for Christmas.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/05 - Silver Bells.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/06 - I Saw Mommy Kissing Santa Claus.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/07 - Let It Snow.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/08 - Deck the Halls.ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/09 - The Christmas Song (Chestnuts Roasting on an Open Fire).ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/10 - Heavy Metal Christmas (The Twelve Days of Christmas).ogg
/<microSD0>/MUSIC/Twisted Sister/A Twisted Christmas (2006)/11 - Twisted Christmas Cheer.ogg
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/01 - Angels We have Heard on High.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/02 - God Rest Ye Merry Gentlemen.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/03 - Mary did You Know.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/04 - Coventry Carol.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/05 - Let All Mortal Flesh Keep Silence.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/06 - The Little Drummer Boy.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/07 - O Come All Ye Faithful.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/08 - Child Messiah.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/09 - O Holy Night.mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/10 - God Rest Ye Merry Gentlemen (Take 2).mp3
/<microSD0>/MUSIC/Various Artists/A Brutal Christmas The Season in Chaos (2002)/11 - Joy to the World.mp3
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-01 Christmas Time's A Comin'.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-02 What Child Is This.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-03 Beautiful Star Of Bethlehem.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-04 Santa Claus Is Comin' To Town.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-05 Mary, Did You Know.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-06 Joy To The World.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-07 Deck The Halls.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-08 Please Come Home For Christmas.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-09 God Rest Ye Merry Gentlemen.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-10 Tennessee Christmas.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-11 It Came Upon A Midnight Clear.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-12 I'll Be Home For Christmas.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-13 O Christmas Candle.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/1-14 Carol Of The Bells.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-01 Rudolph The Red-Nosed Reindeer.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-02 One Bright Star.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-03 Winter Wonderland.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-04 Silent Night.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-05 The Christmas Song.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-06 I Heard The Bells On Christmas Day.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-07 Jingle Bells.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-08 O Christmas Tree.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-09 Merry Christmas Ho, Ho, Ho.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-10 Away In A Manger.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-11 Christmas Is Near You.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-12 Silver Bells.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-13 Christmas in Dixie.ogg
/<microSD0>/MUSIC/Various Artists/Christmas Grass (2013)/2-14 We Wish You A Merry Christmas Afternoon.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-01 - We Wish You a Merry Xmas.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-02 - Run Rudolph Run.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-03 - Santa Claws Is Coming To Town.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-04 - God Rest Ye Merry Gentlemen.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-05 - Silver Bells.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-06 - Little Drummer Boy.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-07 - Santa Claus is Back in Town.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-08 - Silent Night.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-09 - Deck the Halls.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-10 - Grandma got Ran Over by a Reindeer.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-11 - Rockin' Around the Xmas Tree.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/01-12 - Happy Xmas (War is Over).ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/02-01 - O' Christmas Tree.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/02-02 - Auld Lang Syne.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/02-03 - Frosty the Snowman.ogg
/<microSD0>/MUSIC/Various Artists/We Wish You a Metal Xmas and a Headbanging New Year (2008)/02-04 - Rudolph the Red Nosed Reindeer.ogg
/<microSD0>/MUSIC/_Singles (Christmas)/Kamelot - We Three Kings.mp3
/<microSD0>/MUSIC/_Singles (Christmas)/King Diamond - No Presents For Christmas.mp3

View File

@ -1,3 +0,0 @@
Shortcuts and custom database navigation definitions that I use on my Rockbox devices. They just go into the root of the `.rockbox` directory.
Playlists go to the root of the SD card and are pathed for the FiiO M3K (but could be converted to other base paths easily enough).

View File

@ -1,14 +0,0 @@
[shortcut]
name: Sleep Timer 60
type: time
data: sleep 60
[shortcut]
name: Sleep Timer 30
type: time
data: sleep 30
[shortcut]
name: Stop Sleep Timer
type: time
data: sleep 0

View File

@ -1,5 +0,0 @@
#! rockbox/tagbrowser/2.0
%menu_start "custom" "Custom Browsers"
"Genre Artists" -> genre -> albumartist -> album -> title = "fmt_title"
"Genre Albums" -> genre -> album -> title = "fmt_title"

View File

@ -1,17 +0,0 @@
configuration{
modi: "run,drun,window";
icon-theme: "Oranchelo";
show-icons: true;
terminal: "st";
drun-display-format: "{icon} {name}";
location: 0;
disable-history: false;
hide-scrollbar: true;
display-drun: "  Apps ";
display-run: "  Run ";
display-window: " 﩯 Window";
display-Network: " 󰤨 Network";
sidebar-mode: true;
}
@theme "catppuccin-mocha"

View File

@ -1,104 +0,0 @@
* {
bg-col: #1e1e2e;
bg-col-light: #1e1e2e;
border-col: #1e1e2e;
selected-col: #1e1e2e;
blue: #89b4fa;
fg-col: #cdd6f4;
fg-col2: #f38ba8;
grey: #6c7086;
width: 600;
font: "monospace 14";
}
element-text, element-icon , mode-switcher {
background-color: inherit;
text-color: inherit;
}
window {
height: 360px;
border: 3px;
border-color: @border-col;
background-color: @bg-col;
}
mainbox {
background-color: @bg-col;
}
inputbar {
children: [prompt,entry];
background-color: @bg-col;
border-radius: 5px;
padding: 2px;
}
prompt {
background-color: @blue;
padding: 6px;
text-color: @bg-col;
border-radius: 3px;
margin: 20px 0px 0px 20px;
}
textbox {
padding: 20px 20px 0 20px;
text-color: @fg-col;
background-color: @bg-col;
}
textbox-prompt-colon {
expand: false;
str: ":";
}
entry {
padding: 6px;
margin: 20px 0px 0px 10px;
text-color: @fg-col;
background-color: @bg-col;
}
listview {
border: 0px 0px 0px;
padding: 6px 0px 0px;
margin: 10px 0px 0px 20px;
columns: 1;
lines: 5;
background-color: @bg-col;
}
element {
padding: 5px;
background-color: @bg-col;
text-color: @fg-col ;
}
element-icon {
size: 25px;
}
element selected {
background-color: @selected-col ;
text-color: @fg-col2 ;
}
mode-switcher {
spacing: 0;
}
button {
padding: 10px;
background-color: @bg-col-light;
text-color: @grey;
vertical-align: 0.5;
horizontal-align: 0.5;
}
button selected {
background-color: @bg-col;
text-color: @blue;
}

View File

@ -1,5 +0,0 @@
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# source shared config
for shared in ~/skynet/shell/bashrc.d/*.sh; do
source "$shared"
done

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
set -o vi
shopt -s histappend
shopt -s cmdhist
HISTSIZE=1000000
HISTFILESIZE=1000000
HISTCONTROL=ignoreboth
HISTIGNORE='ls:history'
HISTTIMEFORMAT='%F %T '
eval "$(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/.local/lib"
PATH="$HOME/.local/bin:$PATH:$HOME/skynet/bin:$HOME/node/node_modules/.bin:$HOME/go/bin:$HOME/.dotnet:$HOME/.dotnet/tools:$HOME/.cargo/bin:$HOME/.luarocks/bin"
TERM_ITALICS=true
EDITOR=vim
PAGER=bat
MANPAGER=batman
DOTNET_ROOT=~/.dotnet
ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
GPG_TTY=$(tty)
export TERM_ITALICS LD_LIBRARY_PATH PATH EDITOR PAGER MANPAGER DOTNET_ROOT ANDROID_EMULATOR_USE_SYSTEM_LIBS GPG_TTY
alias ls='exa --icons'
alias cat='bat'
alias cd..='cd ..'
alias j='goto'
alias jqize="jq -R -r '. as \$line | try fromjson catch \$line'"
alias jcurl="curl -H 'Content-Type: application/json' -H 'Accept: application/json'"
alias gitlog='git log --oneline --graph'
alias watchsync='watch grep -e Dirty: -e Writeback: /proc/meminfo'
alias psgrep='ps -ef | grep -v grep | grep'
alias serve='python -m http.server'
alias dockerrm='docker stop $(docker ps -aq); docker rm -v $(docker ps -aq); docker volume prune -f --filter all=true; docker rmi $(docker images -q --filter "dangling=true")'
alias cls='clear && echo -en "\e[3J"'
alias removebom="sed -i \$'1s/^\uFEFF//'"
alias duskh="du -hka --max-depth=1 | sort -h"
alias 8bitdo="xboxdrv --evdev /dev/btjoy --config ~/.config/xboxdrv/8bitdo.conf"
alias ddev="export COMPOSE_FILE=docker-compose.dev.yaml"
alias penscreen="xsetwacom set 'Wacom Intuos PT S Pen stylus' MapToOutput HEAD-1; xsetwacom set 'Wacom Intuos PT S Pen eraser' MapToOutput HEAD-1"
alias connected="ss -O4Hpr -tun state connected"
test -e ~/.bash_aliases && source ~/.bash_aliases

View File

@ -1,50 +0,0 @@
#!/usr/bin/env bash
# set prefix if in termux
if uname -a | grep -q Android; then
pathprefix=/data/data/com.termux/files
else
pathprefix=
fi;
# fzf config
[ -f "$pathprefix/usr/share/fzf/completion.bash" ] && source "$pathprefix/usr/share/fzf/completion.bash"
[ -f "$pathprefix/usr/share/fzf/key-bindings.bash" ] && source "$pathprefix/usr/share/fzf/key-bindings.bash"
# goto
[ -f ~/skynet/scripts/goto.sh ] && source ~/skynet/scripts/goto.sh
# bash completion
test -e "$pathprefix/usr/share/bash-completion/bash_completion" && source "$pathprefix/usr/share/bash-completion/bash_completion"
# colorizer
GRC_ALIASES=true
test -e "$pathprefix/usr/share/grc/grc.sh" && source "$pathprefix/usr/share/grc/grc.sh"
# git bash completions
test -e ~/skynet/scripts/git-completion.bash && source ~/skynet/scripts/git-completion.bash
# nvm
test -e ~/.nvm/nvm.sh && source ~/.nvm/nvm.sh
test -e ~/.cargo/env && source ~/.cargo/env
# bat theme
BAT_THEME='Catppuccin-mocha'
# nnn color config
NNN_PLUG='d:dragdrop;i:imgview'
NNN_PREVIEWDIR="$HOME/.cache/nnn/previews"
BLK="03" CHR="03" DIR="04" EXE="02" REG="07" HARDLINK="05" SYMLINK="05" MISSING="08" ORPHAN="01" FIFO="06" SOCK="03" UNKNOWN="01"
NNN_COLORS="#04020301;4231"
NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$UNKNOWN"
export GRC_ALIASES BAT_THEME NNN_PLUG NNN_PREVIEWDIR NNN_COLORS NNN_FCOLORS
# google cloud sdk
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/rudism/.local/opt/google-cloud-sdk/path.bash.inc' ]; then . '/home/rudism/.local/opt/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/home/rudism/.local/opt/google-cloud-sdk/completion.bash.inc' ]; then . '/home/rudism/.local/opt/google-cloud-sdk/completion.bash.inc'; fi

View File

@ -1,31 +0,0 @@
#!/usr/bin/env bash
# dictionary
define(){
dict -d gcide "$1" | bat
}
# thesaurus
synonym(){
dict -d moby-thesaurus "$1" | bat
}
# mount with user permissions
mmount(){
sudo mount -o uid="$(whoami)",gid="$(whoami)" "/dev/$1" "/mnt/$2"
}
# easy ssh-agent persistence
function ssha() {
test=$(ps -ef | grep '\sssh-agent$' | grep -v grep | awk '{print $2}' | xargs)
if [ "$test" = "" ]; then
if [ -e ~/.ssh-agent.sh ]; then
rm -f ~/.ssh-agent.sh
fi
ssh-agent | grep -v echo >&~/.ssh-agent.sh
fi
test -e ~/.ssh-agent.sh && source ~/.ssh-agent.sh
ssh-add -l > /dev/null || ssh-add
}
test -e ~/.ssh-agent.sh && source ~/.ssh-agent.sh

View File

@ -1,72 +0,0 @@
#!/usr/bin/env bash
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
GRAY=$(tput setaf 8)
ITALIC=$(tput sitm)
RESET=$(tput sgr0)
format_command_time() {
local x="$1"
local ms="$((x % 1000))"
x="$((x / 1000))"
local sec="$((x % 60))"
x="$((x / 60))"
local min="$((x % 60))"
x="$((x / 60))"
local hour="$((x % 24))"
local day="$((x / 24))"
local timestr
if [ "$day" -gt 0 ]; then
timestr="${day}d "
fi
if [ "$hour" -gt 0 ]; then
timestr="$timestr${hour}h "
fi
if [ "$min" -gt 0 ]; then
timestr="$timestr${min}m "
fi
if [ "$sec" -gt 0 ]; then
timestr="$timestr${sec}s "
fi
timestr="$timestr${ms}ms"
printf '%s' "$timestr"
}
last_command_timer() {
last_command_start=${last_command_start:-$(date +%s%3N)}
}
set_prompt() {
if [ $? -eq 0 ]; then
prompt_color="$GREEN"
else
prompt_color="$RED"
fi
if [ -n "$last_command_start" ]; then
last_command_length=$(format_command_time "$(($(date +%s%3N) - last_command_start))")
unset last_command_start
last_command_stats="$ITALIC${MAGENTA}Completed in $last_command_length.$RESET\n"
else
last_command_stats=
fi
git_branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ -n "$git_branch" ]; then
local git_status
git_status=$(git status --porcelain)
if [ -n "$git_status" ]; then
git_symbol=" $RED"
else
git_symbol=" $GREEN"
fi
else
git_symbol=
fi
PS1="\n$last_command_stats\[$GRAY\]$(whoami)@$(hostname)\[$RESET\]\n\[$BLUE\]\w\[$RESET\]$git_symbol\[$YELLOW\]$git_branch\[$RESET\]\n\[$prompt_color\]\[$RESET\] "
}
trap 'last_command_timer' DEBUG
PROMPT_COMMAND=set_prompt

View File

@ -1,479 +0,0 @@
# shellcheck shell=bash
# shellcheck disable=SC2039
# SOURCE: https://github.com/iridakos/goto
# MIT License
#
# Copyright (c) 2018 Lazarus Lazaridis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Changes to the given alias directory
# or executes a command based on the arguments.
goto()
{
local target
_goto_resolve_db
if [ -z "$1" ]; then
# display usage and exit when no args
_goto_usage
return
fi
subcommand="$1"
shift
case "$subcommand" in
-c|--cleanup)
_goto_cleanup "$@"
;;
-r|--register) # Register an alias
_goto_register_alias "$@"
;;
-u|--unregister) # Unregister an alias
_goto_unregister_alias "$@"
;;
-p|--push) # Push the current directory onto the pushd stack, then goto
_goto_directory_push "$@"
;;
-o|--pop) # Pop the top directory off of the pushd stack, then change that directory
_goto_directory_pop
;;
-l|--list)
_goto_list_aliases
;;
-x|--expand) # Expand an alias
_goto_expand_alias "$@"
;;
-h|--help)
_goto_usage
;;
-v|--version)
_goto_version
;;
*)
_goto_directory "$subcommand"
;;
esac
return $?
}
_goto_resolve_db()
{
local CONFIG_DEFAULT="${XDG_CONFIG_HOME:-$HOME/.config}/goto"
GOTO_DB="${GOTO_DB:-$CONFIG_DEFAULT}"
GOTO_DB_CONFIG_DIRNAME=$(dirname "$GOTO_DB")
if [[ ! -d "$GOTO_DB_CONFIG_DIRNAME" ]]; then
mkdir "$GOTO_DB_CONFIG_DIRNAME"
fi
touch -a "$GOTO_DB"
}
_goto_usage()
{
cat <<\USAGE
usage: goto [<option>] <alias> [<directory>]
default usage:
goto <alias> - changes to the directory registered for the given alias
OPTIONS:
-r, --register: registers an alias
goto -r|--register <alias> <directory>
-u, --unregister: unregisters an alias
goto -u|--unregister <alias>
-p, --push: pushes the current directory onto the stack, then performs goto
goto -p|--push <alias>
-o, --pop: pops the top directory from the stack, then changes to that directory
goto -o|--pop
-l, --list: lists aliases
goto -l|--list
-x, --expand: expands an alias
goto -x|--expand <alias>
-c, --cleanup: cleans up non existent directory aliases
goto -c|--cleanup
-h, --help: prints this help
goto -h|--help
-v, --version: displays the version of the goto script
goto -v|--version
USAGE
}
# Displays version
_goto_version()
{
echo "goto version 2.1.0"
}
# Expands directory.
# Helpful for ~, ., .. paths
_goto_expand_directory()
{
builtin cd "$1" 2>/dev/null && pwd
}
# Lists registered aliases.
_goto_list_aliases()
{
local IFS=$' '
if [ -f "$GOTO_DB" ]; then
local maxlength=0
while read -r name directory; do
local length=${#name}
if [[ $length -gt $maxlength ]]; then
local maxlength=$length
fi
done < "$GOTO_DB"
while read -r name directory; do
printf "\e[1;36m%${maxlength}s \e[0m%s\n" "$name" "$directory"
done < "$GOTO_DB"
else
echo "You haven't configured any directory aliases yet."
fi
}
# Expands a registered alias.
_goto_expand_alias()
{
if [ "$#" -ne "1" ]; then
_goto_error "usage: goto -x|--expand <alias>"
return
fi
local resolved
resolved=$(_goto_find_alias_directory "$1")
if [ -z "$resolved" ]; then
_goto_error "alias '$1' does not exist"
return
fi
echo "$resolved"
}
# Lists duplicate directory aliases
_goto_find_duplicate()
{
local duplicates=
duplicates=$(sed -n 's:[^ ]* '"$1"'$:&:p' "$GOTO_DB" 2>/dev/null)
echo "$duplicates"
}
# Registers and alias.
_goto_register_alias()
{
if [ "$#" -ne "2" ]; then
_goto_error "usage: goto -r|--register <alias> <directory>"
return 1
fi
if ! [[ $1 =~ ^[[:alnum:]]+[a-zA-Z0-9_-]*$ ]]; then
_goto_error "invalid alias - can start with letters or digits followed by letters, digits, hyphens or underscores"
return 1
fi
local resolved
resolved=$(_goto_find_alias_directory "$1")
if [ -n "$resolved" ]; then
_goto_error "alias '$1' exists"
return 1
fi
local directory
directory=$(_goto_expand_directory "$2")
if [ -z "$directory" ]; then
_goto_error "failed to register '$1' to '$2' - can't cd to directory"
return 1
fi
local duplicate
duplicate=$(_goto_find_duplicate "$directory")
if [ -n "$duplicate" ]; then
_goto_warning "duplicate alias(es) found: \\n$duplicate"
fi
# Append entry to file.
echo "$1 $directory" >> "$GOTO_DB"
echo "Alias '$1' registered successfully."
}
# Unregisters the given alias.
_goto_unregister_alias()
{
if [ "$#" -ne "1" ]; then
_goto_error "usage: goto -u|--unregister <alias>"
return 1
fi
local resolved
resolved=$(_goto_find_alias_directory "$1")
if [ -z "$resolved" ]; then
_goto_error "alias '$1' does not exist"
return 1
fi
# shellcheck disable=SC2034
local readonly GOTO_DB_TMP="$HOME/.goto_"
# Delete entry from file.
sed "/^$1 /d" "$GOTO_DB" > "$GOTO_DB_TMP" && mv "$GOTO_DB_TMP" "$GOTO_DB"
echo "Alias '$1' unregistered successfully."
}
# Pushes the current directory onto the stack, then goto
_goto_directory_push()
{
if [ "$#" -ne "1" ]; then
_goto_error "usage: goto -p|--push <alias>"
return
fi
{ pushd . || return; } 1>/dev/null 2>&1
_goto_directory "$@"
}
# Pops the top directory from the stack, then goto
_goto_directory_pop()
{
{ popd || return; } 1>/dev/null 2>&1
}
# Unregisters aliases whose directories no longer exist.
_goto_cleanup()
{
if ! [ -f "$GOTO_DB" ]; then
return
fi
while IFS= read -r i && [ -n "$i" ]; do
echo "Cleaning up: $i"
_goto_unregister_alias "$i"
done <<< "$(awk '{al=$1; $1=""; dir=substr($0,2);
system("[ ! -d \"" dir "\" ] && echo " al)}' "$GOTO_DB")"
}
# Changes to the given alias' directory
_goto_directory()
{
# directly goto the special name that is unable to be registered due to invalid alias, eg: ~
if ! [[ $1 =~ ^[[:alnum:]]+[a-zA-Z0-9_-]*$ ]]; then
{ builtin cd "$1" 2> /dev/null && return 0; } || \
{ _goto_error "Failed to goto '$1'" && return 1; }
fi
local target
target=$(_goto_resolve_alias "$1") || return 1
builtin cd "$target" 2> /dev/null || \
{ _goto_error "Failed to goto '$target'" && return 1; }
}
# Fetches the alias directory.
_goto_find_alias_directory()
{
local resolved
resolved=$(sed -n "s/^$1 \\(.*\\)/\\1/p" "$GOTO_DB" 2>/dev/null)
echo "$resolved"
}
# Displays the given error.
# Used for common error output.
_goto_error()
{
(>&2 echo -e "goto error: $1")
}
# Displays the given warning.
# Used for common warning output.
_goto_warning()
{
(>&2 echo -e "goto warning: $1")
}
# Displays entries with aliases starting as the given one.
_goto_print_similar()
{
local similar
similar=$(sed -n "/^$1[^ ]* .*/p" "$GOTO_DB" 2>/dev/null)
if [ -n "$similar" ]; then
(>&2 echo "Did you mean:")
(>&2 column -t <<< "$similar")
fi
}
# Fetches alias directory, errors if it doesn't exist.
_goto_resolve_alias()
{
local resolved
resolved=$(_goto_find_alias_directory "$1")
if [ -z "$resolved" ]; then
_goto_error "unregistered alias $1"
_goto_print_similar "$1"
return 1
else
echo "${resolved}"
fi
}
# Completes the goto function with the available commands
_complete_goto_commands()
{
local IFS=$' \t\n'
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-r --register -u --unregister -p --push -o --pop -l --list -x --expand -c --cleanup -v --version" -- "$1"))
}
# Completes the goto function with the available aliases
_complete_goto_aliases()
{
local IFS=$'\n' matches
_goto_resolve_db
# shellcheck disable=SC2207
matches=($(sed -n "/^$1/p" "$GOTO_DB" 2>/dev/null))
if [ "${#matches[@]}" -eq "1" ]; then
# remove the filenames attribute from the completion method
compopt +o filenames 2>/dev/null
# if you find only one alias don't append the directory
COMPREPLY=("${matches[0]// *}")
else
for i in "${!matches[@]}"; do
# remove the filenames attribute from the completion method
compopt +o filenames 2>/dev/null
if ! [[ $(uname -s) =~ Darwin* ]]; then
matches[$i]=$(printf '%*s' "-$COLUMNS" "${matches[$i]}")
COMPREPLY+=("$(compgen -W "${matches[$i]}")")
else
COMPREPLY+=("${matches[$i]// */}")
fi
done
fi
}
# Bash programmable completion for the goto function
_complete_goto_bash()
{
local cur="${COMP_WORDS[$COMP_CWORD]}" prev
if [ "$COMP_CWORD" -eq "1" ]; then
# if we are on the first argument
if [[ $cur == -* ]]; then
# and starts like a command, prompt commands
_complete_goto_commands "$cur"
else
# and doesn't start as a command, prompt aliases
_complete_goto_aliases "$cur"
fi
elif [ "$COMP_CWORD" -eq "2" ]; then
# if we are on the second argument
prev="${COMP_WORDS[1]}"
if [[ $prev = "-u" ]] || [[ $prev = "--unregister" ]]; then
# prompt with aliases if user tries to unregister one
_complete_goto_aliases "$cur"
elif [[ $prev = "-x" ]] || [[ $prev = "--expand" ]]; then
# prompt with aliases if user tries to expand one
_complete_goto_aliases "$cur"
elif [[ $prev = "-p" ]] || [[ $prev = "--push" ]]; then
# prompt with aliases only if user tries to push
_complete_goto_aliases "$cur"
fi
elif [ "$COMP_CWORD" -eq "3" ]; then
# if we are on the third argument
prev="${COMP_WORDS[1]}"
if [[ $prev = "-r" ]] || [[ $prev = "--register" ]]; then
# prompt with directories only if user tries to register an alias
local IFS=$' \t\n'
# shellcheck disable=SC2207
COMPREPLY=($(compgen -d -- "$cur"))
fi
fi
}
# Zsh programmable completion for the goto function
_complete_goto_zsh()
{
local all_aliases=()
_goto_resolve_db
while IFS= read -r line; do
all_aliases+=("$line")
done <<< "$(sed -e 's/ /:/g' $GOTO_DB 2>/dev/null)"
local state
local -a options=(
'(1)'{-r,--register}'[registers an alias]:register:->register'
'(- 1 2)'{-u,--unregister}'[unregisters an alias]:unregister:->unregister'
'(: -)'{-l,--list}'[lists aliases]'
'(*)'{-c,--cleanup}'[cleans up non existent directory aliases]'
'(1 2)'{-x,--expand}'[expands an alias]:expand:->aliases'
'(1 2)'{-p,--push}'[pushes the current directory onto the stack, then performs goto]:push:->aliases'
'(*)'{-o,--pop}'[pops the top directory from stack, then changes to that directory]'
'(: -)'{-h,--help}'[prints this help]'
'(* -)'{-v,--version}'[displays the version of the goto script]'
)
_arguments -C \
"${options[@]}" \
'1:alias:->aliases' \
'2:dir:_files' \
&& ret=0
case ${state} in
(aliases)
_describe -t aliases 'goto aliases:' all_aliases && ret=0
;;
(unregister)
_describe -t aliases 'unregister alias:' all_aliases && ret=0
;;
esac
return $ret
}
goto_aliases=($(alias | sed -n "s/.*\s\(.*\)='goto'/\1/p"))
goto_aliases+=("goto")
for i in "${goto_aliases[@]}"
do
# Register the goto completions.
if [ -n "${BASH_VERSION}" ]; then
if ! [[ $(uname -s) =~ Darwin* ]]; then
complete -o filenames -F _complete_goto_bash $i
else
complete -F _complete_goto_bash $i
fi
elif [ -n "${ZSH_VERSION}" ]; then
compdef _complete_goto_zsh $i
else
echo "Unsupported shell."
exit 1
fi
done

View File

@ -1,26 +0,0 @@
#!/usr/bin/env bash
if [ -z "$DISPLAY" ] && [ -x "$(command -v startx)" ] && ! pgrep herbstluftwm >/dev/null; then
# start x if it's available and we're not already in it
startx
else
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ linux ]] && [ -z "$TMUX" ]; then
# otherwise start tmux if it's available and we're not already in it
exec tmux
else
# otherwise robot quote
if [ -x "$(command -v botsay)" ]; then
len=1642 #$(jq '. | length' ~/skynet/quotes.json)
idx=$(( RANDOM % len))
quote=()
while read -r value; do
quote+=("$value")
done < <(jq -r ".[$idx] | .quoteText, .quoteAuthor" ~/skynet/shell/quotes.json)
quoteText="${quote[0]}"
if [ -n "${quote[1]}" ]; then
quoteText="$quoteText --${quote[1]}"
fi
echo "$quoteText" | botsay -c -
fi
fi
fi

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +0,0 @@
set-option -sa terminal-overrides ',rxvt-unicode-256color:RGB'
set-option -g history-limit 100000
set-option -g status off
set-option -g focus-events on
set -g default-terminal "st-256color"
set -g mouse on
setw -g aggressive-resize on
setw -g mode-keys vi
setw -g automatic-rename on
bind m \
set -g mouse on \;\
display 'Mouse: ON'
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
set -s copy-command 'xsel -b -i'
bind ] run "tmux set-buffer -- \"$(xsel -b -o)\"; tmux paste-buffer"
bind-key -n MouseDown2Pane run "tmux set-buffer -- \"$(xsel -b -o)\"; tmux paste-buffer"
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
bind r source-file ~/.tmux.conf \; display "tmux config reloaded :)"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
set -s escape-time 0

View File

@ -1,16 +0,0 @@
// ==UserScript==
// @name Redirect-YouTube
// @namespace code.sitosis.com
// @version 1.0
// @description Rediret YouTube
// @author rudism
// @match https://www.youtube.com/*
// @match https://youtube.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
top.location.hostname = "yt.rdsm.ca";
})();

View File

@ -1,30 +0,0 @@
TigerVNC Configuration file Version 1.0
ServerName=voidism
X509CA=/home/rudism/.vnc/x509_ca.pem
X509CRL=/home/rudism/.vnc/x509_crl.pem
SecurityTypes=X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None
EmulateMiddleButton=0
DotWhenNoCursor=0
ReconnectOnError=1
AutoSelect=1
FullColor=1
LowColorLevel=2
PreferredEncoding=Tight
CustomCompressLevel=0
CompressLevel=2
NoJPEG=0
QualityLevel=8
FullScreen=1
FullScreenMode=Current
FullScreenSelectedMonitors=1
DesktopSize=
RemoteResize=0
ViewOnly=0
Shared=0
AcceptClipboard=1
SendClipboard=1
SendPrimary=1
SetPrimary=1
MenuKey=F8
FullscreenSystemKeys=1

View File

@ -1,35 +0,0 @@
default = {
x = {relative = 0.5; offset = 0;};
y = {relative = 1; offset = -100;};
length = {relative = 0.3; offset = 0;};
thickness = 24;
outline = 3;
border = 4;
padding = 3;
orientation = "horizontal";
overflow = "proportional";
color = {
normal = {
fg = "#ffffff";
bg = "#00000090";
border = "#ffffff";
};
alt = {
fg = "#555555";
bg = "#00000090";
border = "#555555";
};
overflow = {
fg = "#ff0000";
bg = "#00000090";
border = "#ff0000";
};
altoverflow = {
fg = "#550000";
bg = "#00000090";
border = "#550000";
};
};
};

View File

@ -1,42 +0,0 @@
Xcursor.theme: Adwaita
*.foreground: #dedacf
*.background: #080808
*.cursorColor: #bbbbbb
!
! Black
*.color0: #080808
*.color8: #313131
!
! Red
*.color1: #ff615a
*.color9: #f58c80
!
! Green
*.color2: #b1e969
*.color10: #ddf88f
!
! Yellow
*.color3: #ebd99c
*.color11: #eee5b2
!
! Blue
*.color4: #5da9f6
*.color12: #a5c7ff
!
! Magenta
*.color5: #e86aff
*.color13: #ddaaff
!
! Cyan
*.color6: #82fff7
*.color14: #b7fff9
!
! White
*.color7: #dedacf
*.color15: #ffffff
!
! Bold, Italic, Underline
*.colorBD: #ffffff
!*.colorIT:
!*.colorUL:

View File

@ -1,16 +0,0 @@
[Settings]
gtk-icon-theme-name=Catppuccin-Mocha-Dark-Cursors
gtk-theme-name=Catppuccin-Mocha
gtk-application-prefer-dark-theme=0
gtk-font-name=Sans 10
gtk-cursor-theme-name=Catppuccin-Mocha-Dark-Cursors
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium

View File

@ -1,3 +0,0 @@
gtk-theme-name="Arc-Dark"
gtk-icon-theme="Arc-Dark"
gtk-application-prefer-dark-theme="true"

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