From: Andre Ramnitz Date: Tue, 19 Dec 2023 19:06:05 +0000 (+0100) Subject: overhaul directory structure for fzf X-Git-Tag: v0.2~303 X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=ea41ace7a60ec02ec5d4e601dcca057bbffc4f7d;p=dotfiles.git overhaul directory structure for fzf --- diff --git a/.gitmodules b/.gitmodules index 07795eb2..a77a0dda 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,52 +1,55 @@ -[submodule "foot/.config/foot/base16"] - path = foot/.config/foot/base16 - url = https://github.com/tinted-theming/base16-foot - master = master -[submodule "plug.kak"] - path = kak/.config/kak/plugins/plug.kak +[submodule "config/kak/plugins/powerline.kak"] + path = config/kak/plugins/powerline.kak + url = https://github.com/andreyorst/powerline.kak + branch = master +[submodule "config/kak/plugins/plug.kak"] + path = config/kak/plugins/plug.kak url = https://github.com/andreyorst/plug.kak branch = master -[submodule "shellcheck.kak"] - path = kak/.config/kak/plugins/shellcheck.kak +[submodule "config/kak/plugins/shellcheck.kak"] + path = config/kak/plugins/shellcheck.kak url = https://github.com/whereswaldon/shellcheck.kak branch = master -[submodule "prelude.kak"] - path = kak/.config/kak/plugins/prelude.kak +[submodule "config/kak/plugins/prelude.kak"] + path = config/kak/plugins/prelude.kak url = https://github.com/kakounedotcom/prelude.kak branch = master -[submodule "sudo-write.kak"] - path = kak/.config/kak/plugins/sudo-write.kak +[submodule "config/kak/plugins/sudo-write.kak"] + path = config/kak/plugins/sudo-write.kak url = https://github.com/occivink/kakoune-sudo-write branch = master -[submodule "smarttab.kak"] - path = kak/.config/kak/plugins/smarttab.kak +[submodule "config/kak/plugins/smarttab.kak"] + path = config/kak/plugins/smarttab.kak url = https://github.com/andreyorst/smarttab.kak branch = master -[submodule "bookmarks.kak"] - path = kak/.config/kak/plugins/bookmarks.kak +[submodule "config/kak/plugins/bookmarks.kak"] + path = config/kak/plugins/bookmarks.kak url = https://github.com/Ersikan/bookmarks.kak branch = main -[submodule "foot.kak"] - path = kak/.config/kak/plugins/foot.kak +[submodule "config/kak/plugins/foot.kak"] + path = config/kak/plugins/foot.kak url = https://github.com/kkga/foot.kak branch = master -[submodule "kakoune-sudo-write"] - path = kak/.config/kak/plugins/kakoune-sudo-write +[submodule "config/kak/plugins/kakoune-sudo-write"] + path = config/kak/plugins/kakoune-sudo-write url = https://github.com/occivink/kakoune-sudo-write branch = master -[submodule "dabruin.kak"] - path = kak/.config/kak/plugins/dabruin.kak +[submodule "config/kak/plugins/dabruin.kak"] + path = config/kak/plugins/dabruin.kak url = https://git.sr.ht/~nasmevka/dabruin.kak branch = main -[submodule "kakoune-find"] - path = kak/.config/kak/plugins/kakoune-find +[submodule "config/kak/plugins/kakoune-find"] + path = config/kak/plugins/kakoune-find url = https://github.com/occivink/kakoune-find branch = master -[submodule "kakounse-tabs"] - path = kak/.config/kak/plugins/tabs.kak +[submodule "config/kak/plugins/tabs.kak"] + path = config/kak/plugins/tabs.kak url = https://github.com/enricozb/tabs.kak branch = main -[submodule "kak/.config/kak/plugins/kak-harpoon"] - path = kak/.config/kak/plugins/kak-harpoon +[submodule "config/kak/plugins/kak-harpoon"] + path = config/kak/plugins/kak-harpoon url = https://github.com/raiguard/kak-harpoon branch = main +[submodule "config/foot/base16"] + path = config/foot/base16 + url = https://github.com/tinted-theming/base16-foot diff --git a/OpenRGB/.config/OpenRGB/Normal.orp b/OpenRGB/.config/OpenRGB/Normal.orp deleted file mode 100644 index f8b208c2..00000000 Binary files a/OpenRGB/.config/OpenRGB/Normal.orp and /dev/null differ diff --git a/OpenRGB/.config/OpenRGB/plugins/settings/gradients/my-gradient1 b/OpenRGB/.config/OpenRGB/plugins/settings/gradients/my-gradient1 deleted file mode 100644 index 6c63396e..00000000 --- a/OpenRGB/.config/OpenRGB/plugins/settings/gradients/my-gradient1 +++ /dev/null @@ -1,25 +0,0 @@ -{ - "colors": [ - { - "color": "#231557", - "position": 0.0 - }, - { - "color": "#44107a", - "position": 0.2800000011920929 - }, - { - "color": "#ff1361", - "position": 0.6700000166893005 - }, - { - "color": "#fff800", - "position": 1.0 - } - ], - "rotate": 225, - "spread": "Pad", - "type": "Conical", - "x_offset": 86, - "y_offset": 36 -} \ No newline at end of file diff --git a/OpenRGB/.config/OpenRGB/plugins/settings/virtual-controllers/Normal b/OpenRGB/.config/OpenRGB/plugins/settings/virtual-controllers/Normal deleted file mode 100644 index aebdc9cc..00000000 --- a/OpenRGB/.config/OpenRGB/plugins/settings/virtual-controllers/Normal +++ /dev/null @@ -1,403 +0,0 @@ -{ - "ctrl_zones": [ - { - "controller": { - "location": "I2C: /dev/i2c-10, address 0x71", - "name": "ENE DRAM", - "serial": "", - "vendor": "ENE" - }, - "custom_zone_name": "RAM1", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 1, - "x": 13, - "y": 38 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "I2C: /dev/i2c-10, address 0x73", - "name": "ENE DRAM", - "serial": "", - "vendor": "ENE" - }, - "custom_zone_name": "RAM2", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 1, - "x": 15, - "y": 38 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "I2C: /dev/i2c-10, address 0x72", - "name": "ENE DRAM", - "serial": "", - "vendor": "ENE" - }, - "custom_zone_name": "RAM4", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 1, - "x": 19, - "y": 38 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "HID: /dev/hidraw5", - "name": "Razer Chroma Addressable RGB Controller", - "serial": "IO2117U08301116 ", - "vendor": "Razer" - }, - "custom_zone_name": "Front Dual LED Strips", - "settings": { - "custom_shape": null, - "led_spacing": 2, - "reverse": true, - "shape": 1, - "x": 62, - "y": 3 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "HID: /dev/hidraw4", - "name": "Razer Mouse Bungee V3 Chroma", - "serial": "382112U07902334 ", - "vendor": "Razer" - }, - "custom_zone_name": "", - "settings": { - "custom_shape": { - "h": 9, - "led_positions": [ - { - "led_num": 0, - "x": 8, - "y": 3 - }, - { - "led_num": 1, - "x": 7, - "y": 5 - }, - { - "led_num": 2, - "x": 4, - "y": 6 - }, - { - "led_num": 3, - "x": 1, - "y": 5 - }, - { - "led_num": 4, - "x": 0, - "y": 3 - }, - { - "led_num": 5, - "x": 1, - "y": 1 - }, - { - "led_num": 6, - "x": 4, - "y": 0 - }, - { - "led_num": 7, - "x": 7, - "y": 1 - } - ], - "w": 9 - }, - "led_spacing": 1, - "reverse": false, - "shape": 2, - "x": 31, - "y": 8 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "HID: /dev/hidraw12", - "name": "ASUS ROG CROSSHAIR VIII DARK HERO", - "serial": "9876543210", - "vendor": "ASUS" - }, - "custom_zone_name": "", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 1, - "x": 54, - "y": 36 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "HID: /dev/hidraw13", - "name": "Razer Strider Chroma", - "serial": "ST2252V14800417 ", - "vendor": "Razer" - }, - "custom_zone_name": "", - "settings": { - "custom_shape": { - "h": 4, - "led_positions": [ - { - "led_num": 0, - "x": 0, - "y": 0 - }, - { - "led_num": 1, - "x": 1, - "y": 0 - }, - { - "led_num": 2, - "x": 2, - "y": 0 - }, - { - "led_num": 3, - "x": 3, - "y": 0 - }, - { - "led_num": 4, - "x": 4, - "y": 0 - }, - { - "led_num": 5, - "x": 5, - "y": 0 - }, - { - "led_num": 6, - "x": 6, - "y": 0 - }, - { - "led_num": 7, - "x": 7, - "y": 0 - }, - { - "led_num": 8, - "x": 7, - "y": 1 - }, - { - "led_num": 9, - "x": 7, - "y": 2 - }, - { - "led_num": 10, - "x": 7, - "y": 3 - }, - { - "led_num": 11, - "x": 5, - "y": 3 - }, - { - "led_num": 12, - "x": 4, - "y": 3 - }, - { - "led_num": 13, - "x": 3, - "y": 3 - }, - { - "led_num": 14, - "x": 2, - "y": 3 - }, - { - "led_num": 15, - "x": 1, - "y": 3 - }, - { - "led_num": 16, - "x": 0, - "y": 3 - }, - { - "led_num": 17, - "x": 0, - "y": 2 - }, - { - "led_num": 18, - "x": 6, - "y": 3 - } - ], - "w": 8 - }, - "led_spacing": 1, - "reverse": false, - "shape": 2, - "x": 13, - "y": 10 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "HID: /dev/hidraw19", - "name": "Razer Base Station V2 Chroma", - "serial": "382151U07800321 ", - "vendor": "Razer" - }, - "custom_zone_name": "", - "settings": { - "custom_shape": { - "h": 9, - "led_positions": [ - { - "led_num": 0, - "x": 10, - "y": 4 - }, - { - "led_num": 1, - "x": 8, - "y": 7 - }, - { - "led_num": 2, - "x": 5, - "y": 8 - }, - { - "led_num": 3, - "x": 2, - "y": 7 - }, - { - "led_num": 4, - "x": 0, - "y": 4 - }, - { - "led_num": 5, - "x": 2, - "y": 1 - }, - { - "led_num": 6, - "x": 5, - "y": 0 - }, - { - "led_num": 7, - "x": 8, - "y": 1 - } - ], - "w": 11 - }, - "led_spacing": 1, - "reverse": false, - "shape": 2, - "x": 47, - "y": 6 - }, - "zone_idx": 0 - }, - { - "controller": { - "location": "HID: /dev/hidraw12", - "name": "ASUS ROG CROSSHAIR VIII DARK HERO", - "serial": "9876543210", - "vendor": "ASUS" - }, - "custom_zone_name": "", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 0, - "x": 0, - "y": 0 - }, - "zone_idx": 1 - }, - { - "controller": { - "location": "HID: /dev/hidraw5", - "name": "Razer Chroma Addressable RGB Controller", - "serial": "IO2117U08301116 ", - "vendor": "Razer" - }, - "custom_zone_name": "", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 0, - "x": 31, - "y": 47 - }, - "zone_idx": 2 - }, - { - "controller": { - "location": "I2C: /dev/i2c-10, address 0x70", - "name": "ENE DRAM", - "serial": "", - "vendor": "ENE" - }, - "custom_zone_name": "RAM3", - "settings": { - "custom_shape": null, - "led_spacing": 1, - "reverse": false, - "shape": 1, - "x": 17, - "y": 38 - }, - "zone_idx": 0 - } - ], - "grid_settings": { - "auto_load": true, - "auto_register": true, - "grid_size": 1, - "h": 64, - "live_preview": true, - "show_bounds": true, - "show_grid": true, - "unregister_members": false, - "w": 64 - } -} \ No newline at end of file diff --git a/OpenRGB/.config/OpenRGB/simple.orp b/OpenRGB/.config/OpenRGB/simple.orp deleted file mode 100644 index e328c909..00000000 Binary files a/OpenRGB/.config/OpenRGB/simple.orp and /dev/null differ diff --git a/OpenRGB/.config/OpenRGB/sizes.ors b/OpenRGB/.config/OpenRGB/sizes.ors deleted file mode 100644 index da864121..00000000 Binary files a/OpenRGB/.config/OpenRGB/sizes.ors and /dev/null differ diff --git a/aerc/.config/aerc/aerc.conf b/aerc/.config/aerc/aerc.conf deleted file mode 100644 index 69f40259..00000000 --- a/aerc/.config/aerc/aerc.conf +++ /dev/null @@ -1,340 +0,0 @@ -# -# aerc main configuration - -[general] -# -# If set to "gpg", aerc will use system gpg binary and keystore for all crypto -# operations. Otherwise, the internal openpgp implementation will be used. -# -# Default: internal -pgp-provider=internal - -# By default, the file permissions of accounts.conf must be restrictive and -# only allow reading by the file owner (0600). Set this option to true to -# ignore this permission check. Use this with care as it may expose your -# credentials. -# -# Default: false -unsafe-accounts-conf=false - -[ui] -index-columns = date<20,name<17,flags>4,subject<* -column-subject = {{.ThreadPrefix}}{{.Subject}} -column-date = {{.DateAutoFormat .Date.Local}} -column-name = {{index (.From | names) 0}} -column-flags = {{.Flags | join ""}} - -dirlist-left = {{.Folder}} -dirlist-right = {{if .Unread}}{{humanReadable .Unread}}/{{end}}{{if .Exists}}{{humanReadable .Exists}}{{end}} - -# -# See time.Time#Format at https://godoc.org/time#Time.Format -# -# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) -timestamp-format=2006-01-02 03:04 PM - -# -# Index-only time format for messages that were received/sent today. -# If this is not specified, timestamp-format is used instead. -# -# Default: "03:04 PM" (12 hour time) -this-day-time-format=03:04 PM - -# -# Index-only time format for messages that were received/sent within the last -# 7 days. If this is not specified, timestamp-format is used instead. -# -# Default: "Monday 03:04 PM" (Week day + 12 hour time) -this-week-time-format=Monday 03:04 PM - -# -# Index-only time format for messages that were received/sent this year. -# If this is not specified, timestamp-format is used instead. -# -# Default: "January 02" (Month + month day) -this-year-time-format=January 02 - -# -# Width of the sidebar, including the border. -# -# Default: 20 -sidebar-width=28 - -# -# Message to display when viewing an empty folder. -# -# Default: (no messages) -empty-message=(no messages) - -# Message to display when no folders exists or are all filtered -# -# Default: (no folders) -empty-dirlist=(no folders) - -# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel -# -# Default: false -mouse-enabled=false - -# -# Ring the bell when new messages are received -# -# Default: true -new-message-bell=true - -# Marker to show before a pinned tab's name. -# -# Default: ` -pinned-tab-marker='`' - -# Delay after which the messages are actually listed when entering a directory. -# This avoids loading messages when skipping over folders and makes the UI more -# responsive. If you do not want that, set it to 0s. -# -# Default: 200ms -dirlist-delay=200ms - -# Display the directory list as a foldable tree that allows to collapse and -# expand the folders. -# -# Default: false -dirlist-tree=false - -# If dirlist-tree is enabled, set level at which folders are collapsed by -# default. Set to 0 to disable. -# -# Default: 0 -dirlist-collapse=0 - -# List of space-separated criteria to sort the messages by, see *sort* -# command in *aerc*(1) for reference. Prefixing a criterion with "-r " -# reverses that criterion. -# -# Example: "from -r date" -# -# Default: "" -sort= - -# Moves to next message when the current message is deleted -# -# Default: true -next-message-on-delete=true - -# The directories where the stylesets are stored. It takes a colon-separated -# list of directories. If this is unset or if a styleset cannot be found, the -# following paths will be used as a fallback in that order: -# -# ${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets -# ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets -# /usr/local/share/aerc/stylesets -# /usr/share/aerc/stylesets -# -# default: "" -stylesets-dirs= - -# Uncomment to use box-drawing characters for vertical and horizontal borders. -# -# Default: spaces -# border-char-vertical=│ -# border-char-horizontal=─ - -# Sets the styleset to use for the aerc ui elements. -# -# Default: default -styleset-name=default - -# Activates fuzzy search in commands and their arguments: the typed string is -# searched in the command or option in any position, and need not be -# consecutive characters in the command or option. -#fuzzy-complete=false - -# How long to wait after the last input before auto-completion is triggered. -# -# Default: 250ms -completion-delay=250ms - -# -# Global switch for completion popovers -# -# Default: true -completion-popovers=true - -# Uncomment to use UTF-8 symbols to indicate PGP status of messages -# -# Default: ASCII -#icon-unencrypted= -#icon-encrypted=✔ -#icon-signed=✔ -#icon-signed-encrypted=✔ -#icon-unknown=✘ -#icon-invalid=⚠ - -#[ui:account=foo] -# -# Enable a threaded view of messages. If this is not supported by the backend -# (IMAP server or notmuch), threads will be built by the client. -# -# Default: false -#threading-enabled=false - -# Force client-side thread building -# -# Default: false -#force-client-threads=false - -# Debounce client-side thread building -# -# Default: 50ms -#client-threads-delay=50ms - -[statusline] -status-columns = left<*,right>* -column-left = [{{.Account}}] {{.StatusInfo}} -column-right = {{.TrayInfo}} - -# Specifies the separator between grouped statusline elements. -# -# Default: " | " -# separator= - -# Defines the mode for displaying the status elements. -# Options: text, icon -# -# Default: text -# display-mode= - -[viewer] -# -# Specifies the pager to use when displaying emails. Note that some filters -# may add ANSI codes to add color to rendered emails, so you may want to use a -# pager which supports ANSI codes. -# -# Default: less -R -pager=less -R - -# -# If an email offers several versions (multipart), you can configure which -# mimetype to prefer. For example, this can be used to prefer plaintext over -# html emails. -# -# Default: text/plain,text/html -alternatives=text/plain,text/html - -# -# Default setting to determine whether to show full headers or only parsed -# ones in message viewer. -# -# Default: false -show-headers=false - -# -# Layout of headers when viewing a message. To display multiple headers in the -# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if -# none of their specified headers are present in the message. -# -# Default: From|To,Cc|Bcc,Date,Subject -header-layout=From|To,Cc|Bcc,Date,Subject - -# Whether to always show the mimetype of an email, even when it is just a single part -# -# Default: false -always-show-mime=false - -# Parses and extracts http links when viewing a message. Links can then be -# accessed with the open-link command. -# -# Default: true -parse-http-links=true - -[compose] -# -# Specifies the command to run the editor with. It will be shown in an embedded -# terminal, though it may also launch a graphical window if the environment -# supports it. Defaults to $EDITOR, or vi. -editor= - -# -# Default header fields to display when composing a message. To display -# multiple headers in the same row, separate them with a pipe, e.g. "To|From". -# -# Default: To|From,Subject -header-layout=To|From,Subject - -# -# Specifies the command to be used to tab-complete email addresses. Any -# occurrence of "%s" in the address-book-cmd will be replaced with what the -# user has typed so far. -# -# The command must output the completions to standard output, one completion -# per line. Each line must be tab-delimited, with an email address occurring as -# the first field. Only the email address field is required. The second field, -# if present, will be treated as the contact name. Additional fields are -# ignored. -# -# This parameter can also be set per account in accounts.conf. -address-book-cmd= - -# -# Allow to address yourself when replying -# -# Default: true -reply-to-self=true - -[filters] -# -# Filters allow you to pipe an email body through a shell command to render -# certain emails differently, e.g. highlighting them with ANSI escape codes. -# -# The first filter which matches the email's mimetype will be used, so order -# them from most to least specific. -# -# You can also match on non-mimetypes, by prefixing with the header to match -# against (non-case-sensitive) and a comma, e.g. subject,text will match a -# subject which contains "text". Use header,~regex to match against a regex. -#subject,~^\[PATCH=colordiff -text/plain=sed 's/^>\+.*/\x1b[36m&\x1b[0m/' -#text/html=pandoc -f html -t plain -#text/html=w3m -dump -I UTF-8 -T text/html -#image/*=catimg -w $(tput cols) - - -[triggers] -# -# Triggers specify commands to execute when certain events occur. -# -# Example: -# new-email=exec notify-send "New email from %n" "%s" - -# -# Executed when a new email arrives in the selected folder -new-email= - -[templates] -# Templates are used to populate email bodies automatically. -# - -# The directories where the templates are stored. It takes a colon-separated -# list of directories. If this is unset or if a template cannot be found, the -# following paths will be used as a fallback in that order: -# -# ${XDG_CONFIG_HOME:-~/.config}/aerc/templates -# ${XDG_DATA_HOME:-~/.local/share}/aerc/templates -# /usr/local/share/aerc/templates -# /usr/share/aerc/templates -# -# default: "" -template-dirs= - -# The default template to be used for new messages. -# -# default: new_message -new-message=new_message - -# The default template to be used for quoted replies. -# -# default: quoted_reply -quoted-reply=quoted_reply - -# The default template to be used for forward as body. -# -# default: forward_as_body -forwards=forward_as_body diff --git a/aerc/.config/aerc/binds.conf b/aerc/.config/aerc/binds.conf deleted file mode 100644 index cb5ffd3d..00000000 --- a/aerc/.config/aerc/binds.conf +++ /dev/null @@ -1,122 +0,0 @@ -# Binds are of the form = -# To use '=' in a key sequence, substitute it with "Eq": "" -# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit - = :prev-tab - = :next-tab - = :term -? = :help keys - -[messages] -q = :quit - -j = :next - = :next - = :next 50% - = :next 100% - = :next 100% - -k = :prev - = :prev - = :prev 50% - = :prev 100% - = :prev 100% -g = :select 0 -G = :select -1 - -J = :next-folder -K = :prev-folder -H = :collapse-folder -L = :expand-folder - -v = :mark -t -V = :mark -v - -T = :toggle-threads - - = :view -d = :prompt 'Really delete this message?' 'delete-message' -D = :delete -A = :archive flat - -C = :compose - -rr = :reply -a -rq = :reply -aq -Rr = :reply -Rq = :reply -q - -c = :cf -$ = :term -! = :term -| = :pipe - -/ = :search -\ = :filter -n = :next-result -N = :prev-result - = :clear - -[messages:folder=Drafts] - = :recall - -[view] -/ = :toggle-key-passthrough/ -q = :close -O = :open -S = :save -| = :pipe -D = :delete -A = :archive flat - - = :open-link - -f = :forward -rr = :reply -a -rq = :reply -aq -Rr = :reply -Rq = :reply -q - -H = :toggle-headers - = :prev-part - = :next-part -J = :next -K = :prev - -[view::passthrough] -$noinherit = true -$ex = - = :toggle-key-passthrough - -[compose] -# Keybindings used when the embedded terminal is not selected in the compose -# view -$ex = - = :prev-field - = :next-field - = :next-field - -[compose::editor] -# Keybindings used when the embedded terminal is selected in the compose view -$noinherit = true -$ex = - = :prev-field - = :next-field - = :prev-tab - = :next-tab - -[compose::review] -# Keybindings used when reviewing a message to be sent -y = :send -n = :abort -p = :postpone -q = :choose -o d discard abort -o p postpone postpone -e = :edit -a = :attach -d = :detach - -[terminal] -$noinherit = true -$ex = - - = :prev-tab - = :next-tab diff --git a/aerc/.config/aerc/scripts/wait-for-creds.sh b/aerc/.config/aerc/scripts/wait-for-creds.sh deleted file mode 100755 index 7ab4f102..00000000 --- a/aerc/.config/aerc/scripts/wait-for-creds.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -secret-tool lookup "$1" "$2" -# wait until the password is available -while [ $? != 0 ]; do - secret-tool lookup "$1" "$2" -done - diff --git a/bin/.local/bin/16.c b/bin/.local/bin/16.c deleted file mode 100644 index 325f2d02..00000000 --- a/bin/.local/bin/16.c +++ /dev/null @@ -1,24 +0,0 @@ -#include - -static void aput( char* c, char bg_col, char fg_col ) -{ int bg, fg; - if( bg_col > 7 ) bg = 100 + bg_col-8; - else bg = 40 + bg_col; - if( fg_col > 7 ) fg = 90 + fg_col-8; - else fg = 30 + fg_col; - printf( "\033[%i;%im%s\033[0;0m", fg, bg, c ); -} - -int main( void ) -{ int bg, fg; - - for( fg = 0; fg < 8; fg += 1 ) aput(" ", fg, 0); putchar('\n'); - for( fg = 8; fg < 16; fg += 1 ) aput(" ", fg, 0); putchar('\n'); - putchar('\n'); - for( bg = 0; bg < 16; bg += 1 ) - { for( fg = 0; fg < 16; fg += 1 ) - { aput( "10", bg, fg ); } - putchar('\n'); - } -} - diff --git a/bin/.local/bin/16c b/bin/.local/bin/16c deleted file mode 100755 index 76c10fbd..00000000 Binary files a/bin/.local/bin/16c and /dev/null differ diff --git a/bin/.local/bin/256colors2.pl b/bin/.local/bin/256colors2.pl deleted file mode 100755 index 2a880bdc..00000000 --- a/bin/.local/bin/256colors2.pl +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/perl -# $XTermId: 256colors2.pl,v 1.10 2009/10/10 14:45:26 tom Exp $ -# ----------------------------------------------------------------------------- -# this file is part of xterm -# -# Copyright 1999-2007,2009 by Thomas E. Dickey -# Copyright 2002 by Steve Wall -# Copyright 1999 by Todd Larason -# -# All Rights Reserved -# -# 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the -# sale, use or other dealings in this Software without prior written -# authorization. -# ----------------------------------------------------------------------------- -# -# use the resources for colors 0-15 - usually more-or-less a -# reproduction of the standard ANSI colors, but possibly more -# pleasing shades - -use strict; - -use Getopt::Std; - -our ($opt_h, $opt_q, $opt_r); -&getopts('hqr') || die("Usage: $0 [-q] [-r]"); -die("Usage: $0 [options]\n -Options: - -h display this message - -q quieter output by merging all palette initialization - -r display the reverse of the usual palette -") if ( $opt_h); - -our ($red, $green, $blue); -our ($gray, $level, $color); - -sub map_cube($) { - my $value = $_[0]; - $value = (5 - $value) if defined($opt_r); - return $value; -} - -sub map_gray($) { - my $value = $_[0]; - $value = (23 - $value) if defined($opt_r); - return $value; -} - -printf("\x1b]4") if ($opt_q); -# colors 16-231 are a 6x6x6 color cube -for ($red = 0; $red < 6; $red++) { - for ($green = 0; $green < 6; $green++) { - for ($blue = 0; $blue < 6; $blue++) { - printf("\x1b]4") unless ($opt_q); - printf(";%d;rgb:%2.2x/%2.2x/%2.2x", - 16 + (map_cube($red) * 36) + (map_cube($green) * 6) + map_cube($blue), - ($red ? ($red * 40 + 55) : 0), - ($green ? ($green * 40 + 55) : 0), - ($blue ? ($blue * 40 + 55) : 0)); - printf("\x1b\\") unless ($opt_q); - } - } -} - -# colors 232-255 are a grayscale ramp, intentionally leaving out -# black and white -for ($gray = 0; $gray < 24; $gray++) { - $level = (map_gray($gray) * 10) + 8; - printf("\x1b]4") unless ($opt_q); - printf(";%d;rgb:%2.2x/%2.2x/%2.2x", - 232 + $gray, $level, $level, $level); - printf("\x1b\\") unless ($opt_q); -} -printf("\x1b\\") if ($opt_q); - - -# display the colors - -# first the system ones: -print "System colors:\n"; -for ($color = 0; $color < 8; $color++) { - print "\x1b[48;5;${color}m "; -} -print "\x1b[0m\n"; -for ($color = 8; $color < 16; $color++) { - print "\x1b[48;5;${color}m "; -} -print "\x1b[0m\n\n"; - -# now the color cube -print "Color cube, 6x6x6:\n"; -for ($green = 0; $green < 6; $green++) { - for ($red = 0; $red < 6; $red++) { - for ($blue = 0; $blue < 6; $blue++) { - $color = 16 + ($red * 36) + ($green * 6) + $blue; - print "\x1b[48;5;${color}m "; - } - print "\x1b[0m "; - } - print "\n"; -} - - -# now the grayscale ramp -print "Grayscale ramp:\n"; -for ($color = 232; $color < 256; $color++) { - print "\x1b[48;5;${color}m "; -} -print "\x1b[0m\n"; diff --git a/bin/.local/bin/_emergeworld b/bin/.local/bin/_emergeworld deleted file mode 100644 index b924b086..00000000 --- a/bin/.local/bin/_emergeworld +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -case "$1" in - "start") - date +%s > $HOME/.cache/emergestart && emerge -e --keep-going @world - ;; - "resume") - starttime=$(cat $HOME/.cache/emergestart) - - eix '-I*' --format '' | cut -f1,3 >tmplist - echo $starttime >>tmplist - sort -n tmplist | sed -e/$starttime/q | sed -e'/[0-9]*\t*/s///' | sort | comm -23 - <(sort omitlist) | comm -23 - <(sort /etc/portage/profile/package.provided) >buildlist - rm tmplist - emerge -a `cat buildlist` --keep-going diff --git a/bin/.local/bin/best_makeopts.sh b/bin/.local/bin/best_makeopts.sh deleted file mode 100755 index 865e283f..00000000 --- a/bin/.local/bin/best_makeopts.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -cpupower frequency-set -g performance -r - -PACKAGE="kde-frameworks/plasma" - -DISTDIR="/tmp/" emerge -f ${PACKAGE} - -for i in {1..32} -do - echo 1 > /proc/sys/vm/drop_caches - time DISTDIR="/tmp" EMERGE_DEFAULT_OPTS="" MAKEOPTS="-j${i}" emerge -q1OB ${PACKAGE} - echo -ne "\n\n\n" -done - -cpupower frequency-set -g schedutil -r - diff --git a/bin/.local/bin/colors b/bin/.local/bin/colors deleted file mode 100755 index b6b71325..00000000 --- a/bin/.local/bin/colors +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/bash -set -e - - -mainFunction () { - echo - printColors - printGuidelines -} - - -printColor () { - local color="${1}" - - printf "\033[1;4%sm " "${color}" - printf "\033[0m " - printf "\033[1;3%smSampleText " "${color}" - printf "\033[0;3%smSampleText " "${color}" - printf "\033[0m\n" -} - - -printColors () { - local color - # 0 black - # 1 red - # 2 green - # 3 yellow - # 4 blue - # 5 magenta / orange - # 6 cyan / purple - # 7 white - - for color in 0 7; do - printColor "${color}" - done - echo - - for color in 4 5 6; do - printColor "${color}" - done - echo - - for color in 2 3 1; do - printColor "${color}" - done - echo -} - - -printGuidelines () { - echo "A good palette has:" - echo "- All colors easy to read." - echo "- Similar eye catchiness within the same group, except for monochromes." - echo "- Similar or greater eye catchiness in upper groups, including this text." - echo "- Similar color within the same line." - echo "- The last group as: green yellow red." - echo -} - - -mainFunction diff --git a/bin/.local/bin/colr b/bin/.local/bin/colr deleted file mode 100755 index 90c0b059..00000000 --- a/bin/.local/bin/colr +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash - -case $1 in - 1) - set -e - - - mainFunction () { - echo - printColors - printGuidelines - } - - - printColor () { - local color="${1}" - - printf "\033[1;4%sm " "${color}" - printf "\033[0m " - printf "\033[1;3%smSampleText " "${color}" - printf "\033[0;3%smSampleText " "${color}" - printf "\033[0m\n" - } - - - printColors () { - local color - # 0 black - # 1 red - # 2 green - # 3 yellow - # 4 blue - # 5 magenta / orange - # 6 cyan / purple - # 7 white - - for color in 0 7; do - printColor "${color}" - done - echo - - for color in 4 5 6; do - printColor "${color}" - done - echo - - for color in 2 3 1; do - printColor "${color}" - done - echo - } - - - printGuidelines () { - echo "A good palette has:" - echo "- All colors easy to read." - echo "- Similar eye catchiness within the same group, except for monochromes." - echo "- Similar or greater eye catchiness in upper groups, including this text." - echo "- Similar color within the same line." - echo "- The last group as: green yellow red." - echo - } - - - mainFunction;; - - 2) - echo -e "\033[0mNC (No color)" - echo -e "\033[1;37mWHITE\t\033[0;30mBLACK" - echo -e "\033[0;34mBLUE\t\033[1;34mLIGHT_BLUE" - echo -e "\033[0;32mGREEN\t\033[1;32mLIGHT_GREEN" - echo -e "\033[0;36mCYAN\t\033[1;36mLIGHT_CYAN" - echo -e "\033[0;31mRED\t\033[1;31mLIGHT_RED" - echo -e "\033[0;35mPURPLE\t\033[1;35mLIGHT_PURPLE" - echo -e "\033[0;33mYELLOW\t\033[1;33mLIGHT_YELLOW" - echo -e "\033[1;30mGRAY\t\033[0;37mLIGHT_GRAY";; - 3) - # Description: - # - # Prints a color table of 8bg * 8fg * 2 states (regular/bold) - # - # Copyright: - # - # (C) 2009 Wolfgang Frisch - # - # License: - # - # This program is free software: you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by - # the Free Software Foundation, either version 3 of the License, or - # (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - - echo - echo Table for 16-color terminal escape sequences. - echo Replace ESC with \\033 in bash. - echo - echo "Background | Foreground colors" - echo "---------------------------------------------------------------------" - for((bg=40;bg<=47;bg++)); do - for((bold=0;bold<=1;bold++)) do - echo -en "\033[0m"" ESC[${bg}m | " - for((fg=30;fg<=37;fg++)); do - if [ $bold == "0" ]; then - echo -en "\033[${bg}m\033[${fg}m [${fg}m " - else - echo -en "\033[${bg}m\033[1;${fg}m [1;${fg}m" - fi - done - echo -e "\033[0m" - done - echo "--------------------------------------------------------------------- " - done - - echo - echo;; - 4) - for colour in {1..225} - do echo -en "\033[38;5;${colour}m38;5;${colour} \n" - done | column -x;; - *) - colr 1 - echo "Enter a number [1-4] to specify, which demo to run.";; -esac - diff --git a/bin/.local/bin/deadlib b/bin/.local/bin/deadlib deleted file mode 100755 index 1ccf1884..00000000 --- a/bin/.local/bin/deadlib +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u; - diff --git a/bin/.local/bin/kcr-edit-search b/bin/.local/bin/kcr-edit-search deleted file mode 100755 index c5106494..00000000 --- a/bin/.local/bin/kcr-edit-search +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# Open files from search results. -# -# Usage: -# -# kcr edit-search [input: :::] - -# Execute the following Kakoune commands. -# -# Input: ::: -# Output: ␤␤ -select_each_line='_' -select_search_fields='s^(.+?):(\d+):(\d+):(.+?)$' -save_selections='Z' -select_file_save_and_restore='1s"fZz' -select_line_save_and_restore='2s"faz' -select_column_save_and_restore='3s"faz' -select_data='"fz' -prepare_output='y%a' -delete_end_of_file='ged' - -kak -f "${select_each_line}${select_search_fields}${save_selections}${select_file_save_and_restore}${select_line_save_and_restore}${select_column_save_and_restore}${select_data}${prepare_output}${delete_end_of_file}" | - -while read file; read line; read column; do - kcr edit "$file" "+$line:$column" -done diff --git a/bin/.local/bin/kcr-fzf b/bin/.local/bin/kcr-fzf deleted file mode 100755 index 5af52593..00000000 --- a/bin/.local/bin/kcr-fzf +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -"kcr-fzf-$@" diff --git a/bin/.local/bin/kcr-fzf-buffers b/bin/.local/bin/kcr-fzf-buffers deleted file mode 100755 index 71efdfe6..00000000 --- a/bin/.local/bin/kcr-fzf-buffers +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Open buffers. -# -# Usage: -# -# kcr fzf buffers [patterns] - -# – fzf (https://github.com/junegunn/fzf) -# – bat (https://github.com/sharkdp/bat) - -kcr get --raw --value buflist | -grep -F "$*" | -fzf --preview 'kcr cat --raw {} | bat --file-name {} --style=numbers --color=always --line-range :500' --header='Select a buffer to open' --prompt='(b)>' | - -# Open buffers -while read name; do - kcr send buffer "$name" -done diff --git a/bin/.local/bin/kcr-fzf-files b/bin/.local/bin/kcr-fzf-files deleted file mode 100755 index 3253bb81..00000000 --- a/bin/.local/bin/kcr-fzf-files +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Open files. -# -# Usage: -# -# kcr fzf files [paths] - -# – fzf (https://github.com/junegunn/fzf) -# – fd (https://github.com/sharkdp/fd) -# – bat (https://github.com/sharkdp/bat) - -fd --type file . "$@" | -fzf --preview 'bat --style=numbers --color=always --line-range :500 {}' --header='Select a file to open' --prompt='(f)>' | - -# Open files -while read file; do - kcr edit "$file" -done diff --git a/bin/.local/bin/kcr-fzf-grep b/bin/.local/bin/kcr-fzf-grep deleted file mode 100755 index e3605c85..00000000 --- a/bin/.local/bin/kcr-fzf-grep +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Open files by content. -# -# Usage: -# -# kcr fzf grep [paths] - -# – fzf (https://github.com/junegunn/fzf) -# – ripgrep (https://github.com/BurntSushi/ripgrep) - -# Not pretty but robust. -# https://github.com/junegunn/fzf/issues/2581 -export PATHS_PATH=$(mktemp) -trap 'rm "$PATHS_PATH"' EXIT -for path do - echo "$path" >> "$PATHS_PATH" -done - -SHELL=sh fzf --phony --delimiter ':' --ansi --bind 'change:reload(while read path; do set -- "$@" "$path"; done < "$PATHS_PATH"; rg --color=always --column --with-filename --fixed-strings -- {q} "$@" || true),enter:execute(kcr edit {1} +{2}:{3})+abort' --preview 'highlight_line={2} line_range_begin=$((line = highlight_line - (FZF_PREVIEW_LINES / 4) && line < 1 ? 1 : line)) line_range_end=$((line_range_begin + FZF_PREVIEW_LINES)) && bat --style=numbers --color=always --line-range "$line_range_begin:$line_range_end" --highlight-line {2} {1} 2> /dev/null' --header='Select a file to open' --prompt='(g)>' diff --git a/bin/.local/bin/kcr-fzf-shell b/bin/.local/bin/kcr-fzf-shell deleted file mode 100755 index 33faa3a7..00000000 --- a/bin/.local/bin/kcr-fzf-shell +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# Start an interactive shell. -# -# Usage: -# -# kcr fzf shell [command] [arguments] - -# – fzf (https://github.com/junegunn/fzf) - -set_environment() { - session=$1 client=${2#null} buffer_name=${3#null} working_directory=$4 -} - -# Run fzf with the session list -rows=$( - kcr list --raw | - fzf --header='Select a session to switch to' --prompt='(s)>' -) - -IFS=' -' -for row in $rows; do - IFS=' ' - set_environment $row - - # Start an interactive shell - KAKOUNE_SESSION=$session KAKOUNE_CLIENT=$client kcr shell "$@" -done diff --git a/bin/.local/bin/launch-waybar b/bin/.local/bin/launch-waybar deleted file mode 100755 index 9eee56cf..00000000 --- a/bin/.local/bin/launch-waybar +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -CONFIG_FILES="$HOME/.config/waybar/config $HOME/.config/waybar/style.css" - -trap "killall waybar" EXIT - -while true; do - waybar & - inotifywait -e create,modify $CONFIG_FILES - killall waybar -done - diff --git a/bin/.local/bin/loadcolors.sh b/bin/.local/bin/loadcolors.sh deleted file mode 100755 index 5a4a1dd8..00000000 --- a/bin/.local/bin/loadcolors.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -openrgb -p simple - diff --git a/bin/.local/bin/mkchroot b/bin/.local/bin/mkchroot deleted file mode 100755 index 6a5f0b24..00000000 --- a/bin/.local/bin/mkchroot +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -if [ "$UID" != "0" ] -then - echo "You have to be root" >&2 - exit 1 -fi - -CHROOT=$1 - -if [ ! -f $CHROOT.in ] -then - for mnt in /dev /dev/pts /proc /sys - do - echo "-- Mounting $mnt on $CHROOT/$mnt" - mount -o bind $mnt $CHROOT/$mnt || exit 1 - done - - if [ -f $CHROOT.shared ] - then - cat $CHROOT.shared | while read entry - do - folder=${entry%:*} - mnt=${entry#*:} - - echo "-- Mounting $folder on $CHROOT/$mnt" - mkdir -p $CHROOT/$mnt || exit 1 - mount -o bind $folder $CHROOT/$mnt || exit 1 - done - fi - - echo "1" > $CHROOT.in -else - n=`cat $CHROOT.in` - let n=$n+1 - echo "$n" > $CHROOT.in -fi - -echo "-- Entering chroot" -chroot $CHROOT /usr/bin/env HOME=/root TERM=$TERM /bin/bash --login +h || exit 1; - -n=`cat $CHROOT.in` -let n=$n-1 - -if [ "$n" = "0" ] -then - for umnt in /sys /proc /dev/pts /dev - do - echo "-- Umounting $CHROOT/$umnt" - umount $CHROOT/$umnt || exit 1 - done - - if [ -f $CHROOT.shared ] - then - cat $CHROOT.shared | while read entry - do - mnt=${entry#*:} - - echo "-- Umounting $CHROOT/$mnt" - umount $CHROOT/$mnt || exit 1 - done - fi - - rm $CHROOT.in -else - echo "$n" > $CHROOT.in -fi - diff --git a/bin/.local/bin/rndwallpaper b/bin/.local/bin/rndwallpaper deleted file mode 100755 index 5732edb1..00000000 --- a/bin/.local/bin/rndwallpaper +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -WALLDIR="$HOME/Bilder/Wallpapers" - -# set random wallpaper -case "$1" in - dblquote) - find "$WALLDIR" -type f \( -iname \*jpg -o -iname \*jpeg -o -iname \*png -o -iname \*webp \) | sort -R | tail -n1 | sed 's/^/"/;s/$/"/' - ;; - quote) - find "$WALLDIR" -type f \( -iname \*jpg -o -iname \*jpeg -o -iname \*png -o -iname \*webp \) | sort -R | tail -n1 | sed "s/^/'/;s/$/'/" - ;; - swww) - swww img "$(find "$WALLDIR" -type f \( -iname \*jpg -o -iname \*jpeg -o -iname \*png -o -iname \*webp \) | sort -R | tail -n1)" - ;; - *) - find "$WALLDIR" -type f \( -iname \*jpg -o -iname \*jpeg -o -iname \*png -o -iname \*webp \) | sort -R | tail -n1 - ;; -esac - diff --git a/bin/.local/bin/rofi b/bin/.local/bin/rofi deleted file mode 120000 index 02538382..00000000 --- a/bin/.local/bin/rofi +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/wofi \ No newline at end of file diff --git a/bin/.local/bin/songinfo b/bin/.local/bin/songinfo deleted file mode 100755 index d6d20479..00000000 --- a/bin/.local/bin/songinfo +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -music_dir="/mnt/multimedia/Musik" -previewdir="$HOME/.config/ncmpcpp/previews" -filename="$(mpc --format "$music_dir"/%file% current)" -previewname="$previewdir/$(mpc --format %album% current | base64).png" - -[ -e "$previewname" ] || ffmpeg -y -i "$filename" -an -vf scale=128:128 "$previewname" > /dev/null 2>&1 - -notify-send -r 27072 "Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" -i "$previewname" diff --git a/bin/.local/bin/tasks_redirect.sh b/bin/.local/bin/tasks_redirect.sh deleted file mode 100755 index 904b071f..00000000 --- a/bin/.local/bin/tasks_redirect.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -echo "mounting the cpuset filesystem" -if ! [ -d /dev/cpuset ]; then - mkdir /dev/cpuset - mount -t cpuset cpuset /dev/cpuset -fi - -_prefix="" - -if [ -f /dev/cpuset/cpuset.cpus ];then - _prefix="cpuset." -fi - -if ! [ -d /dev/cpuset/theUgly ]; then - echo "Creating theUgly" - mkdir /dev/cpuset/theUgly -fi - -echo "Assigning CCX0's cores to the ugly cpu set" -/bin/echo 8-15,24-31 > /dev/cpuset/theUgly/${_prefix}cpus - -echo "Giving the Ugly memory node 0" -/bin/echo 0 > /dev/cpuset/theUgly/${_prefix}mems - -echo "Making the Ugly cpu exlusive" -/bin/echo 1 > /dev/cpuset/theUgly/${_prefix}cpu_exclusive - -echo "Redirecting Processes" -while read p; do - echo "Redirecting PID $p" - /bin/echo $p > /dev/cpuset/theUgly/tasks -done < /dev/cpuset/tasks - -if ! [ -d /dev/cpuset/theGood ]; then - echo "Creating theGood" - mkdir /dev/cpuset/theGood -fi - -echo "Assigning CCX1's cores to the Good cpu set" -/bin/echo 0-7,16-23 > /dev/cpuset/theGood/${_prefix}cpus - -echo "Giving the Good memory node 0" -/bin/echo 0 > /dev/cpuset/theGood/${_prefix}mems - -echo "Making the Good cpu exlusive" -/bin/echo 1 > /dev/cpuset/theGood/${_prefix}cpu_exclusive - -read -p "Redirect Lutris to theGood ? y/n: " -if [ "$REPLY" = "y" ];then - echo "Redirecting Lutris to theGood" - for i in `pgrep lutris`; do echo $i > /dev/cpuset/theGood/tasks; done -fi - - -read -p "Redirect Steam to theGood ? y/n: " -if [ "$REPLY" = "y" ];then - echo "Redirecting Lutris to theGood" - for i in `pgrep steam`; do echo $i > /dev/cpuset/theGood/tasks; done -fi diff --git a/bin/.local/bin/winecleaner b/bin/.local/bin/winecleaner deleted file mode 100755 index 3a28176c..00000000 --- a/bin/.local/bin/winecleaner +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -function yes_or_no { - while true; do - read -rp "$* [y/n]: " yn - case $yn in - [Yy]*) return 0 ;; - [Nn]*) echo "Aborted" ; return 1 ;; - esac - done -} - -PSOUTPUT="$(pgrep -l exe)" - -echo "Grepping ps for wine executables..." -if [ -n "$PSOUTPUT" ]; then - echo "The following processes have been found:" - echo "$PSOUTPUT" - yes_or_no "Would you like to send sigkill to all processes?" && pgrep exe | xargs kill - echo "Verifying that all processes have been cleaned..." - sleep 7 - PSOUTPUT="$(pgrep -l exe)" - if [ -n "$PSOUTPUT" ]; then - echo "Still some processes around. Please remove them manually..." - echo "$PSOUTPUT" - else - echo "All processes have been cleaned!" - fi -else - echo "No wine executables found" -fi diff --git a/cava/.config/cava/config b/cava/.config/cava/config deleted file mode 100644 index 21cf8216..00000000 --- a/cava/.config/cava/config +++ /dev/null @@ -1,198 +0,0 @@ -## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting. - - -[general] - -# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 -; mode = normal - -# Accepts only non-negative values. -; framerate = 60 - -# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off -# new as of 0.6.0 autosens of low values (dynamic range) -# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 -; autosens = 1 -; overshoot = 20 - -# Manual sensitivity in %. If autosens is enabled, this will only be the initial value. -# 200 means double height. Accepts only non-negative values. -; sensitivity = 100 - -# The number of bars (0-200). 0 sets it to auto (fill up console). -# Bars' width and space between bars in number of characters. -; bars = 0 -bar_width = 6 -bar_spacing = 1 -# bar_height is only used for output in "noritake" format -; bar_height = 32 - -# For SDL width and space between bars is in pixels, defaults are: -; bar_width = 20 -; bar_spacing = 5 - - -# Lower and higher cutoff frequencies for lowest and highest bars -# the bandwidth of the visualizer. -# Note: there is a minimum total bandwidth of 43Mhz x number of bars. -# Cava will automatically increase the higher cutoff if a too low band is specified. -; lower_cutoff_freq = 50 -; higher_cutoff_freq = 10000 - - -# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and -# only check for input once per second. Cava will wake up once input is detected. 0 = disable. -; sleep_timer = 0 - - -[input] - -# Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' -# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. -# -# All input methods uses the same config variable 'source' -# to define where it should get the audio. -# -# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink -# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). -# -# For alsa 'source' will be the capture device. -# For fifo 'source' will be the path to fifo-file. -# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address -; method = pulse -; source = auto - -; method = alsa -; source = hw:Loopback,1 - -; method = fifo -; source = /tmp/mpd.fifo -; sample_rate = 44100 -; sample_bits = 16 - -; method = shmem -; source = /squeezelite-AA:BB:CC:DD:EE:FF - -; method = portaudio -; source = auto - - -[output] - -# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake' or 'sdl'. -# 'noncurses' uses a custom framebuffer technique and prints only changes -# from frame to frame in the terminal. 'ncurses' is default if supported. -# -# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data -# stream of the bar heights that can be used to send to other applications. -# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above. -# -# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display -# in graphic mode. It only support the 3000 series graphical VFDs for now. -# -# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context. -; method = ncurses - -# Visual channels. Can be 'stereo' or 'mono'. -# 'stereo' mirrors both channels with low frequencies in center. -# 'mono' outputs left to right lowest to highest frequencies. -# 'mono_option' set mono to either take input from 'left', 'right' or 'average'. -# set 'reverse' to 1 to display frequencies the other way around. -; channels = stereo -channels = mono -; mono_option = average -; reverse = 0 - -# Raw output target. A fifo will be created if target does not exist. -; raw_target = /dev/stdout - -# Raw data format. Can be 'binary' or 'ascii'. -; data_format = binary - -# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530). -; bit_format = 16bit - -# Ascii max value. In 'ascii' mode range will run from 0 to value specified here -; ascii_max_range = 1000 - -# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters. -# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)). -; bar_delimiter = 59 -; frame_delimiter = 10 - -# sdl window size and position. -1,-1 is centered. -; sdl_width = 1000 -; sdl_height = 500 -; sdl_x = -1 -; sdl_y= -1 - -[color] - -# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow. -# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires -# ncurses output method and a terminal that can change color definitions such as Gnome-terminal or rxvt. -# if supported, ncurses mode will be forced on if user defined colors are used. -# default is to keep current terminal color -; background = default -; foreground = default - -# SDL only support hex code colors, these are the default: -; background = '#111111' -; foreground = '#33cccc' - - -# Gradient mode, only hex defined colors (and thereby ncurses mode) are supported, -# background must also be defined in hex or remain commented out. 1 = on, 0 = off. -# You can define as many as 8 different colors. They range from bottom to top of screen -; gradient = 0 -; gradient_count = 8 -; gradient_color_1 = '#59cc33' -; gradient_color_2 = '#80cc33' -; gradient_color_3 = '#a6cc33' -; gradient_color_4 = '#cccc33' -; gradient_color_5 = '#cca633' -; gradient_color_6 = '#cc8033' -; gradient_color_7 = '#cc5933' -; gradient_color_8 = '#cc3333' - - - -[smoothing] - -# Percentage value for integral smoothing. Takes values from 0 - 100. -# Higher values means smoother, but less precise. 0 to disable. -# DEPRECATED as of 0.8.0, use noise_reduction instead -; integral = 77 - -# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. -; monstercat = 0 -; waves = 0 - -# Set gravity percentage for "drop off". Higher values means bars will drop faster. -# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". -# DEPRECATED as of 0.8.0, use noise_reduction instead -; gravity = 100 - - -# In bar height, bars that would have been lower that this will not be drawn. -# DEPRECATED as of 0.8.0 -; ignore = 0 - -# Noise reduction, float 0 - 1. default 0.77 -# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth -# 1 will be very slow and smooth, 0 will be fast but noisy. -; noise_reduction = 0.77 - - -[eq] - -# This one is tricky. You can have as much keys as you want. -# Remember to uncomment more then one key! More keys = more precision. -# Look at readme.md on github for further explanations and examples. -# DEPRECATED as of 0.8.0 can be brought back by popular request, open issue at: -# https://github.com/karlstav/cava -1 = 1.2 # bass -2 = 1 -3 = 1 # midtone -4 = 1 -5 = 1.2 # treble diff --git a/cava/.config/cava/shaders/bar_spectrum.frag b/cava/.config/cava/shaders/bar_spectrum.frag deleted file mode 100644 index b0789132..00000000 --- a/cava/.config/cava/shaders/bar_spectrum.frag +++ /dev/null @@ -1,79 +0,0 @@ -#version 330 - -in vec2 fragCoord; -out vec4 fragColor; - -// bar values. defaults to left channels first (low to high), then right (high to low). -uniform float bars[512]; - -uniform int bars_count; // number of bars (left + right) (configurable) -uniform int bar_width; // bar width (configurable), not used here -uniform int bar_spacing; // space bewteen bars (configurable) - -uniform vec3 u_resolution; // window resolution - -//colors, configurable in cava config file (r,g,b) (0.0 - 1.0) -uniform vec3 bg_color; // background color -uniform vec3 fg_color; // foreground color - -uniform int gradient_count; -uniform vec3 gradient_colors[8]; // gradient colors - -vec3 normalize_C(float y,vec3 col_1, vec3 col_2, float y_min, float y_max) -{ - //create color based on fraction of this color and next color - float yr = (y - y_min) / (y_max - y_min); - return col_1 * (1.0 - yr) + col_2 * yr; -} - -void main() -{ - // find which bar to use based on where we are on the x axis - float x = u_resolution.x * fragCoord.x; - int bar = int(bars_count * fragCoord.x); - - //calculate a bar size - float bar_size = u_resolution.x / bars_count; - - //the y coordinate and bar values are the same - float y = bars[bar]; - - // make sure there is a thin line at bottom - if (y * u_resolution.y < 1.0) - { - y = 1.0 / u_resolution.y; - } - - //draw the bar up to current height - if (y > fragCoord.y) - { - //make some space between bars basen on settings - if (x > (bar + 1) * (bar_size) - bar_spacing) - { - fragColor = vec4(bg_color,1.0); - } - else - { - if (gradient_count == 0) - { - fragColor = vec4(fg_color,1.0); - } - else - { - //find which color in the configured gradient we are at - int color = int((gradient_count - 1) * fragCoord.y); - - //find where on y this and next color is supposed to be - float y_min = color / (gradient_count - 1.0); - float y_max = (color + 1.0) / (gradient_count - 1.0); - - //make color - fragColor = vec4(normalize_C(fragCoord.y, gradient_colors[color], gradient_colors[color + 1], y_min, y_max), 1.0); - } - } - } - else - { - fragColor = vec4(bg_color,1.0); - } -} \ No newline at end of file diff --git a/cava/.config/cava/shaders/northern_lights.frag b/cava/.config/cava/shaders/northern_lights.frag deleted file mode 100644 index ecd859a7..00000000 --- a/cava/.config/cava/shaders/northern_lights.frag +++ /dev/null @@ -1,34 +0,0 @@ -#version 330 - -in vec2 fragCoord; -out vec4 fragColor; - -// bar values. defaults to left channels first (low to high), then right (high to low). -uniform float bars[512]; - -uniform int bars_count; // number of bars (left + right) (configurable) - -uniform vec3 u_resolution; // window resolution, not used here - -//colors, configurable in cava config file -uniform vec3 bg_color; // background color(r,g,b) (0.0 - 1.0), not used here -uniform vec3 fg_color; // foreground color, not used here - -void main() -{ - // find which bar to use based on where we are on the x axis - int bar = int(bars_count * fragCoord.x); - - float bar_y = 1.0 - abs((fragCoord.y - 0.5)) * 2.0; - float y = (bars[bar]) * bar_y; - - float bar_x = (fragCoord.x - float(bar) / float(bars_count)) * bars_count; - float bar_r = 1.0 - abs((bar_x - 0.5)) * 2; - - bar_r = bar_r * bar_r * 2; - - // set color - fragColor.r = fg_color.x * y * bar_r; - fragColor.g = fg_color.y * y * bar_r; - fragColor.b = fg_color.z * y * bar_r; -} diff --git a/cava/.config/cava/shaders/pass_through.vert b/cava/.config/cava/shaders/pass_through.vert deleted file mode 100644 index a4f20e52..00000000 --- a/cava/.config/cava/shaders/pass_through.vert +++ /dev/null @@ -1,14 +0,0 @@ -#version 330 - - -// Input vertex data, different for all executions of this shader. -layout(location = 0) in vec3 vertexPosition_modelspace; - -// Output data ; will be interpolated for each fragment. -out vec2 fragCoord; - -void main() -{ - gl_Position = vec4(vertexPosition_modelspace,1); - fragCoord = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; -} diff --git a/config/OpenRGB/Normal.orp b/config/OpenRGB/Normal.orp new file mode 100644 index 00000000..f8b208c2 Binary files /dev/null and b/config/OpenRGB/Normal.orp differ diff --git a/config/OpenRGB/plugins/settings/gradients/my-gradient1 b/config/OpenRGB/plugins/settings/gradients/my-gradient1 new file mode 100644 index 00000000..6c63396e --- /dev/null +++ b/config/OpenRGB/plugins/settings/gradients/my-gradient1 @@ -0,0 +1,25 @@ +{ + "colors": [ + { + "color": "#231557", + "position": 0.0 + }, + { + "color": "#44107a", + "position": 0.2800000011920929 + }, + { + "color": "#ff1361", + "position": 0.6700000166893005 + }, + { + "color": "#fff800", + "position": 1.0 + } + ], + "rotate": 225, + "spread": "Pad", + "type": "Conical", + "x_offset": 86, + "y_offset": 36 +} \ No newline at end of file diff --git a/config/OpenRGB/plugins/settings/virtual-controllers/Normal b/config/OpenRGB/plugins/settings/virtual-controllers/Normal new file mode 100644 index 00000000..aebdc9cc --- /dev/null +++ b/config/OpenRGB/plugins/settings/virtual-controllers/Normal @@ -0,0 +1,403 @@ +{ + "ctrl_zones": [ + { + "controller": { + "location": "I2C: /dev/i2c-10, address 0x71", + "name": "ENE DRAM", + "serial": "", + "vendor": "ENE" + }, + "custom_zone_name": "RAM1", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 1, + "x": 13, + "y": 38 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "I2C: /dev/i2c-10, address 0x73", + "name": "ENE DRAM", + "serial": "", + "vendor": "ENE" + }, + "custom_zone_name": "RAM2", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 1, + "x": 15, + "y": 38 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "I2C: /dev/i2c-10, address 0x72", + "name": "ENE DRAM", + "serial": "", + "vendor": "ENE" + }, + "custom_zone_name": "RAM4", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 1, + "x": 19, + "y": 38 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "HID: /dev/hidraw5", + "name": "Razer Chroma Addressable RGB Controller", + "serial": "IO2117U08301116 ", + "vendor": "Razer" + }, + "custom_zone_name": "Front Dual LED Strips", + "settings": { + "custom_shape": null, + "led_spacing": 2, + "reverse": true, + "shape": 1, + "x": 62, + "y": 3 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "HID: /dev/hidraw4", + "name": "Razer Mouse Bungee V3 Chroma", + "serial": "382112U07902334 ", + "vendor": "Razer" + }, + "custom_zone_name": "", + "settings": { + "custom_shape": { + "h": 9, + "led_positions": [ + { + "led_num": 0, + "x": 8, + "y": 3 + }, + { + "led_num": 1, + "x": 7, + "y": 5 + }, + { + "led_num": 2, + "x": 4, + "y": 6 + }, + { + "led_num": 3, + "x": 1, + "y": 5 + }, + { + "led_num": 4, + "x": 0, + "y": 3 + }, + { + "led_num": 5, + "x": 1, + "y": 1 + }, + { + "led_num": 6, + "x": 4, + "y": 0 + }, + { + "led_num": 7, + "x": 7, + "y": 1 + } + ], + "w": 9 + }, + "led_spacing": 1, + "reverse": false, + "shape": 2, + "x": 31, + "y": 8 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "HID: /dev/hidraw12", + "name": "ASUS ROG CROSSHAIR VIII DARK HERO", + "serial": "9876543210", + "vendor": "ASUS" + }, + "custom_zone_name": "", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 1, + "x": 54, + "y": 36 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "HID: /dev/hidraw13", + "name": "Razer Strider Chroma", + "serial": "ST2252V14800417 ", + "vendor": "Razer" + }, + "custom_zone_name": "", + "settings": { + "custom_shape": { + "h": 4, + "led_positions": [ + { + "led_num": 0, + "x": 0, + "y": 0 + }, + { + "led_num": 1, + "x": 1, + "y": 0 + }, + { + "led_num": 2, + "x": 2, + "y": 0 + }, + { + "led_num": 3, + "x": 3, + "y": 0 + }, + { + "led_num": 4, + "x": 4, + "y": 0 + }, + { + "led_num": 5, + "x": 5, + "y": 0 + }, + { + "led_num": 6, + "x": 6, + "y": 0 + }, + { + "led_num": 7, + "x": 7, + "y": 0 + }, + { + "led_num": 8, + "x": 7, + "y": 1 + }, + { + "led_num": 9, + "x": 7, + "y": 2 + }, + { + "led_num": 10, + "x": 7, + "y": 3 + }, + { + "led_num": 11, + "x": 5, + "y": 3 + }, + { + "led_num": 12, + "x": 4, + "y": 3 + }, + { + "led_num": 13, + "x": 3, + "y": 3 + }, + { + "led_num": 14, + "x": 2, + "y": 3 + }, + { + "led_num": 15, + "x": 1, + "y": 3 + }, + { + "led_num": 16, + "x": 0, + "y": 3 + }, + { + "led_num": 17, + "x": 0, + "y": 2 + }, + { + "led_num": 18, + "x": 6, + "y": 3 + } + ], + "w": 8 + }, + "led_spacing": 1, + "reverse": false, + "shape": 2, + "x": 13, + "y": 10 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "HID: /dev/hidraw19", + "name": "Razer Base Station V2 Chroma", + "serial": "382151U07800321 ", + "vendor": "Razer" + }, + "custom_zone_name": "", + "settings": { + "custom_shape": { + "h": 9, + "led_positions": [ + { + "led_num": 0, + "x": 10, + "y": 4 + }, + { + "led_num": 1, + "x": 8, + "y": 7 + }, + { + "led_num": 2, + "x": 5, + "y": 8 + }, + { + "led_num": 3, + "x": 2, + "y": 7 + }, + { + "led_num": 4, + "x": 0, + "y": 4 + }, + { + "led_num": 5, + "x": 2, + "y": 1 + }, + { + "led_num": 6, + "x": 5, + "y": 0 + }, + { + "led_num": 7, + "x": 8, + "y": 1 + } + ], + "w": 11 + }, + "led_spacing": 1, + "reverse": false, + "shape": 2, + "x": 47, + "y": 6 + }, + "zone_idx": 0 + }, + { + "controller": { + "location": "HID: /dev/hidraw12", + "name": "ASUS ROG CROSSHAIR VIII DARK HERO", + "serial": "9876543210", + "vendor": "ASUS" + }, + "custom_zone_name": "", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 0, + "x": 0, + "y": 0 + }, + "zone_idx": 1 + }, + { + "controller": { + "location": "HID: /dev/hidraw5", + "name": "Razer Chroma Addressable RGB Controller", + "serial": "IO2117U08301116 ", + "vendor": "Razer" + }, + "custom_zone_name": "", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 0, + "x": 31, + "y": 47 + }, + "zone_idx": 2 + }, + { + "controller": { + "location": "I2C: /dev/i2c-10, address 0x70", + "name": "ENE DRAM", + "serial": "", + "vendor": "ENE" + }, + "custom_zone_name": "RAM3", + "settings": { + "custom_shape": null, + "led_spacing": 1, + "reverse": false, + "shape": 1, + "x": 17, + "y": 38 + }, + "zone_idx": 0 + } + ], + "grid_settings": { + "auto_load": true, + "auto_register": true, + "grid_size": 1, + "h": 64, + "live_preview": true, + "show_bounds": true, + "show_grid": true, + "unregister_members": false, + "w": 64 + } +} \ No newline at end of file diff --git a/config/OpenRGB/simple.orp b/config/OpenRGB/simple.orp new file mode 100644 index 00000000..e328c909 Binary files /dev/null and b/config/OpenRGB/simple.orp differ diff --git a/config/OpenRGB/sizes.ors b/config/OpenRGB/sizes.ors new file mode 100644 index 00000000..da864121 Binary files /dev/null and b/config/OpenRGB/sizes.ors differ diff --git a/config/aerc/aerc.conf b/config/aerc/aerc.conf new file mode 100644 index 00000000..69f40259 --- /dev/null +++ b/config/aerc/aerc.conf @@ -0,0 +1,340 @@ +# +# aerc main configuration + +[general] +# +# If set to "gpg", aerc will use system gpg binary and keystore for all crypto +# operations. Otherwise, the internal openpgp implementation will be used. +# +# Default: internal +pgp-provider=internal + +# By default, the file permissions of accounts.conf must be restrictive and +# only allow reading by the file owner (0600). Set this option to true to +# ignore this permission check. Use this with care as it may expose your +# credentials. +# +# Default: false +unsafe-accounts-conf=false + +[ui] +index-columns = date<20,name<17,flags>4,subject<* +column-subject = {{.ThreadPrefix}}{{.Subject}} +column-date = {{.DateAutoFormat .Date.Local}} +column-name = {{index (.From | names) 0}} +column-flags = {{.Flags | join ""}} + +dirlist-left = {{.Folder}} +dirlist-right = {{if .Unread}}{{humanReadable .Unread}}/{{end}}{{if .Exists}}{{humanReadable .Exists}}{{end}} + +# +# See time.Time#Format at https://godoc.org/time#Time.Format +# +# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) +timestamp-format=2006-01-02 03:04 PM + +# +# Index-only time format for messages that were received/sent today. +# If this is not specified, timestamp-format is used instead. +# +# Default: "03:04 PM" (12 hour time) +this-day-time-format=03:04 PM + +# +# Index-only time format for messages that were received/sent within the last +# 7 days. If this is not specified, timestamp-format is used instead. +# +# Default: "Monday 03:04 PM" (Week day + 12 hour time) +this-week-time-format=Monday 03:04 PM + +# +# Index-only time format for messages that were received/sent this year. +# If this is not specified, timestamp-format is used instead. +# +# Default: "January 02" (Month + month day) +this-year-time-format=January 02 + +# +# Width of the sidebar, including the border. +# +# Default: 20 +sidebar-width=28 + +# +# Message to display when viewing an empty folder. +# +# Default: (no messages) +empty-message=(no messages) + +# Message to display when no folders exists or are all filtered +# +# Default: (no folders) +empty-dirlist=(no folders) + +# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel +# +# Default: false +mouse-enabled=false + +# +# Ring the bell when new messages are received +# +# Default: true +new-message-bell=true + +# Marker to show before a pinned tab's name. +# +# Default: ` +pinned-tab-marker='`' + +# Delay after which the messages are actually listed when entering a directory. +# This avoids loading messages when skipping over folders and makes the UI more +# responsive. If you do not want that, set it to 0s. +# +# Default: 200ms +dirlist-delay=200ms + +# Display the directory list as a foldable tree that allows to collapse and +# expand the folders. +# +# Default: false +dirlist-tree=false + +# If dirlist-tree is enabled, set level at which folders are collapsed by +# default. Set to 0 to disable. +# +# Default: 0 +dirlist-collapse=0 + +# List of space-separated criteria to sort the messages by, see *sort* +# command in *aerc*(1) for reference. Prefixing a criterion with "-r " +# reverses that criterion. +# +# Example: "from -r date" +# +# Default: "" +sort= + +# Moves to next message when the current message is deleted +# +# Default: true +next-message-on-delete=true + +# The directories where the stylesets are stored. It takes a colon-separated +# list of directories. If this is unset or if a styleset cannot be found, the +# following paths will be used as a fallback in that order: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/stylesets +# ${XDG_DATA_HOME:-~/.local/share}/aerc/stylesets +# /usr/local/share/aerc/stylesets +# /usr/share/aerc/stylesets +# +# default: "" +stylesets-dirs= + +# Uncomment to use box-drawing characters for vertical and horizontal borders. +# +# Default: spaces +# border-char-vertical=│ +# border-char-horizontal=─ + +# Sets the styleset to use for the aerc ui elements. +# +# Default: default +styleset-name=default + +# Activates fuzzy search in commands and their arguments: the typed string is +# searched in the command or option in any position, and need not be +# consecutive characters in the command or option. +#fuzzy-complete=false + +# How long to wait after the last input before auto-completion is triggered. +# +# Default: 250ms +completion-delay=250ms + +# +# Global switch for completion popovers +# +# Default: true +completion-popovers=true + +# Uncomment to use UTF-8 symbols to indicate PGP status of messages +# +# Default: ASCII +#icon-unencrypted= +#icon-encrypted=✔ +#icon-signed=✔ +#icon-signed-encrypted=✔ +#icon-unknown=✘ +#icon-invalid=⚠ + +#[ui:account=foo] +# +# Enable a threaded view of messages. If this is not supported by the backend +# (IMAP server or notmuch), threads will be built by the client. +# +# Default: false +#threading-enabled=false + +# Force client-side thread building +# +# Default: false +#force-client-threads=false + +# Debounce client-side thread building +# +# Default: 50ms +#client-threads-delay=50ms + +[statusline] +status-columns = left<*,right>* +column-left = [{{.Account}}] {{.StatusInfo}} +column-right = {{.TrayInfo}} + +# Specifies the separator between grouped statusline elements. +# +# Default: " | " +# separator= + +# Defines the mode for displaying the status elements. +# Options: text, icon +# +# Default: text +# display-mode= + +[viewer] +# +# Specifies the pager to use when displaying emails. Note that some filters +# may add ANSI codes to add color to rendered emails, so you may want to use a +# pager which supports ANSI codes. +# +# Default: less -R +pager=less -R + +# +# If an email offers several versions (multipart), you can configure which +# mimetype to prefer. For example, this can be used to prefer plaintext over +# html emails. +# +# Default: text/plain,text/html +alternatives=text/plain,text/html + +# +# Default setting to determine whether to show full headers or only parsed +# ones in message viewer. +# +# Default: false +show-headers=false + +# +# Layout of headers when viewing a message. To display multiple headers in the +# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if +# none of their specified headers are present in the message. +# +# Default: From|To,Cc|Bcc,Date,Subject +header-layout=From|To,Cc|Bcc,Date,Subject + +# Whether to always show the mimetype of an email, even when it is just a single part +# +# Default: false +always-show-mime=false + +# Parses and extracts http links when viewing a message. Links can then be +# accessed with the open-link command. +# +# Default: true +parse-http-links=true + +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +editor= + +# +# Default header fields to display when composing a message. To display +# multiple headers in the same row, separate them with a pipe, e.g. "To|From". +# +# Default: To|From,Subject +header-layout=To|From,Subject + +# +# Specifies the command to be used to tab-complete email addresses. Any +# occurrence of "%s" in the address-book-cmd will be replaced with what the +# user has typed so far. +# +# The command must output the completions to standard output, one completion +# per line. Each line must be tab-delimited, with an email address occurring as +# the first field. Only the email address field is required. The second field, +# if present, will be treated as the contact name. Additional fields are +# ignored. +# +# This parameter can also be set per account in accounts.conf. +address-book-cmd= + +# +# Allow to address yourself when replying +# +# Default: true +reply-to-self=true + +[filters] +# +# Filters allow you to pipe an email body through a shell command to render +# certain emails differently, e.g. highlighting them with ANSI escape codes. +# +# The first filter which matches the email's mimetype will be used, so order +# them from most to least specific. +# +# You can also match on non-mimetypes, by prefixing with the header to match +# against (non-case-sensitive) and a comma, e.g. subject,text will match a +# subject which contains "text". Use header,~regex to match against a regex. +#subject,~^\[PATCH=colordiff +text/plain=sed 's/^>\+.*/\x1b[36m&\x1b[0m/' +#text/html=pandoc -f html -t plain +#text/html=w3m -dump -I UTF-8 -T text/html +#image/*=catimg -w $(tput cols) - + +[triggers] +# +# Triggers specify commands to execute when certain events occur. +# +# Example: +# new-email=exec notify-send "New email from %n" "%s" + +# +# Executed when a new email arrives in the selected folder +new-email= + +[templates] +# Templates are used to populate email bodies automatically. +# + +# The directories where the templates are stored. It takes a colon-separated +# list of directories. If this is unset or if a template cannot be found, the +# following paths will be used as a fallback in that order: +# +# ${XDG_CONFIG_HOME:-~/.config}/aerc/templates +# ${XDG_DATA_HOME:-~/.local/share}/aerc/templates +# /usr/local/share/aerc/templates +# /usr/share/aerc/templates +# +# default: "" +template-dirs= + +# The default template to be used for new messages. +# +# default: new_message +new-message=new_message + +# The default template to be used for quoted replies. +# +# default: quoted_reply +quoted-reply=quoted_reply + +# The default template to be used for forward as body. +# +# default: forward_as_body +forwards=forward_as_body diff --git a/config/aerc/binds.conf b/config/aerc/binds.conf new file mode 100644 index 00000000..cb5ffd3d --- /dev/null +++ b/config/aerc/binds.conf @@ -0,0 +1,122 @@ +# Binds are of the form = +# To use '=' in a key sequence, substitute it with "Eq": "" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit + = :prev-tab + = :next-tab + = :term +? = :help keys + +[messages] +q = :quit + +j = :next + = :next + = :next 50% + = :next 100% + = :next 100% + +k = :prev + = :prev + = :prev 50% + = :prev 100% + = :prev 100% +g = :select 0 +G = :select -1 + +J = :next-folder +K = :prev-folder +H = :collapse-folder +L = :expand-folder + +v = :mark -t +V = :mark -v + +T = :toggle-threads + + = :view +d = :prompt 'Really delete this message?' 'delete-message' +D = :delete +A = :archive flat + +C = :compose + +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q + +c = :cf +$ = :term +! = :term +| = :pipe + +/ = :search +\ = :filter +n = :next-result +N = :prev-result + = :clear + +[messages:folder=Drafts] + = :recall + +[view] +/ = :toggle-key-passthrough/ +q = :close +O = :open +S = :save +| = :pipe +D = :delete +A = :archive flat + + = :open-link + +f = :forward +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q + +H = :toggle-headers + = :prev-part + = :next-part +J = :next +K = :prev + +[view::passthrough] +$noinherit = true +$ex = + = :toggle-key-passthrough + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose +# view +$ex = + = :prev-field + = :next-field + = :next-field + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = + = :prev-field + = :next-field + = :prev-tab + = :next-tab + +[compose::review] +# Keybindings used when reviewing a message to be sent +y = :send +n = :abort +p = :postpone +q = :choose -o d discard abort -o p postpone postpone +e = :edit +a = :attach +d = :detach + +[terminal] +$noinherit = true +$ex = + + = :prev-tab + = :next-tab diff --git a/config/aerc/scripts/wait-for-creds.sh b/config/aerc/scripts/wait-for-creds.sh new file mode 100755 index 00000000..7ab4f102 --- /dev/null +++ b/config/aerc/scripts/wait-for-creds.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +secret-tool lookup "$1" "$2" +# wait until the password is available +while [ $? != 0 ]; do + secret-tool lookup "$1" "$2" +done + diff --git a/config/cava/config b/config/cava/config new file mode 100644 index 00000000..21cf8216 --- /dev/null +++ b/config/cava/config @@ -0,0 +1,198 @@ +## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting. + + +[general] + +# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 +; mode = normal + +# Accepts only non-negative values. +; framerate = 60 + +# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off +# new as of 0.6.0 autosens of low values (dynamic range) +# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 +; autosens = 1 +; overshoot = 20 + +# Manual sensitivity in %. If autosens is enabled, this will only be the initial value. +# 200 means double height. Accepts only non-negative values. +; sensitivity = 100 + +# The number of bars (0-200). 0 sets it to auto (fill up console). +# Bars' width and space between bars in number of characters. +; bars = 0 +bar_width = 6 +bar_spacing = 1 +# bar_height is only used for output in "noritake" format +; bar_height = 32 + +# For SDL width and space between bars is in pixels, defaults are: +; bar_width = 20 +; bar_spacing = 5 + + +# Lower and higher cutoff frequencies for lowest and highest bars +# the bandwidth of the visualizer. +# Note: there is a minimum total bandwidth of 43Mhz x number of bars. +# Cava will automatically increase the higher cutoff if a too low band is specified. +; lower_cutoff_freq = 50 +; higher_cutoff_freq = 10000 + + +# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and +# only check for input once per second. Cava will wake up once input is detected. 0 = disable. +; sleep_timer = 0 + + +[input] + +# Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' +# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. +# +# All input methods uses the same config variable 'source' +# to define where it should get the audio. +# +# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink +# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). +# +# For alsa 'source' will be the capture device. +# For fifo 'source' will be the path to fifo-file. +# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address +; method = pulse +; source = auto + +; method = alsa +; source = hw:Loopback,1 + +; method = fifo +; source = /tmp/mpd.fifo +; sample_rate = 44100 +; sample_bits = 16 + +; method = shmem +; source = /squeezelite-AA:BB:CC:DD:EE:FF + +; method = portaudio +; source = auto + + +[output] + +# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake' or 'sdl'. +# 'noncurses' uses a custom framebuffer technique and prints only changes +# from frame to frame in the terminal. 'ncurses' is default if supported. +# +# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data +# stream of the bar heights that can be used to send to other applications. +# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above. +# +# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display +# in graphic mode. It only support the 3000 series graphical VFDs for now. +# +# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context. +; method = ncurses + +# Visual channels. Can be 'stereo' or 'mono'. +# 'stereo' mirrors both channels with low frequencies in center. +# 'mono' outputs left to right lowest to highest frequencies. +# 'mono_option' set mono to either take input from 'left', 'right' or 'average'. +# set 'reverse' to 1 to display frequencies the other way around. +; channels = stereo +channels = mono +; mono_option = average +; reverse = 0 + +# Raw output target. A fifo will be created if target does not exist. +; raw_target = /dev/stdout + +# Raw data format. Can be 'binary' or 'ascii'. +; data_format = binary + +# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530). +; bit_format = 16bit + +# Ascii max value. In 'ascii' mode range will run from 0 to value specified here +; ascii_max_range = 1000 + +# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters. +# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)). +; bar_delimiter = 59 +; frame_delimiter = 10 + +# sdl window size and position. -1,-1 is centered. +; sdl_width = 1000 +; sdl_height = 500 +; sdl_x = -1 +; sdl_y= -1 + +[color] + +# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow. +# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires +# ncurses output method and a terminal that can change color definitions such as Gnome-terminal or rxvt. +# if supported, ncurses mode will be forced on if user defined colors are used. +# default is to keep current terminal color +; background = default +; foreground = default + +# SDL only support hex code colors, these are the default: +; background = '#111111' +; foreground = '#33cccc' + + +# Gradient mode, only hex defined colors (and thereby ncurses mode) are supported, +# background must also be defined in hex or remain commented out. 1 = on, 0 = off. +# You can define as many as 8 different colors. They range from bottom to top of screen +; gradient = 0 +; gradient_count = 8 +; gradient_color_1 = '#59cc33' +; gradient_color_2 = '#80cc33' +; gradient_color_3 = '#a6cc33' +; gradient_color_4 = '#cccc33' +; gradient_color_5 = '#cca633' +; gradient_color_6 = '#cc8033' +; gradient_color_7 = '#cc5933' +; gradient_color_8 = '#cc3333' + + + +[smoothing] + +# Percentage value for integral smoothing. Takes values from 0 - 100. +# Higher values means smoother, but less precise. 0 to disable. +# DEPRECATED as of 0.8.0, use noise_reduction instead +; integral = 77 + +# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. +; monstercat = 0 +; waves = 0 + +# Set gravity percentage for "drop off". Higher values means bars will drop faster. +# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". +# DEPRECATED as of 0.8.0, use noise_reduction instead +; gravity = 100 + + +# In bar height, bars that would have been lower that this will not be drawn. +# DEPRECATED as of 0.8.0 +; ignore = 0 + +# Noise reduction, float 0 - 1. default 0.77 +# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth +# 1 will be very slow and smooth, 0 will be fast but noisy. +; noise_reduction = 0.77 + + +[eq] + +# This one is tricky. You can have as much keys as you want. +# Remember to uncomment more then one key! More keys = more precision. +# Look at readme.md on github for further explanations and examples. +# DEPRECATED as of 0.8.0 can be brought back by popular request, open issue at: +# https://github.com/karlstav/cava +1 = 1.2 # bass +2 = 1 +3 = 1 # midtone +4 = 1 +5 = 1.2 # treble diff --git a/config/cava/shaders/bar_spectrum.frag b/config/cava/shaders/bar_spectrum.frag new file mode 100644 index 00000000..b0789132 --- /dev/null +++ b/config/cava/shaders/bar_spectrum.frag @@ -0,0 +1,79 @@ +#version 330 + +in vec2 fragCoord; +out vec4 fragColor; + +// bar values. defaults to left channels first (low to high), then right (high to low). +uniform float bars[512]; + +uniform int bars_count; // number of bars (left + right) (configurable) +uniform int bar_width; // bar width (configurable), not used here +uniform int bar_spacing; // space bewteen bars (configurable) + +uniform vec3 u_resolution; // window resolution + +//colors, configurable in cava config file (r,g,b) (0.0 - 1.0) +uniform vec3 bg_color; // background color +uniform vec3 fg_color; // foreground color + +uniform int gradient_count; +uniform vec3 gradient_colors[8]; // gradient colors + +vec3 normalize_C(float y,vec3 col_1, vec3 col_2, float y_min, float y_max) +{ + //create color based on fraction of this color and next color + float yr = (y - y_min) / (y_max - y_min); + return col_1 * (1.0 - yr) + col_2 * yr; +} + +void main() +{ + // find which bar to use based on where we are on the x axis + float x = u_resolution.x * fragCoord.x; + int bar = int(bars_count * fragCoord.x); + + //calculate a bar size + float bar_size = u_resolution.x / bars_count; + + //the y coordinate and bar values are the same + float y = bars[bar]; + + // make sure there is a thin line at bottom + if (y * u_resolution.y < 1.0) + { + y = 1.0 / u_resolution.y; + } + + //draw the bar up to current height + if (y > fragCoord.y) + { + //make some space between bars basen on settings + if (x > (bar + 1) * (bar_size) - bar_spacing) + { + fragColor = vec4(bg_color,1.0); + } + else + { + if (gradient_count == 0) + { + fragColor = vec4(fg_color,1.0); + } + else + { + //find which color in the configured gradient we are at + int color = int((gradient_count - 1) * fragCoord.y); + + //find where on y this and next color is supposed to be + float y_min = color / (gradient_count - 1.0); + float y_max = (color + 1.0) / (gradient_count - 1.0); + + //make color + fragColor = vec4(normalize_C(fragCoord.y, gradient_colors[color], gradient_colors[color + 1], y_min, y_max), 1.0); + } + } + } + else + { + fragColor = vec4(bg_color,1.0); + } +} \ No newline at end of file diff --git a/config/cava/shaders/northern_lights.frag b/config/cava/shaders/northern_lights.frag new file mode 100644 index 00000000..ecd859a7 --- /dev/null +++ b/config/cava/shaders/northern_lights.frag @@ -0,0 +1,34 @@ +#version 330 + +in vec2 fragCoord; +out vec4 fragColor; + +// bar values. defaults to left channels first (low to high), then right (high to low). +uniform float bars[512]; + +uniform int bars_count; // number of bars (left + right) (configurable) + +uniform vec3 u_resolution; // window resolution, not used here + +//colors, configurable in cava config file +uniform vec3 bg_color; // background color(r,g,b) (0.0 - 1.0), not used here +uniform vec3 fg_color; // foreground color, not used here + +void main() +{ + // find which bar to use based on where we are on the x axis + int bar = int(bars_count * fragCoord.x); + + float bar_y = 1.0 - abs((fragCoord.y - 0.5)) * 2.0; + float y = (bars[bar]) * bar_y; + + float bar_x = (fragCoord.x - float(bar) / float(bars_count)) * bars_count; + float bar_r = 1.0 - abs((bar_x - 0.5)) * 2; + + bar_r = bar_r * bar_r * 2; + + // set color + fragColor.r = fg_color.x * y * bar_r; + fragColor.g = fg_color.y * y * bar_r; + fragColor.b = fg_color.z * y * bar_r; +} diff --git a/config/cava/shaders/pass_through.vert b/config/cava/shaders/pass_through.vert new file mode 100644 index 00000000..a4f20e52 --- /dev/null +++ b/config/cava/shaders/pass_through.vert @@ -0,0 +1,14 @@ +#version 330 + + +// Input vertex data, different for all executions of this shader. +layout(location = 0) in vec3 vertexPosition_modelspace; + +// Output data ; will be interpolated for each fragment. +out vec2 fragCoord; + +void main() +{ + gl_Position = vec4(vertexPosition_modelspace,1); + fragCoord = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; +} diff --git a/config/fastfetch/config.conf b/config/fastfetch/config.conf new file mode 100644 index 00000000..69bb33d2 --- /dev/null +++ b/config/fastfetch/config.conf @@ -0,0 +1,519 @@ +# Fastfetch configuration +# Write every argument in different lines. +# Direct arguments will overwrite the corresponding ones in this file. +# Argument keys are not case sensitive. +# Whitespaces are trimmed at the beginning and the end. +# Empty lines or lines starting with # are ignored. + +# This file was shipped with 2.1.2. +# Use fastfetch --gen-config-force to overwrite this file with the current defaults + +# Below some often usefull options are listed. Uncomment and modify them so they take affect. +# Note that there are a lot more options than the ones listed here, take a look at "fastfetch --help". +# Of course all of them can be made persistent here too. + +# Config option: +# Load additional config files. +# Some are shipped with fastfetch, list them with "fastfetch --list-presets". +# Must be a path to a config file or the name of a shipped preset. +# The config file is completely loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones. +# Can be used multiple times to load multiple config files / presets. +#--load-config /path/to/config.txt + +# Structure option: +# Sets the modules to use and their order. +# Must be a list of module names, separated by colons. +# List available modules with "fastfetch --list-modules". +# Get the default structure with "fastfetch --print-structure". +#--structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:PowerAdapter:Locale:Break:Colors + +# Multithreading option: +# Sets if fastfetch should use multiple threads to detect the values. +# Must be true or false. +# Default is true. +#--multithreading true + +# Print stat option: +# Sets if fastfetch should print time usage (in ms) for individual modules +# If true, it will also enable --show-errors +# Must be true or false. +# Default is false. +#--stat true + +# Slow operations option: +# Sets if fastfetch is allowed to use known slow operations to detect more / better values. +# Must be true or false. +# Default is false. +#--allow-slow-operations false + +# Linewrap option: +# Sets if fastfetch should disable linewrap during the run. +# Must be true or false. +# Default is true. +#--disable-linewrap true + +# Cursor option: +# Sets if fastfetch should hide the console cursor during the run. +# Must be true or false. +# Default is true. +#--hide-cursor true + +# Processing timeout option: +# Sets the timeout (ms) when waiting for child processes +# Must be an integer. +# Default is 1000 +#--processing-timeout 1000 + +# WMI timeout option: +# Sets the timeout (ms) for WMI queries. Windows only +# Must be an integer. +# Default is 5000 +#--wmi-timeout 5000 + +# Logo option: +# Sets the logo to use. +# List available logos with "fastfetch --list-logos". +# Print available logos with "fastfetch --print-logos". +# Must be the name of an available logo or a path to a text file containing a custom logo. +# Default is the current distribution. +#--logo arch + +# Logo type option: +# Sets the logo type to use. +# Must be auto, builtin, file, file-raw, data, data-raw, sixel, kitty or chafa. +# Default is auto. +#--logo-type auto + +# Logo width option: +# Sets the width of the logo (in characters) if the logo is an image. +# Must be a positive integer. +# Default is 65. +#--logo-width 65 + +# Logo height option: +# Sets the height of the logo (in characters) if the logo is an image. +# Must be a positive integer. +# Default is 0 (keeps aspect ration). +#--logo-height 0 + +# Logo color options: +# Overwrite a color in the logo. Also works for user provided logos. +# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign. +# Must be linux console color codes or the name of a color. +# Default is the one specified by the logo. +# Use "fastfetch --help color" to learn more and see examples. +# Valid index range is [1-9]. +#--logo-color-1 red +#--logo-color-2 32 +# [...] +#--logo-color-9 yellow + +# Logo padding option: +# Adds a padding to the left and the right side of the logo. +# Must be a positive integer. +# Default is 0. +#--logo-padding 0 + +# Logo padding left option: +# Adds a padding to the left side of the logo. +# Must be a positive integer. +# Default is 0. +--logo-padding-left 4 + +# Logo padding right option: +# Adds a padding to the right side of the logo. +# Must be a positive integer. +# Default is 0. +#--logo-padding-right 0 + +# Logo padding top option: +# Adds a padding to the top side of the logo. +# Must be a positive integer. +# Default is 0. +--logo-padding-top 1 + +# Logo print remaining option: +# Sets if the remaining logo should be printed, it is has more lines than modules to show. +# Must be true or false. +# Default is true. +#--logo-print-remaining true + +# Color keys option: +# Sets the color of the keys. +# Must be linux console color codes or the name of a color. +# Default is the key color of the logo. +# Use "fastfetch --help color" to learn more and see examples. +#--color-keys magenta + +# Color title option: +# Sets the color of the title. +# Must be linux console color codes or the name of a color. +# Default is the title color of the logo. +# Use "fastfetch --help color" to learn more and see examples. +#--color-title magenta + +# Binary prefix option: +# Sets the binary prefix to use. +# Must be a IEC, SI or JEDEC. +# Default is IEC. +#--binary-prefix IEC + +# Size number of digits option: +# Sets the number of digits to keep after the decimal point when formatting sizes. +# Must be an possitive integer. +# Default is 2. +#--size-ndigits 2 + +# Size max prefix option: +# Sets the largest binary prefix to use when formatting sizes. +# Must be one of B, kB, MB, GB, TB, PB, EB, ZB, YB +# Default is YB. +#--size-max-prefix YB + +# Disable output buffer option: +# Sets if the stdout application buffer should be disabled. +# Must be true or false. +# Default is false. +#--no-buffer false + +# Title FQDN option: +# Sets if the title should use the fully qualified domain name. +# Must be true or false. +# Default is false. +#--title-fqdn false + +# Title user color option: +# Sets color of the user name (left part). +# Default is empty (use color of `--color-title`). +#--title-color-user + +# Title at color option: +# Sets color of the @ symbol (middle part). +# Default is empty (use color of `--color-title`). +#--title-color-at + +# Title host color option: +# Sets color of the host name (right part). +# Default is empty (use color of `--color-title`). +#--title-color-host + +# Separator option: +# Sets the string placed between a key and its value. +# Can be any string. +# Default is ": ". +#--separator ": " + +# Separator string option: +# Sets the string printed by the "separator" module (usually between title and rest of output) +# Must be any string. It is repated / cut to fit perfectly. +# Default is "-" +#--separator-string - + +# Public IP URL option: +# Sets the URL of public IP detection server to be used. +# Only HTTP protocol is supported, and the value should not contain "http://" prefix. +# Default is "ipinfo.io/ip". +#--publicip-url "ipinfo.io/ip" + +# Public IP timeout option: +# Sets the time to wait for the public ip server to respond. +# Must be a positive integer. +# Default is 0 (disabled). +#--publicip-timeout 0 + +# Weather location option: +# Sets the location to be used. It must be URI encoded (eg a whitespace must be encoded as `+`). +# Default is empty (guessing by public IP) +#--weather-location "Location" + +# Weather output format option: +# Sets the weather format to be used. It must be URI encoded. +# See: https://github.com/chubin/wttr.in#one-line-output +# Default is "%t+-+%C+(%l)". +#--weather-output-format "%t+-+%C+(%l)" + +# Weather timeout option: +# Sets the time to wait for the weather server (wttr.in) to respond. +# Must be a positive integer. +# Default is 0 (disabled). +#--weather-timeout 0 + +# OS file option +# Sets the path to the file containing the operating system information. +# Should be a valid path to an existing file. +# Default is /etc/os-release. +#--os-file /etc/os-release + +# Player name option +# Sets the name of the player. This is also used in song detection +# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify) +# Default is the first match starting with org.mpris.MediaPlayer2. +#--player-name spotify + +# Display server force DRM option +# Sets if fastfetch should only use `/sys/class/drm` to detect displays if you get issues with the default behavior. +# Note DRM doesn't support refresh rate or scaled resolution detection. +# Only supported on Linux. +# Must be true or false. +# Default is false. +#--ds-force-drm false + +# Escape bedrock option +# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one +# Must be true or false. +# Default is true. +#--escape-bedrock true + +# OpenGL option +# Sets with opengl context creation library to use +# Must be either auto, egl, glx or osmesa +# Default is auto. +#--opengl-library auto + +# GPU hide options +# Sets whether to hide certain gpu types +# Must be either true or false +# Default is false. +#--gpu-hide-integrated +#--gpu-hide-discrete + +# GPU detection options +# Forces using vulkan to detect GPUs +# which support video memory usage detection with `--allow-slow-operations` +# Must be either true or false +# Default is false. +#--gpu-force-vulkan + +# Disk show options +# Sets if certain types of disk should be printed +# Must be either true or false +# Default is false except for --disk-show-external. +#--disk-show-external true +#--disk-show-hidden false +#--disk-show-subvolumes false +#--disk-show-unknown false + +# Disk option +# A colon (semicolon on Windows) separated list of folder paths for the disk output +# This option override `--disk-show-*` options above +# Must be a string +# Default is "/:/home" ("C:\;D:\ ..." on Windows). +#--disk-folders /:/home + +# Bluetooth show disconnected option +# Sets if disconnected bluetooth devices should be printed +# Must be either true or false +# Default is false. +#--bluetooth-show-disconnected false + +# Display compact output option +# Sets if all displays should be printed in one line +# Must be either original (print pixel resolution) or scaled (print scaled resolution) +# Default is none. +#--display-compact-type none + +# Display detect name option +# Sets if display name should be detected and printed (if supported) +# Must be either true of false +# Default is false. +#--display-detect-name none + +# Display precise refresh rate option +# Sets if decimal refresh rates should not be rounded into integers when printing +# Must be either true (keep decimals) of false (round into integers) +# Default is false. +#--display-precise-refresh-rate false + +# Sound show all option +# Sets if all sound devices should be printed +# Must be either main, active or all. Default is main +# Default is main. +#--sound-type main + +# Percentage output type option +# Applies to all modules that prints percentage values. Currently memory, swap, disk, battery and CPU usage are supported. +# Only works with default format ( without --module-format option ). +# 0: prints none; 1: prints percent number only; 2: prints bar only; 3: prints both percent number and bar; 6: prints bar and hide other texts; 9: prints colored number +#--percent-type 1 + +# Key options: +# Sets the displayed key of a module +# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help. +#--os-key OS +#--host-key Host +#--chassis-key Chassis +#--kernel-key Kernel +#--uptime-key Uptime +#--processes-key Processes +#--packages-key Packages +#--shell-key Shell +#--display-key Display {1} +#--brightness-key Brightness ({1}) +#--monitor-key Monitor +#--de-key DE +#--wm-key WM +#--wmtheme-key WM Theme +#--theme-key Theme +#--icons-key Icons +#--font-key Font +#--cursor-key Cursor +#--terminal-key Terminal +#--terminalfont-key Terminal Font +#--cpu-key CPU +#--cpuusage-key CPU Usage +#--gpu-key GPU {1} +#--memory-key Memory +#--swap-key Swap +#--disk-key Disk ({1}) +#--battery-key Battery {1} +#--poweradapter-key Power Adapter {1} +#--lm-key LM +#--locale-key Locale +#--localip-key Local IP ({1}) +#--netio-key Network IO ({1}) +#--publicip-key Public IP +#--wifi-key Wifi +#--weather-key Weather +#--player-key Media Player +#--media-key Media +#--datetime-key Date Time +#--version-key Version +#--vulkan-key Vulkan +#--opengl-key OpenGL +#--opencl-key OpenCL +#--users-key Users +#--bluetooth-key Bluetooth +#--sound-key Sound +#--gamepad-key Gamepad +#--wallpaper-key Wallpaper + +# Format options: +# Sets the format string for module values. +# For information on format strings, see "fastfetch --help format". +# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format". +# An empty format string (As they are currently below) will behave as if it was not set. +#--title-format +#--os-format +#--host-format +#--chassis-format +#--kernel-format +#--uptime-format +#--processes-format +#--packages-format +#--shell-format +#--display-format +#--brightness-format +#--de-format +#--wm-format +#--wmtheme-format +#--theme-format +#--icons-format +#--font-format +#--cursor-format +#--terminal-format +#--terminalfont-format +#--cpu-format +#--cpuusage-format +#--gpu-format +#--memory-format +#--swap-format +#--disk-format +#--battery-format +#--poweradapter-format +#--lm-format +#--locale-format +#--localip-format +#--netio-format +#--publicip-format +#--weather-format +#--monitor-format +#--player-format +#--media-format +#--datetime-format +#--version-format +#--vulkan-format +#--opengl-format +#--opencl-format +#--users-format +#--bluetooth-format +#--sound-format +#--gamepad-format +#--wallpaper-format + +# Key color options: +# Overrides the global `--color-keys` for one specified module +#--title-key-color +#--os-key-color +#--host-key-color +#--chassis-key-color +#--kernel-key-color +#--uptime-key-color +#--processes-key-color +#--packages-key-color +#--shell-key-color +#--display-key-color +#--brightness-key-color +#--de-key-color +#--wm-key-color +#--wmtheme-key-color +#--theme-key-color +#--icons-key-color +#--font-key-color +#--cursor-key-color +#--terminal-key-color +#--terminalfont-key-color +#--cpu-key-color +#--cpuusage-key-color +#--gpu-key-color +#--memory-key-color +#--swap-key-color +#--disk-key-color +#--battery-key-color +#--poweradapter-key-color +#--lm-key-color +#--locale-key-color +#--localip-key-color +#--netio-key-color +#--publicip-key-color +#--weather-key-color +#--monitor-key-color +#--player-key-color +#--media-key-color +#--datetime-key-color +#--version-key-color +#--vulkan-key-color +#--opengl-key-color +#--opencl-key-color +#--users-key-color +#--bluetooth-key-color +#--sound-key-color +#--gamepad-key-color +#--wallpaper-key-color + +# Library options: +# Sets an user specific path to a library to load. +# Must be a valid path to a library. +#--lib-PCI /usr/lib/libpci.so +#--lib-vulkan /usr/lib/libvulkan.so (libMoltenVK.dylib on macOS) +#--lib-wayland /usr/lib/libwayland-client.so +#--lib-xcb-randr /usr/lib/libxcb-randr.so +#--lib-xcb /usr/lib/libxcb.so +#--lib-Xrandr /usr/lib/libXrandr.so +#--lib-X11 /usr/lib/libX11.so +#--lib-gio /usr/lib/libgio-2.0.so +#--lib-DConf /usr/lib/libdconf.so +#--lib-DBus /usr/lib/libdbus-1.so +#--lib-XFConf /usr/lib/libxfconf-0.so +#--lib-sqlite3 /usr/lib/libsqlite3.so +#--lib-rpm /usr/lib/librpm.so +#--lib-imagemagick /usr/lib/libMagickCore-7.Q16HDRI.so +#--lib-z /usr/lib/libz.so +#--lib-chafa /usr/lib/libchafa.so +#--lib-egl /usr/lib/libEGL.so +#--lib-glx /usr/lib/libGLX.so +#--lib-osmesa /usr/lib/libOSMesa.so +#--lib-opencl /usr/lib/libOpenCL.so +#--lib-freetype /data/data/com.termux/files/usr/lib +#--lib-pulse /usr/lib/libpulse.so +#--lib-ddcutil /usr/lib/libddcutil.so +#--lib-nm /usr/lib/libnm.so diff --git a/config/fastfetch/config.jsonc b/config/fastfetch/config.jsonc new file mode 100644 index 00000000..93c665cf --- /dev/null +++ b/config/fastfetch/config.jsonc @@ -0,0 +1,32 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "padding": { + "top": 1, + "left": 4 + } + }, + "modules": [ + "title", + "separator", + "os", + "host", + "kernel", + "uptime", + "packages", + "locale", + "shell", + "de", + "wm", + "terminal", + "separator", + "cpu", + "gpu", + "display", + "memory", + "swap", + "disk", + "break", + "colors" + ] +} diff --git a/config/fish/completions/key-bindings.fish b/config/fish/completions/key-bindings.fish new file mode 100644 index 00000000..743c7c18 --- /dev/null +++ b/config/fish/completions/key-bindings.fish @@ -0,0 +1,172 @@ +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ key-bindings.fish +# +# - $FZF_TMUX_OPTS +# - $FZF_CTRL_T_COMMAND +# - $FZF_CTRL_T_OPTS +# - $FZF_CTRL_R_OPTS +# - $FZF_ALT_C_COMMAND +# - $FZF_ALT_C_OPTS + +# Key bindings +# ------------ +function fzf_key_bindings + + # Store current token in $dir as root for the 'find' command + function fzf-file-widget -d "List files and folders" + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + set -l prefix $commandline[3] + + # "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not + # $dir itself, even if hidden. + test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND " + command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \ + -o -type f -print \ + -o -type d -print \ + -o -type l -print 2> /dev/null | sed 's@^\./@@'" + + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + begin + set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" + eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end + end + if [ -z "$result" ] + commandline -f repaint + return + else + # Remove last token from commandline. + commandline -t "" + end + for i in $result + commandline -it -- $prefix + commandline -it -- (string escape $i) + commandline -it -- ' ' + end + commandline -f repaint + end + + function fzf-history-widget -d "Show command history" + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + begin + set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --scheme=history --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m" + + set -l FISH_MAJOR (echo $version | cut -f1 -d.) + set -l FISH_MINOR (echo $version | cut -f2 -d.) + + # history's -z flag is needed for multi-line support. + # history's -z flag was added in fish 2.4.0, so don't use it for versions + # before 2.4.0. + if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ]; + history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result + and commandline -- $result + else + history | eval (__fzfcmd) -q '(commandline)' | read -l result + and commandline -- $result + end + end + commandline -f repaint + end + + function fzf-cd-widget -d "Change directory" + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + set -l prefix $commandline[3] + + test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND " + command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \ + -o -type d -print 2> /dev/null | sed 's@^\./@@'" + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + begin + set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" + eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result + + if [ -n "$result" ] + cd -- $result + + # Remove last token from commandline. + commandline -t "" + commandline -it -- $prefix + end + end + + commandline -f repaint + end + + function __fzfcmd + test -n "$FZF_TMUX"; or set FZF_TMUX 0 + test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% + if [ -n "$FZF_TMUX_OPTS" ] + echo "fzf-tmux $FZF_TMUX_OPTS -- " + else if [ $FZF_TMUX -eq 1 ] + echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- " + else + echo "fzf" + end + end + + bind \ct fzf-file-widget + bind \cr fzf-history-widget + bind \ec fzf-cd-widget + + if bind -M insert > /dev/null 2>&1 + bind -M insert \ct fzf-file-widget + bind -M insert \cr fzf-history-widget + bind -M insert \ec fzf-cd-widget + end + + function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix' + set -l commandline (commandline -t) + + # strip -option= from token if present + set -l prefix (string match -r -- '^-[^\s=]+=' $commandline) + set commandline (string replace -- "$prefix" '' $commandline) + + # eval is used to do shell expansion on paths + eval set commandline $commandline + + if [ -z $commandline ] + # Default to current directory with no --query + set dir '.' + set fzf_query '' + else + set dir (__fzf_get_dir $commandline) + + if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ] + # if $dir is "." but commandline is not a relative path, this means no file path found + set fzf_query $commandline + else + # Also remove trailing slash after dir, to "split" input properly + set fzf_query (string replace -r "^$dir/?" -- '' "$commandline") + end + end + + echo $dir + echo $fzf_query + echo $prefix + end + + function __fzf_get_dir -d 'Find the longest existing filepath from input string' + set dir $argv + + # Strip all trailing slashes. Ignore if $dir is root dir (/) + if [ (string length -- $dir) -gt 1 ] + set dir (string replace -r '/*$' -- '' $dir) + end + + # Iteratively check if dir exists and strip tail end of path + while [ ! -d "$dir" ] + # If path is absolute, this can keep going until ends up at / + # If path is relative, this can keep going until entire input is consumed, dirname returns "." + set dir (dirname -- "$dir") + end + + echo $dir + end + +end diff --git a/config/fish/config.fish b/config/fish/config.fish new file mode 100644 index 00000000..0d387d5a --- /dev/null +++ b/config/fish/config.fish @@ -0,0 +1,7 @@ +if status is-interactive + # Commands to run in interactive sessions can go here + # + #cat ~/.config/banner.asc + fastfetch + set -g fish_greeting +end diff --git a/config/fish/fish_variables b/config/fish/fish_variables new file mode 100644 index 00000000..d5b57ecc --- /dev/null +++ b/config/fish/fish_variables @@ -0,0 +1,40 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR --export EDITOR:kcr\x20edit +SETUVAR --export FZF_DEFAULT_OPTS:--multi\x20--layout=reverse\x20--preview-window=down:60% +SETUVAR --export KCR_DEFAULT_SESSION:default +SETUVAR --export VDPAU_DRIVER:radeonsi +SETUVAR __fish_initialized:3400 +SETUVAR fish_color_autosuggestion:8e908c +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:8959a8 +SETUVAR fish_color_comment:eab700 +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:8959a8 +SETUVAR fish_color_error:c82829 +SETUVAR fish_color_escape:00a6b2 +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_keyword:8959a8 +SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:00a6b2 +SETUVAR fish_color_option:4271ae +SETUVAR fish_color_param:4271ae +SETUVAR fish_color_quote:718c00 +SETUVAR fish_color_redirection:3e999f +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_greeting:\x1d +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:B3A06D\x1eyellow +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dbrblack +SETUVAR fish_user_paths:/home/andy/Applications\x1e/opt/android\x2dsdk/platform\x2dtools\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin diff --git a/config/fish/functions/:cat.fish b/config/fish/functions/:cat.fish new file mode 100644 index 00000000..c82ad689 --- /dev/null +++ b/config/fish/functions/:cat.fish @@ -0,0 +1,3 @@ +function :cat --wraps='kcr cat --raw' --description 'alias :cat=kcr cat --raw' + kcr cat --raw $argv; +end diff --git a/config/fish/functions/K.fish b/config/fish/functions/K.fish new file mode 100644 index 00000000..bf4cb136 --- /dev/null +++ b/config/fish/functions/K.fish @@ -0,0 +1,3 @@ +function K --wraps=kcr-fzf-shell --description 'alias K=kcr-fzf-shell' + kcr-fzf-shell $argv; +end diff --git a/config/fish/functions/a.fish b/config/fish/functions/a.fish new file mode 100644 index 00000000..1e2c651b --- /dev/null +++ b/config/fish/functions/a.fish @@ -0,0 +1,3 @@ +function a --wraps='kcr attach' --description 'alias a=kcr attach' + kcr attach $argv; +end diff --git a/config/fish/functions/df.fish b/config/fish/functions/df.fish new file mode 100644 index 00000000..8a46d4ac --- /dev/null +++ b/config/fish/functions/df.fish @@ -0,0 +1,3 @@ +function df --wraps='/bin/df -h | tail -n +2 | sort -n' --wraps='/bin/df -ah | tail -n +2 | sort -n' --wraps='/bin/df -ahk | tail -n +2 | sort -n' --description 'alias df /bin/df -h | tail -n +2 | sort -n' + /bin/df -h | tail -n +2 | sort -n $argv; +end diff --git a/config/fish/functions/emergelog.fish b/config/fish/functions/emergelog.fish new file mode 100644 index 00000000..8412d626 --- /dev/null +++ b/config/fish/functions/emergelog.fish @@ -0,0 +1,3 @@ +function emergelog --wraps='sudo cat /var/log/emerge.log | grep completed' --wraps=sudo\ cat\ /var/log/emerge.log\ \|\ grep\ -i\ \"completed\\\|started\" --wraps=sudo\ cat\ /var/log/emerge.log\ \|\ grep\ -i\ \"started\\\|completed\\\|exiting\" --description alias\ emergelog=sudo\ cat\ /var/log/emerge.log\ \|\ grep\ -i\ \"started\\\|completed\\\|exiting\" + sudo cat /var/log/emerge.log | grep -i "started\|completed\|exiting" $argv; +end diff --git a/config/fish/functions/fish_prompt.fish b/config/fish/functions/fish_prompt.fish new file mode 100644 index 00000000..b7d38e68 --- /dev/null +++ b/config/fish/functions/fish_prompt.fish @@ -0,0 +1,139 @@ +function fish_prompt + # This prompt shows: + # - green lines if the last return command is OK, red otherwise + # - your user name, in red if root or yellow otherwise + # - your hostname, in cyan if ssh or blue otherwise + # - the current path (with prompt_pwd) + # - date +%X + # - the current virtual environment, if any + # - the current git status, if any, with fish_git_prompt + # - the current battery state, if any, and if your power cable is unplugged, and if you have "acpi" + # - current background jobs, if any + + # It goes from: + # ┬─[nim@Hattori:~]─[11:39:00] + # ╰─>$ echo here + + # To: + # ┬─[nim@Hattori:~/w/dashboard]─[11:37:14]─[V:django20]─[G:master↑1|●1✚1…1]─[B:85%, 05:41:42 remaining] + # │ 2 15054 0% arrêtée sleep 100000 + # │ 1 15048 0% arrêtée sleep 100000 + # ╰─>$ echo there + + set -l retc red + test $status = 0; and set retc green + + set -q __fish_git_prompt_showupstream + or set -g __fish_git_prompt_showupstream auto + + function _nim_prompt_wrapper + set retc $argv[1] + set -l field_name $argv[2] + set -l field_value $argv[3] + + set_color normal + set_color $retc + echo -n '─' + set_color -o green + echo -n '[' + set_color normal + test -n $field_name + and echo -n $field_name: + set_color $retc + echo -n $field_value + set_color -o green + echo -n ']' + end + + set_color $retc + echo -n '┬─' + set_color -o green + echo -n [ + + if functions -q fish_is_root_user; and fish_is_root_user + set_color -o red + else + set_color -o yellow + end + + echo -n $USER + set_color -o white + echo -n @ + + if test -z "$SSH_CLIENT" + set_color -o blue + else + set_color -o cyan + end + + echo -n (prompt_hostname) + set_color -o white + echo -n :(prompt_pwd) + set_color -o green + echo -n ']' + + # Date + _nim_prompt_wrapper $retc '' (date +%X) + + # Vi-mode + # The default mode prompt would be prefixed, which ruins our alignment. + function fish_mode_prompt + end + + if test "$fish_key_bindings" = fish_vi_key_bindings + or test "$fish_key_bindings" = fish_hybrid_key_bindings + set -l mode + switch $fish_bind_mode + case default + set mode (set_color --bold red)N + case insert + set mode (set_color --bold green)I + case replace_one + set mode (set_color --bold green)R + echo '[R]' + case replace + set mode (set_color --bold cyan)R + case visual + set mode (set_color --bold magenta)V + end + set mode $mode(set_color normal) + _nim_prompt_wrapper $retc '' $mode + end + + + # Virtual Environment + set -q VIRTUAL_ENV_DISABLE_PROMPT + or set -g VIRTUAL_ENV_DISABLE_PROMPT true + set -q VIRTUAL_ENV + and _nim_prompt_wrapper $retc V (basename "$VIRTUAL_ENV") + + # git + set -l prompt_git (fish_git_prompt '%s') + test -n "$prompt_git" + and _nim_prompt_wrapper $retc G $prompt_git + + # Battery status + type -q acpi + and test (acpi -a 2> /dev/null | string match -r off) + and _nim_prompt_wrapper $retc B (acpi -b | cut -d' ' -f 4-) + + # New line + echo + + # Background jobs + set_color normal + + for job in (jobs) + set_color $retc + echo -n '│ ' + set_color brown + echo $job + end + + set_color normal + set_color $retc + echo -n '╰─>' + set_color -o red + echo -n '$ ' + set_color normal +end diff --git a/config/fish/functions/free.fish b/config/fish/functions/free.fish new file mode 100644 index 00000000..1588642c --- /dev/null +++ b/config/fish/functions/free.fish @@ -0,0 +1,3 @@ +function free --wraps='/usr/bin/free --giga -h -w' --wraps='/usr/bin/free -h' --description 'alias free=free -wth --si' + command free -wth --si $argv; +end diff --git a/config/fish/functions/gcp.fish b/config/fish/functions/gcp.fish new file mode 100644 index 00000000..907c340a --- /dev/null +++ b/config/fish/functions/gcp.fish @@ -0,0 +1,3 @@ +function gcp --wraps='git cherry-pick' --description 'alias gcp=git cherry-pick' + git cherry-pick $argv; +end diff --git a/config/fish/functions/glo.fish b/config/fish/functions/glo.fish new file mode 100644 index 00000000..5d60fd50 --- /dev/null +++ b/config/fish/functions/glo.fish @@ -0,0 +1,3 @@ +function glo --wraps='git log --oneline' --description 'alias gcp=git log --oneline' + git log --oneline $argv; +end diff --git a/config/fish/functions/grep.fish b/config/fish/functions/grep.fish new file mode 100644 index 00000000..65baf8e9 --- /dev/null +++ b/config/fish/functions/grep.fish @@ -0,0 +1,3 @@ +function grep --description 'alias grep=grep -i --color=auto' + command grep -i --color=auto $argv; +end diff --git a/config/fish/functions/gs.fish b/config/fish/functions/gs.fish new file mode 100644 index 00000000..0755f7c4 --- /dev/null +++ b/config/fish/functions/gs.fish @@ -0,0 +1,3 @@ +function gs --wraps='git status' --description 'alias gs=git status' + git status $argv; +end diff --git a/config/fish/functions/hc.fish b/config/fish/functions/hc.fish new file mode 100644 index 00000000..cfbfd46f --- /dev/null +++ b/config/fish/functions/hc.fish @@ -0,0 +1,3 @@ +function hc --wraps='hyprctl clients' --description 'alias hc=hyprctl clients' + hyprctl clients $argv; +end diff --git a/config/fish/functions/k.fish b/config/fish/functions/k.fish new file mode 100644 index 00000000..ad41f0dd --- /dev/null +++ b/config/fish/functions/k.fish @@ -0,0 +1,3 @@ +function k --wraps='kks edit' --wraps='kcr attach' --wraps='kcr edit' --description 'alias k=kcr edit' + kcr edit $argv; +end diff --git a/config/fish/functions/kl.fish b/config/fish/functions/kl.fish new file mode 100644 index 00000000..a9dda47f --- /dev/null +++ b/config/fish/functions/kl.fish @@ -0,0 +1,3 @@ +function kl --wraps='kcr list' --description 'alias kl=kcr list' + kcr list $argv; +end diff --git a/config/fish/functions/ks.fish b/config/fish/functions/ks.fish new file mode 100644 index 00000000..63d3f45d --- /dev/null +++ b/config/fish/functions/ks.fish @@ -0,0 +1,3 @@ +function ks --wraps='kcr shell --session' --description 'alias ks=kcr shell --session' + kcr shell --session $argv; +end diff --git a/config/fish/functions/l1.fish b/config/fish/functions/l1.fish new file mode 100644 index 00000000..14223458 --- /dev/null +++ b/config/fish/functions/l1.fish @@ -0,0 +1,3 @@ +function l1 --description 'list files bare' + exa --icons --group --time-style=iso --group-directories-first -l $argv; +end diff --git a/config/fish/functions/la.fish b/config/fish/functions/la.fish new file mode 100644 index 00000000..e3d3f067 --- /dev/null +++ b/config/fish/functions/la.fish @@ -0,0 +1,3 @@ +function la --description 'list standard incl. hidden' + ls -a $argv; +end diff --git a/config/fish/functions/lg.fish b/config/fish/functions/lg.fish new file mode 100644 index 00000000..705c12e1 --- /dev/null +++ b/config/fish/functions/lg.fish @@ -0,0 +1,3 @@ +function lg --description 'list files sorted by size' + exa --icons --group --long --sort=size -t=mod --time-style=iso --group-directories-first $argv; +end diff --git a/config/fish/functions/lgo.fish b/config/fish/functions/lgo.fish new file mode 100644 index 00000000..c8bf2aa8 --- /dev/null +++ b/config/fish/functions/lgo.fish @@ -0,0 +1,3 @@ +function lgo --wraps='git log --oneline' --description 'alias lgo=git log --oneline' + git log --oneline $argv; +end diff --git a/config/fish/functions/ll.fish b/config/fish/functions/ll.fish new file mode 100644 index 00000000..fe524fd9 --- /dev/null +++ b/config/fish/functions/ll.fish @@ -0,0 +1,3 @@ +function ll --description 'list files long' + exa --icons --group --time-style=iso --group-directories-first -l $argv; +end diff --git a/config/fish/functions/ls.fish b/config/fish/functions/ls.fish new file mode 100644 index 00000000..2e4d264f --- /dev/null +++ b/config/fish/functions/ls.fish @@ -0,0 +1,3 @@ +function ls --description 'list files standard' + exa --icons --time-style=iso --group-directories-first $argv; +end diff --git a/config/fish/functions/lsblk.fish b/config/fish/functions/lsblk.fish new file mode 100644 index 00000000..0b1dbdbb --- /dev/null +++ b/config/fish/functions/lsblk.fish @@ -0,0 +1,3 @@ +function lsblk --description 'alias lsblk=lsblk -o +MODEL,LABEL' + command lsblk -o +MODEL,LABEL $argv; +end diff --git a/config/fish/functions/lt.fish b/config/fish/functions/lt.fish new file mode 100644 index 00000000..ffa4b22d --- /dev/null +++ b/config/fish/functions/lt.fish @@ -0,0 +1,3 @@ +function lt --description 'list files sorted by mtime' + exa --icons --group --long --sort=mod -t=mod --time-style=iso --group-directories-first $argv; +end diff --git a/config/fish/functions/lw.fish b/config/fish/functions/lw.fish new file mode 100644 index 00000000..173cc732 --- /dev/null +++ b/config/fish/functions/lw.fish @@ -0,0 +1,3 @@ +function lw --description 'list files wide' + exa --icons --group --long --grid --time-style=iso --group-directories-first $argv; +end diff --git a/config/fish/functions/r.fish b/config/fish/functions/r.fish new file mode 100644 index 00000000..3bd11cde --- /dev/null +++ b/config/fish/functions/r.fish @@ -0,0 +1,12 @@ +function r +set tempfile (mktemp -t tmp.XXXXXX) +set command_argument "tab_new;map Q chain shell echo %d > $tempfile; quitall" +command ranger --cmd="$command_argument" $argv +if test -s $tempfile +set ranger_pwd (cat $tempfile) +if test -n $ranger_pwd -a -d $ranger_pwd +builtin cd -- $ranger_pwd +end +end +command rm -f -- $tempfile +end diff --git a/config/fish/functions/stow.fish b/config/fish/functions/stow.fish new file mode 100644 index 00000000..e38ae52e --- /dev/null +++ b/config/fish/functions/stow.fish @@ -0,0 +1,4 @@ +function stow + bash -c "/usr/bin/stow $argv 2> >(grep -v 'BUG in find_stowed_path? Absolute/relative mismatch' 1>&2)" +end + diff --git a/config/fish/functions/zdiff.fish b/config/fish/functions/zdiff.fish new file mode 100644 index 00000000..028c8508 --- /dev/null +++ b/config/fish/functions/zdiff.fish @@ -0,0 +1,3 @@ +function zdiff --description 'alias zdiff=zdiff --color=auto' + command zdiff --color=auto $argv; +end diff --git a/config/foot/base16 b/config/foot/base16 new file mode 160000 index 00000000..eedbcfa3 --- /dev/null +++ b/config/foot/base16 @@ -0,0 +1 @@ +Subproject commit eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce diff --git a/config/foot/foot.ini b/config/foot/foot.ini new file mode 100644 index 00000000..c9199c81 --- /dev/null +++ b/config/foot/foot.ini @@ -0,0 +1,238 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode +# title=foot +# locked-title=no + +include=~/.config/foot/base16/colors/base16-default-dark.ini + +font=LiterationMono Nerd Font:size=13 +# font-bold= +# font-italic= +# font-bold-italic= +# font-size-adjustment=0.5 +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# underline-thickness= +# box-drawings-uses-font-glyphs=no +# dpi-aware=no + +initial-window-size-pixels=1256x1344 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +# pad=0x0 # optionally append 'center' +# resize-delay-ms=100 + +notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= +# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) +# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) + +[environment] +# name=value + +[bell] +# urgent=no +# notify=no +# visual=no +# command= +# command-focused=no + +[scrollback] +lines=16384 +# multiplier=3.0 +# indicator-position=relative +# indicator-format="" +indicator-format=percentage + +[url] +# launch=xdg-open ${url} +label-letters=adfghjkl +# osc8-underline=url-mode +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] + +[cursor] +# style=block +# color= +# blink=no +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[touch] +# long-press-delay=400 + +[colors] +alpha=0.90 + +background=242124 +foreground=f5f5f5 +# flash=7f7f00 +# flash-alpha=0.5 + +## Normal/regular colors (color palette 0-7) +regular0=242424 # black +# regular1=f62b5a # red +# regular2=47b413 # green +regular2=91bc61 # bright green +regular3=ffb852 # yellow +# regular4=24acd4 # blue +regular4=5d81d2 +regular5=776d96 # magenta +# regular6=13c299 # cyan +regular6=90e0e0 +regular7=f5f5f5 # white + +## Bright colors (color palette 8-15) +bright0=3d4c59 # bright black +# bright1=ff4d51 # bright red +# bright2=35d450 # bright green +bright2=91bc61 # bright green +# bright3=e9e836 # bright yellow +bright3=ffb852 # bright yellow +# bright4=5dc5f8 # bright blue +bright4=5d81d2 +# bright5=feabf2 # bright magenta +bright5=776d96 # magenta +# bright6=24dfc4 # bright cyan +bright6=90e0e0 +# bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= # black-on-yellow +# scrollback-indicator= # black-on-bright-blue +# search-box-no-match= # black-on-red +# search-box-match= # black-on-yellow +# urls= + +[csd] +# preferred=server +# size=26 +# font= +# color= +# hide-when-maximized=no +# double-click-to-maximize=yes +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+o +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=Control+Shift+u +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-char=Shift+Right +# extend-to-word-boundary=Control+w Control+Shift+Right +# extend-to-next-whitespace=Control+Shift+w +# extend-line-down=Shift+Down +# extend-backward-char=Shift+Left +# extend-backward-to-word-boundary=Control+Shift+Left +# extend-backward-to-next-whitespace=none +# extend-line-up=Shift+Up +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# scrollback-up-mouse=BTN_BACK +# scrollback-down-mouse=BTN_FORWARD +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-quote = BTN_LEFT-3 +# select-row=BTN_LEFT-4 + +# vim: ft=dosini + diff --git a/config/fuzzel/fuzzel.ini b/config/fuzzel/fuzzel.ini new file mode 100644 index 00000000..4b36d1f0 --- /dev/null +++ b/config/fuzzel/fuzzel.ini @@ -0,0 +1,94 @@ +# output= +font=monospace:size=12 +# dpi-aware=auto +# prompt="> " +icon-theme=breeze-dark +# icons-enabled=yes +# fields=filename,name,generic +# password-character=* +# filter-desktop=no +# fuzzy=yes +# show-actions=no +terminal=foot -e +# launch-prefix= + +# anchor=center +# lines=15 +# width=30 +# tabs=8 +# horizontal-pad=40 +# vertical-pad=8 +# inner-pad=0 + +# image-size-ratio=0.5 + +# line-height= +line-height=20 +# letter-spacing=0 + +# layer = top +# exit-on-keyboard-focus-loss = yes + +[colors] +background=282828dd +text=d8d8d8ff +# match=cb4b16ff +selection=add8e6dd +selection-text=282828ff +# selection-match=cb4b16ff +border=595959ff + +[border] +width=2 +# radius=10 + +[dmenu] +# mode=text # text|index +# exit-immediately-if-empty=no + +[key-bindings] +# cancel=Escape Control+g +# execute=Return KP_Enter Control+y +# execute-or-next=Tab +# execute-input=Shift+Return Shift+KP_Enter +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete KP_Delete Control+d +# delete-next-word=Mod1+d Control+Delete Control+KP_Delete +# delete-line=Control+k +# prev=Up Control+p +# prev-with-wrap=ISO_Left_Tab +# prev-page=Page_Up KP_Page_Up +# next=Down Control+n +# next-with-wrap=none +# next-page=Page_Down KP_Page_Down + +# custom-N: *dmenu mode only*. Like execute, but with a non-zero +# exit-code; custom-1 exits with code 10, custom-2 with 11, custom-3 +# with 12, and so on. + +# custom-1=Mod1+1 +# custom-2=Mod1+2 +# custom-3=Mod1+3 +# custom-4=Mod1+4 +# custom-5=Mod1+5 +# custom-6=Mod1+6 +# custom-7=Mod1+7 +# custom-8=Mod1+8 +# custom-9=Mod1+9 +# custom-10=Mod1+0 +# custom-11=Mod1+exclam +# custom-12=Mod1+at +# custom-13=Mod1+numbersign +# custom-14=Mod1+dollar +# custom-15=Mod1+percent +# custom-16=Mod1+dead_circumflex +# custom-17=Mod1+ampersand +# custom-18=Mod1+asterix +# custom-19=Mod1+parentleft diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf new file mode 100644 index 00000000..10e343ef --- /dev/null +++ b/config/hypr/hyprland.conf @@ -0,0 +1,300 @@ +# ░█░█░█░█░█▀█░█▀▄░█░░░█▀█░█▀█░█▀▄░░░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀ +# ░█▀█░░█░░█▀▀░█▀▄░█░░░█▀█░█░█░█░█░░░█░░░█░█░█░█░█▀▀░░█░░█░█ +# ░▀░▀░░▀░░▀░░░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀░░░░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀i + +autogenerated = 0 # remove this line to remove the warning + +# See https://wiki.hyprland.org/Configuring/Monitors/ +#monitor=DP-3,preferred,auto,1.125,vrr,2 +monitor=DP-3,preferred,auto,1,vrr,2 + +# unscale XWayland +xwayland { + force_zero_scaling = true +} + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +env = VK_ICD_FILENAMES,/usr/share/vulkan/icd.d/radeon_icd.x86_64.json +env = WLR_RENDERER,vulkan +env = XDG_CURRENT_DESKTOP, Hyprland +env = XDG_SESSION_TYPE, wayland +env = XDG_SESSION_DESKTOP, Hyprland + +# Execute your favorite apps at launch + +exec-once = ~/.config/hypr/scripts/startup.sh +exec-once = ~/.config/hypr/scripts/daemons.sh + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Some default env vars. +env = GDK_SCALE=1 # scaling XWayland clients +env = XCURSOR_SIZE,24 +env = QT_QPA_PLATFORM,wayland +env = QT_QPA_PLATFORMTHEME,qt6ct +env = GDK_BACKEND=wayland +env = QT_AUTO_SCREEN_SCALE_FACTOR,1 +env = MOZ_ENABLE_WAYLAND,1 +env = GTK_USE_PORTAL,1 + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = de_se_fi + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 10 + gaps_out = 20 + border_size = 2 + col.active_border = rgba(2394bbee) rgba(638c9bee) 45deg + col.inactive_border = rgba(595959ee) rgba(333333ee) 45deg + col.nogroup_border = rgba(732673ee) rgba(4c2673ee) 45deg + col.nogroup_border_active = rgba(993399ee) rgba(663399ee) 45deg + + layout = dwindle + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false +} + +dwindle { + force_split = 2 +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 4 + + blur { + enabled = true + size = 3 + passes = 1 + vibrancy = 0.1696 + } + + drop_shadow = yes + shadow_range = 8 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + bezier = overshot, 0.05, 0.9, 0.1, 1.1 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default, slidefade 30% +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = false +} + +misc { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + force_default_wallpaper = -1 # Set to 0 to disable the anime mascot wallpapers +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} + +group { + insert_after_current = false + col.border_active = rgba(fe920eee) rgba(fca230ee) 45deg + col.border_inactive = rgba(fca230ee) rgba(f7ca88ee) 45deg + col.border_locked_active = rgba(2e8b57ee) rgba(2e8a73ee) 45deg + col.border_locked_inactive = rgba(226841ee) rgba(226856ee) 45deg + groupbar { + font_family = LiterationMono Nerd Font + font_size = 11 + gradients = true + col.active = 0xeefe920e + col.inactive = 0x99fca230 + col.locked_active = 0x772e8b57 + col.locked_inactive = 0x55194d40 + } +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +# more windowrules + +# handle steam client +windowrule = float,^(steam)$ +windowrule = float,title:^(Steam)$ +windowrule = float,title:^(Freundesliste)$ +windowrulev2 = stayfocused, title:^()$, class:^(steam)$ +windowrulev2 = minsize 1 1, title:^()$, class:^(steam)$ + +# handle other clients +windowrulev2 = float, size 1560 1000, pin, workspace special:overlay, class:^(org.keepassxc.KeePassXC)$ +windowrule = float, ^(firefox)$ +windowrulev2 = opacity 1.0 override 0.8 override, group, class:^(foot)$ +windowrulev2 = float, opacity 1.0 override 0.8 override, class:^(popup)$ +windowrulev2 = float, noanim, stayfocused, maxsize 1280 800, center, opacity 1.0 override, class:^(kakpopup)$ +windowrule = float, ^(openrgb)$ +windowrule = float, ^(org.kde.*)$ +# windowrule = float, ^(org.kde.okular)$ +# windowrule = float, ^(org.kde.gwenview)$ +# windowrule = float, ^(org.kde.skanlite)$ + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$suremod = SUPER ALT CTRL +$mainmod = SUPER + +# binds that don't want to get fat-fingered +bind = $suremod, Q, killactive, +bind = $suremod, M, exit, +bind = $suremod, F, fullscreen,0 +bind = $suremod, Return, exec, konsole +bind = $suremod, D, denywindowfromgroup, toggle +bind = $suremod, V, togglefloating, + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainmod, Return, exec, foot -L /usr/bin/fish -- +bind = $mainmod Shift, Return, exec, foot -w 1280x800 -a popup -L /usr/bin/fish -- +bind = $mainmod, E, exec, dolphin +bind = $mainmod, F, fullscreen,1 +bind = $mainmod, V, exec, killall fuzzel || cliphist list | fuzzel -d -w 100 | cliphist decode | wl-copy +bind = $mainmod, D, exec, killall fuzzel || fuzzel +bind = $mainmod, R, exec, killall rofi || rofi -show run # rofi installed for keepassxc-browser script +bind = $mainmod, P, pseudo, # dwindle +bind = $mainmod, S, togglesplit, # dwindle +bind = ALT SHIFT, F12, exec, ~/.config/hypr/scripts/gamemode.sh +bind = $mainmod, G, togglegroup +bind = $mainmod SHIFT, G, lockactivegroup, toggle +bind = $mainmod, TAB, focuscurrentorlast + +# Move focus with mainMod + arrow keys +bind = $mainmod, left, movefocus, l +bind = $mainmod, right, movefocus, r +bind = $mainmod, up, movefocus, u +bind = $mainmod, down, movefocus, d +bind = $mainmod, H, movefocus, l +bind = $mainmod, L, movefocus, r +bind = $mainmod, K, movefocus, u +bind = $mainmod, J, movefocus, d + +# Move windows or groups with mainMod + Shift + arrow keys +bind = $mainmod SHIFT, left, movewindoworgroup, l +bind = $mainmod SHIFT, right, movewindoworgroup, r +bind = $mainmod SHIFT, up, movewindoworgroup, u +bind = $mainmod SHIFT, down, movewindoworgroup, d +bind = $mainmod SHIFT, H, movewindoworgroup, l +bind = $mainmod SHIFT, L, movewindoworgroup, r +bind = $mainmod SHIFT, K, movewindoworgroup, u +bind = $mainmod SHIFT, J, movewindoworgroup, d + +# Move windows into groups +bind = $mainmod ALT, left, moveintogroup, l +bind = $mainmod ALT, right, moveintogroup, r +bind = $mainmod ALT, up, moveintogroup, u +bind = $mainmod ALT, down, moveintogroup, d +bind = $mainmod ALT, H, moveintogroup, l +bind = $mainmod ALT, L, moveintogroup, r +bind = $mainmod ALT, K, moveintogroup, u +bind = $mainmod ALT, J, moveintogroup, d + +# Move windows out of groups +bind = $mainmod SHIFT ALT, left, moveoutofgroup, l +bind = $mainmod SHIFT ALT, right, moveoutofgroup, r +bind = $mainmod SHIFT ALT, up, moveoutofgroup, u +bind = $mainmod SHIFT ALT, down, moveoutofgroup, d +bind = $mainmod SHIFT ALT, H, moveoutofgroup, l +bind = $mainmod SHIFT ALT, L, moveoutofgroup, r +bind = $mainmod SHIFT ALT, K, moveoutofgroup, u +bind = $mainmod SHIFT ALT, J, moveoutofgroup, d + +# Switch through group windows +bind = $mainmod, O, changegroupactive, f +bind = $mainmod, U, changegroupactive, b + +# Switch workspaces with mainMod + [0-9] +bind = $mainmod, 1, workspace, 1 +bind = $mainmod, 2, workspace, 2 +bind = $mainmod, 3, workspace, 3 +bind = $mainmod, 4, workspace, 4 +bind = $mainmod, 5, workspace, 5 +bind = $mainmod, 6, workspace, 6 +bind = $mainmod, 7, workspace, 7 +bind = $mainmod, 8, workspace, 8 +bind = $mainmod, 9, workspace, 9 +bind = $mainmod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainmod SHIFT, 1, movetoworkspace, 1 +bind = $mainmod SHIFT, 2, movetoworkspace, 2 +bind = $mainmod SHIFT, 3, movetoworkspace, 3 +bind = $mainmod SHIFT, 4, movetoworkspace, 4 +bind = $mainmod SHIFT, 5, movetoworkspace, 5 +bind = $mainmod SHIFT, 6, movetoworkspace, 6 +bind = $mainmod SHIFT, 7, movetoworkspace, 7 +bind = $mainmod SHIFT, 8, movetoworkspace, 8 +bind = $mainmod SHIFT, 9, movetoworkspace, 9 +bind = $mainmod SHIFT, 0, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainmod, mouse_down, workspace, e+1 +bind = $mainmod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainmod, mouse:272, movewindow +bindm = $mainmod, mouse:273, resizewindow + +# media keys +bind = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ +bind = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- +bind = , XF86AudioMute, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% +bind = , XF86AudioPlay, exec, playerctl play-pause +bind = , XF86AudioNext, exec, playerctl next +bind = , XF86AudioPrev, exec, playerctl previous +bind = , XF86audiostop, exec, playerctl stop + +# printscr +bind = $mainmod, Print, exec, grim -g "$(slurp)" - | swappy -f - + +# 'scratchpad +bind = $mainmod, I, togglespecialworkspace, overlay +bind = $mainmod SHIFT, I, movetoworkspace, special:overlay diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf new file mode 100644 index 00000000..dfc9e4c7 --- /dev/null +++ b/config/hypr/hyprpaper.conf @@ -0,0 +1,5 @@ +preload = /mnt/multimedia/Wallpapers/wp10330139-5120x1440-star-wars-wallpapers.jpg +wallpaper = DP-3,/mnt/multimedia/Wallpapers/wp10330139-5120x1440-star-wars-wallpapers.jpg + +ipc = on + diff --git a/config/hypr/scripts/daemons.sh b/config/hypr/scripts/daemons.sh new file mode 100755 index 00000000..f25aefa2 --- /dev/null +++ b/config/hypr/scripts/daemons.sh @@ -0,0 +1,23 @@ +#!/bin/env bash +logger '==============================' +logger 'userland daemons startup begin' + + +if [[ ! $(pidof mpd) ]]; then + mpd && mpd-mpris & + logger 'mpd started' +fi + +if [[ ! $(pidof swww-daemon) ]]; then + swww init & + logger 'swww-daemon started' + swww img ~/Bilder/Wallpapers/default.jpg & +fi + +openrgb -p simple.orp & +kak -d -s default & # kakoune default server + +wl-paste --type text --watch cliphist store & +wl-paste --type image --watch cliphist store & + +sleep 2 && logger 'userland daemons startup begin' && logger '==============================' diff --git a/config/hypr/scripts/gamemode.sh b/config/hypr/scripts/gamemode.sh new file mode 100755 index 00000000..f97d4f4f --- /dev/null +++ b/config/hypr/scripts/gamemode.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +HYPRGAMEMODE=$(hyprctl getoption animations:enabled | sed -n '2p' | awk '{print $2}') +if [ $HYPRGAMEMODE = 1 ] ; then + hyprctl --batch "\ + keyword animations:enabled 0;\ + keyword decoration:drop_shadow 0;\ + keyword decoration:blur 0;\ + keyword general:gaps_in 0;\ + keyword general:gaps_out 0;\ + keyword general:border_size 1;\ + keyword decoration:rounding 0" + exit +fi +hyprctl reload + diff --git a/config/hypr/scripts/powermenu.sh b/config/hypr/scripts/powermenu.sh new file mode 100755 index 00000000..fe73800a --- /dev/null +++ b/config/hypr/scripts/powermenu.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# shamelessly stolen from https://github.com/luispabon/sway-dotfiles + +entries="⇠ Logout\n⏾ Suspend\n⭮ Reboot\n⏻ Shutdown" + +selected=$(echo -e $entries|wofi --width 250 --height 210 --dmenu --cache-file /dev/null | awk '{print tolower($2)}') + +case $selected in + logout) + hyprctl dispatch exit;; + suspend) + exec loginctl suspend;; + reboot) + exec loginctl reboot;; + shutdown) + exec loginctl poweroff -i;; +esac diff --git a/config/hypr/scripts/startup.sh b/config/hypr/scripts/startup.sh new file mode 100755 index 00000000..da33dd69 --- /dev/null +++ b/config/hypr/scripts/startup.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +logger '============================' +logger 'hyperland main startup begin' + +CONFIG="$HOME/.config/mako/config" + +if [[ ! -d "$XDG_RUNTIME_DIR" ]] ; then + # shellcheck disable=SC2155 + # shellcheck disable=SC2046 + export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) + logger 'xdg-runtime dir set' +fi + +if [[ ! "$DBUS_SESSION_BUS_ADDRESS" ]]; then + dbus-daemon --session --address=unix:path="$XDG_RUNTIME_DIR"/bus & + logger 'dbus session daemon started' +fi + +if [[ ! $(pidof /usr/lib64/libexec/polkit-kde-authentication-agent-1) ]]; then + /usr/lib64/libexec/polkit-kde-authentication-agent-1 & + logger 'polit-kde started' +fi + +if [[ ! $(pidof mako) ]]; then + mako --config "${CONFIG}" & + logger 'mako started' +fi + +killall xdg-desktop-portal-hyprland +killall xdg-desktop-portal-gnome +killall xdg-desktop-portal-gtk +killall xdg-desktop-portal-kde +killall xdg-desktop-portal-wlr +killall xdg-desktop-portal +logger 'killed all xdg-desktop' +sleep 1 +/usr/lib64/libexec/xdg-desktop-portal-kde & +logger 'xdg-desktop-portal-kde started' +sleep 1 +/usr/libexec/xdg-desktop-portal-hyprland & +logger 'xdg-desktop-portal-hyprland started' +sleep 2 +/usr/libexec/xdg-desktop-portal & +logger 'xdg-desktop-portal started' + +if [[ ! $(pidof pipewire) ]]; then + gentoo-pipewire-launcher & + logger 'gentoo-pipewire-launcher started' +else + gentoo-pipewire-launcher restart & + logger 'gentoo-pipewire-launcher (re-)started' +fi + +if [[ ! $(pidof waybar) ]]; then + waybar & + logger 'waybar started' +fi + +sleep 2 && logger 'hyperland main startup begin' && logger '============================' + diff --git a/config/hypr/scripts/xdg-desktop-portal.sh b/config/hypr/scripts/xdg-desktop-portal.sh new file mode 100755 index 00000000..b2ab7ed0 --- /dev/null +++ b/config/hypr/scripts/xdg-desktop-portal.sh @@ -0,0 +1,17 @@ +#!/bin/bash +killall xdg-desktop-portal-hyprland +killall xdg-desktop-portal-gnome +killall xdg-desktop-portal-gnome +killall xdg-desktop-portal-kde +killall xdg-desktop-portal-wlr +killall xdg-desktop-portal +logger 'killed all xdg-desktop' +sleep 1 +/usr/lib64/libexec/xdg-desktop-portal-kde & +logger 'xdg-desktop-portal-kde started' +sleep 1 +/usr/libexec/xdg-desktop-portal-hyprland & +logger 'xdg-desktop-portal-hyprland started' +sleep 2 +/usr/libexec/xdg-desktop-portal & +logger 'xdg-desktop-portal started' diff --git a/config/kak/colors/base16.kak b/config/kak/colors/base16.kak new file mode 100644 index 00000000..0ae479e0 --- /dev/null +++ b/config/kak/colors/base16.kak @@ -0,0 +1,76 @@ +## +## base16.kak by lenormf +## + +evaluate-commands %sh{ + black_lighterer='rgb:383838' + black_lighter='rgb:2D2D2D' + black_light='rgb:1C1C1C' + cyan_light='rgb:7CB0FF' + green_dark='rgb:A1B56C' + grey_dark='rgb:585858' + grey_medium='rgb:989898' + grey_light='rgb:D8D8D8' + magenta_dark='rgb:AB4642' + magenta_light='rgb:AB4434' + orange_dark='rgb:DC9656' + orange_light='rgb:F7CA88' + purple_dark='rgb:BA8BAF' + + ## code + echo " + face global value ${orange_dark}+b + face global type ${orange_light} + face global variable ${magenta_dark} + face global module ${green_dark} + face global function ${cyan_light} + face global string ${green_dark} + face global keyword ${purple_dark}+b + face global operator ${cyan_light} + face global attribute ${orange_dark} + face global comment ${grey_medium} + face global documentation comment + face global meta ${orange_light} + face global builtin default+b + " + + ## markup + echo " + face global title blue + face global header ${cyan_light} + face global mono ${green_dark} + face global block ${orange_dark} + face global link blue + face global bullet ${magenta_light} + face global list ${magenta_dark} + " + + ## builtin + echo " + face global Default ${grey_light},${black_light} + face global PrimarySelection white,blue+fg + face global SecondarySelection black,blue+fg + face global PrimaryCursor black,white+fg + face global SecondaryCursor black,white+fg + face global PrimaryCursorEol black,${cyan_light}+fg + face global SecondaryCursorEol black,${cyan_light}+fg + face global LineNumbers ${grey_light},${black_lighter} + face global LineNumberCursor ${grey_light},rgb:282828+b + face global MenuForeground ${grey_light},blue + face global MenuBackground blue,${grey_light} + face global MenuInfo ${cyan_light} + face global Information ${black_light},${cyan_light} + face global Error ${grey_light},${magenta_light} + face global DiagnosticError ${magenta_light} + face global DiagnosticWarning ${cyan_light} + face global StatusLine ${grey_light},${black_lighterer} + face global StatusLineMode ${orange_dark} + face global StatusLineInfo ${cyan_light} + face global StatusLineValue ${green_dark} + face global StatusCursor ${black_lighterer},${cyan_light} + face global Prompt ${black_light},${cyan_light} + face global MatchingChar ${cyan_light},${black_light}+b + face global BufferPadding ${cyan_light},${black_lighter} + face global Whitespace ${grey_dark}+f + " +} diff --git a/config/kak/colors/dabruin.kak b/config/kak/colors/dabruin.kak new file mode 120000 index 00000000..da4a46bd --- /dev/null +++ b/config/kak/colors/dabruin.kak @@ -0,0 +1 @@ +../plugins/dabruin.kak/dabruin.kak \ No newline at end of file diff --git a/config/kak/kakrc b/config/kak/kakrc new file mode 100644 index 00000000..bf62166d --- /dev/null +++ b/config/kak/kakrc @@ -0,0 +1,270 @@ +# Clipboard (wayland) integration +# ────────────────────────────────────────────────────────────────────────────── +hook global NormalKey y %{ nop %sh{ + printf %s "$kak_main_reg_dquote" | wl-copy > /dev/null 2>&1 & +}} + +# Enable PLUGin manager +# ────────────────────────────────────────────────────────────────────────────── +source "%val{config}/plugins/plug.kak/rc/plug.kak" +plug "andreyorst/plug.kak" noload + plug "Ersikan/bookmarks.kak" %{ + hook global WinCreate .* bookmarks-enable + } + plug "andreyorst/smarttab.kak" defer smarttab %{ + # when 'backspace' is pressed, 4 spaces are deleted at once + set-option global softtabstop 4 + } config %{ + hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|py|sh|perl) expandtab + hook global WinSetOption filetype=(makefile|gas) noexpandtab + hook global WinSetOption filetype=(c|cpp) smarttab + } + plug "whereswaldon/shellcheck.kak" + plug "occivink/kakoune-filetree" + plug "occivink/kakoune-sudo-write" + plug "occivink/kakoune-find" + plug "foot.kak" + plug "https://git.sr.ht/~nasmevka/dabruin.kak" + plug "andreyorst/powerline.kak" defer powerline_freerunner %{ + powerline-format global 'mode_info git bufname session client line_column position ' + powerline-theme freerunner + powerline-separator triangle + } config %{ + powerline-start + } + plug "raiguard/kak-harpoon" %{ + hook global WinCreate .* harpoon-add-bindings + } + + +# Look and Feel +# ────────────────────────────────────────────────────────────────────────────── +add-highlighter global/trailing-whitespace regex '\h+$' 0:Error # trailing whitespaces in red +add-highlighter global/todos regex '(//|#|/\*)\h*(TODO|WARNING|FIXME)[:]?[^\n]*' 2:+bu # highlight comment tags +add-highlighter global/ show-matching # show matching brackets +add-highlighter global/ number-lines -min-digits 3 # absolute line nums everywhere +colorscheme dabruin +set-option global tabstop 4 +set-option global indentwidth 4 + + +# dynamic scrolloff +# ────────────────────────────────────────────────────────────────────────────── +hook global WinCreate [^*].* %{ + hook -once window WinDisplay .* %{ + hook window WinResize [0-9]*\.[0-9]* %{ + set-option window scrolloff %sh{ + printf '%u,%u' "$(($kak_window_height / 6))" "$(($kak_window_width / 8))" + } + } + } +} + + +# Different Cursor color in insert mode +# ────────────────────────────────────────────────────────────────────────────── +# Shades of blue/cyan for normal mode +set-face global PrimarySelection white,blue+F +set-face global SecondarySelection black,blue+F +set-face global PrimaryCursor black,bright-cyan+F +set-face global SecondaryCursor black,bright-blue+F +set-face global PrimaryCursorEol black,bright-cyan +set-face global SecondaryCursorEol black,bright-blue + +# Shades of green/yellow for insert mode. +hook global ModeChange (push|pop):.*:insert %{ + set-face window PrimarySelection black,yellow+F + set-face window SecondarySelection black,yellow+F + set-face window PrimaryCursor black,bright-red+F + set-face window SecondaryCursor black,bright-yellow+F + set-face window PrimaryCursorEol black,bright-red + set-face window SecondaryCursorEol black,bright-yellow +} + +# Undo colour changes when we leave insert mode. +hook global ModeChange (push|pop):insert:.* %{ + unset-face window PrimarySelection + unset-face window SecondarySelection + unset-face window PrimaryCursor + unset-face window SecondaryCursor + unset-face window PrimaryCursorEol + unset-face window SecondaryCursorEol +} + + +# Enable editor config +# ────────────────────────────────────────────────────────────────────────────── +hook global WinCreate ^[^*]+$ %{ editorconfig-load } + + +# Extra editor commands +# ────────────────────────────────────────────────────────────────────────────── +# tab replacement +define-command clean-selections -docstring 'Replace tabs with spaces and trim trailing whitespace' %{ try %{ + execute-keys -draft @s\h+$d +} } +define-command clean-buffer -docstring 'Replace tabs with spaces and trim trailing whitespace' %{ try %{ + execute-keys -draft \%@s\h+$d +} } +# Bring back and from Vim to increment/decrement the number under the cursor +define-command -hidden -params 2 inc %{ try %{ + evaluate-commands %sh{ + [ "$1" = 0 ] && count=1 || count="$1" + printf '%s%s' 'exec h"_/\dna' "$2($count)|{catecho}|bc" + } +} catch %{ + execute-keys l +}} + + +# Various mappings +# ────────────────────────────────────────────────────────────────────────────── +map global normal '#' :comment-line -docstring 'comment line' +map global normal '' :comment-block -docstring 'comment block' +map global goto m 'm;' -docstring 'matching char' +map -docstring 'select lines downwards' global normal X TLx +# see #inc +map global normal ': inc %val{count} +' +map global normal ': inc %val{count} -' +map global normal Q q # map q to Q +#map global normal q -docstring 'tabs mode' ': enter-user-mode tabs' # map q to tabs mode + + +# default user mode +# ────────────────────────────────────────────────────────────────────────────── +map global user -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert' +map global user -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert' +map global user -docstring 'edit kakrc' e ': e ~/.config/kak/kakrc' +map global user -docstring 'clean tabs and trailing whitespace in selections' c ': clean-selections' +map global user -docstring 'clean tabs and trailing whitespace in the buffer' C ': clean-buffer' +map global user -docstring 'buffer backward' b ': buffer-previous' +map global user -docstring 'buffer forward' n ': buffer-next' +map global user -docstring 'lint-buffer' L ': buffer *lint-output*' +map global user -docstring 'relative line numbers enable' r ': add-highlighter window/nl number-lines -relative -hlcursor' +map global user -docstring 'relative line numbers disable' R ': remove-highlighter window/nl' +map global user -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap' +map global user -docstring 'wrap disable' W ': remove-highlighter buffer/bw' + + +# terminal config (via foot.kak) +# ────────────────────────────────────────────────────────────────────────────── +set-option global foot_normal_cmd 'foot' +set-option global foot_popup_cmd 'foot' +set-option global foot_normal_flags '' +set-option global foot_popup_flags '-a kakpopup' +set-option global foot_panel_cmd 'foot' + + +# # suspend and resume +# # # ────────── +# def suspend-and-resume \ +# -params 1..2 \ +# -docstring 'suspend-and-resume []: backgrounds current kakoune client and runs specified cli command. Upon exit of command the optional kak command is executed.' \ +# %{ evaluate-commands %sh{ + +# # Note we are adding '&& fg' which resumes the kakoune client process after the cli command exits +# cli_cmd="$1 && fg" +# post_resume_cmd="$2" + +# # automation is different platform to platform +# platform=$(uname -s) +# case $platform in +# Darwin) +# automate_cmd="sleep 0.01; osascript -e 'tell application \"System Events\" to keystroke \"$cli_cmd\" & return '" +# kill_cmd="/bin/kill" +# break +# ;; +# Linux) +# automate_cmd="sleep 0.2; xdotool type '$cli_cmd'; xdotool key Return" +# kill_cmd="/usr/bin/kill" +# break +# ;; +# esac + +# # Uses platforms automation to schedule the typing of our cli command +# nohup sh -c "$automate_cmd" > /dev/null 2>&1 & +# # Send kakoune client to the background +# $kill_cmd -SIGTSTP $kak_client_pid + +# # ...At this point the kakoune client is paused until the " && fg " gets run in the $automate_cmd + +# # Upon resume, run the kak command is specified +# if [ ! -z "$post_resume_cmd" ]; then +# echo "$post_resume_cmd" +# fi +# }} + +# def for-each-line \ +# -docstring "for-each-line : run command with the value of each line in the file" \ +# -params 2 \ +# %{ evaluate-commands %sh{ + +# while read f; do +# printf "$1 $f\n" +# done < "$2" +# }} + +# def toggle-ranger %{ +# suspend-and-resume \ +# "ranger --choosefiles=/tmp/ranger-files-%val{client_pid}" \ +# "for-each-line edit /tmp/ranger-files-%val{client_pid}" +# } + +# map global user f ': toggle-ranger' -docstring 'select files in ranger' + + +# run on file open +# ────────────────────────────────────────────────────────────────────────────── +hook global BufOpenFile .* %{ + modeline-parse +} + +# session manager +# ────────────────────────────────────────────────────────────────────────────── +evaluate-commands %sh{ + kcr init kakoune +} + +# kakoune.cr Mappings +map -docstring 'new client' global normal ': new' +map -docstring 'terminal (popup)' global normal ': connect terminal-popup' +map -docstring 'git (popup)' global normal ': connect terminal-popup gitui' +#map -docstring 'file explorer' global normal ': connect terminal-panel sidetree --select %val{buffile}' +map -docstring 'file picker' global normal ': connect terminal-popup kcr fzf files' +map -docstring 'buffer picker' global normal ': connect terminal-popup kcr fzf buffers' +map global normal +unmap global normal +map -docstring 'buffer picker' global normal ': connect terminal-popup kcr fzf buffers' +map -docstring 'grep picker' global normal ': connect terminal-popup kcr fzf grep' +#map -docstring 'grep picker (buffer)' global normal ': connect terminal-popup kcr fzf grep %val{buflist}' + + +# Reload kakrc and .kak when saving. +# ────────────────────────────────────────────────────────────────────────────── +# Adds -override to definitions (unless they seem to be python defs!) +# Evals provide module directly + +def resource -params 1 %{ + eval %sh{ + file=$(dirname "$1")/.reload.kak + cat "$1" | + sed 's/^def \([^:]*\)$/def -override \1/' | + sed 's/^define-command /def -override /' | + sed 's/^addhl /addhl -override/' | + sed 's/^add-highlighter /addhl -override /' | + sed 's/^provide-module \w\+ /eval /' | + cat > "$file" + printf %s " + source $file + nop %sh{ + rm $file + } + " + } + echo Reloaded %arg{1} +} + +rmhooks global reload-kak +hook -group reload-kak global BufWritePost (.*kakrc|.*\.kak) %{ + resource %val{hook_param} +} diff --git a/config/kak/plugins/bookmarks.kak/LICENSE b/config/kak/plugins/bookmarks.kak/LICENSE new file mode 100644 index 00000000..e95f6f94 --- /dev/null +++ b/config/kak/plugins/bookmarks.kak/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Ersikan + +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. diff --git a/config/kak/plugins/bookmarks.kak/README.md b/config/kak/plugins/bookmarks.kak/README.md new file mode 100644 index 00000000..3ddb5b5f --- /dev/null +++ b/config/kak/plugins/bookmarks.kak/README.md @@ -0,0 +1,30 @@ +# bookmarks.kak + +A bookmarks plugin for the kakoune editor. + +## Installation + +The recommended way to install this plugin is using [plug.kak](https://github.com/andreyorst/plug.kak). + +```kak +plug "Ersikan/bookmarks.kak" +``` + +## Configuration + +You can enable the bookmarks user mode for all windows like this : +```kak +plug "Ersikan/bookmarks.kak" %{ + hook global WinCreate .* bookmarks-enable +} +``` + +## Usage + +`bookmarks-enable` enables the `bookmarks` user mode, which can be entered by pressing `,b`. + +`bookmarks-add` (`,ba`) adds a new bookmark at the current cursor position. + +`bookmarks-delete` (`,bd`) deletes an existing bookmark. + +`bookmarks-menu` (`,bb`) jumps to a specific bookmark. diff --git a/config/kak/plugins/bookmarks.kak/bookmarks.kak b/config/kak/plugins/bookmarks.kak/bookmarks.kak new file mode 100644 index 00000000..d069020e --- /dev/null +++ b/config/kak/plugins/bookmarks.kak/bookmarks.kak @@ -0,0 +1,92 @@ +declare-option -hidden line-specs bookmarks + +declare-user-mode bookmarks + +map global bookmarks j ': bookmarks-menu' -docstring "Jump to a bookmark" +map global bookmarks d ': bookmarks-delete' -docstring "Delete a bookmark" +map global bookmarks a ': bookmarks-add' -docstring "Bookmark current cursor position" + +define-command bookmarks-enable %{ + map window user j ': enter-user-mode bookmarks' -docstring "Bookmarks mode" +} -docstring "Enables bookmarks user mode" + +define-command bookmarks-disable %{ + unmap window user j ': enter-user-mode bookmarks' +} -docstring "Disables bookmarks user mode" + +define-command bookmarks-add %{ + prompt "Bookmark name:" %{ + update-option window bookmarks + set-option -add window bookmarks "%val{cursor_line}|%val{text}" + } +} + +define-command bookmarks-menu %{ + bookmarks-menu-command bookmarks-jump-id +} + +define-command bookmarks-delete %{ + bookmarks-menu-command bookmarks-delete-id +} + +define-command -params 1 bookmarks-menu-command %{ evaluate-commands %sh{ + arg=$1 + eval set -- ${kak_quoted_opt_bookmarks} + shift + + if [ $# -eq 0 ] ; then + printf "fail 'Bookmarks list is empty'\n" + exit + fi + + + # Start the menu + printf 'menu ' + + # Iterate over bookmarks + i=1 + for bookmark; do + #printf 'echo -debug "bookmark %i: %s"\n' $i "$bookmark" + name=$(printf "$bookmark" | cut -s -d '|' -f 2) + + # Print the menu entry + printf "'%s' '%s %i' " "$name" "$arg" $i + + i=$((i+1)) + done +}} + +define-command -params 1 bookmarks-jump-id %{ + update-option window bookmarks + evaluate-commands %sh{ + arg=$1 + eval set -- ${kak_quoted_opt_bookmarks} + shift $arg + line=$(printf "$1" | cut -s -d '|' -f 1) + name=$(printf "$1" | cut -s -d '|' -f 2) + if [ -z "$line" -o -z "$name"]; then + printf 'fail "Invalid bookmark number: %s"\n' "$arg" + else + printf "execute-keys '%ig'\n" "$line" + printf "echo 'bookmark arg $arg line $line name $name'\n" + printf "info 'Went to bookmark \"$name\"'" + fi +}} + +define-command -params 1 bookmarks-delete-id %{ + update-option window bookmarks + evaluate-commands %sh{ + arg="$1" + eval set -- ${kak_quoted_opt_bookmarks} + shift + printf 'set-option window bookmarks %%val{timestamp}' + i=1 + for bookmark; do + if [ $i -ne "$arg" ] ; then + printf " '%s'" "$bookmark" + fi + i=$((i+1)) + done + } +} + diff --git a/config/kak/plugins/dabruin.kak b/config/kak/plugins/dabruin.kak new file mode 160000 index 00000000..1bb17f3f --- /dev/null +++ b/config/kak/plugins/dabruin.kak @@ -0,0 +1 @@ +Subproject commit 1bb17f3ffcee620a7985a4bdcaa07a053e4e9ded diff --git a/config/kak/plugins/foot.kak b/config/kak/plugins/foot.kak new file mode 160000 index 00000000..406cbadd --- /dev/null +++ b/config/kak/plugins/foot.kak @@ -0,0 +1 @@ +Subproject commit 406cbaddb7daaeb33a308557b4faf94697bcc91a diff --git a/config/kak/plugins/kak-harpoon b/config/kak/plugins/kak-harpoon new file mode 160000 index 00000000..15e0a01d --- /dev/null +++ b/config/kak/plugins/kak-harpoon @@ -0,0 +1 @@ +Subproject commit 15e0a01d2c5720c576375e7e6b271a5f84dcad2a diff --git a/config/kak/plugins/kakoune-filetree b/config/kak/plugins/kakoune-filetree new file mode 160000 index 00000000..be8158ce --- /dev/null +++ b/config/kak/plugins/kakoune-filetree @@ -0,0 +1 @@ +Subproject commit be8158ce83e295830a48057c0580fe17a843d661 diff --git a/config/kak/plugins/kakoune-find b/config/kak/plugins/kakoune-find new file mode 160000 index 00000000..09afcc85 --- /dev/null +++ b/config/kak/plugins/kakoune-find @@ -0,0 +1 @@ +Subproject commit 09afcc8520d4c92928fe69da4c370b9979aa90d3 diff --git a/config/kak/plugins/kakoune-sudo-write b/config/kak/plugins/kakoune-sudo-write new file mode 160000 index 00000000..ec0d6d26 --- /dev/null +++ b/config/kak/plugins/kakoune-sudo-write @@ -0,0 +1 @@ +Subproject commit ec0d6d26ceaadd93d6824630ba587b31e442214d diff --git a/config/kak/plugins/plug.kak/LICENSE b/config/kak/plugins/plug.kak/LICENSE new file mode 100644 index 00000000..fb09a1ac --- /dev/null +++ b/config/kak/plugins/plug.kak/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Andrey Orst + +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. diff --git a/config/kak/plugins/plug.kak/README.md b/config/kak/plugins/plug.kak/README.md new file mode 100644 index 00000000..94222727 --- /dev/null +++ b/config/kak/plugins/plug.kak/README.md @@ -0,0 +1,378 @@ +# plug.kak +[![GitHub issues][1]][2] ![license][3] + +![plug.kak][4] + +**plug.kak** is a plugin manager for Kakoune, that was inspired by [vim-plug][5] and [use-package][6]. +It can install and update plugins, run post-update actions, and helps to encapsulate the configuration within itself. + + +## Installation + +**plug.kak** can be installed anywhere in your system, but in order to update itself, it is required to install **plug.kak** in the plugin installation directory. +By default, **plug.kak** installs plugins to the `%val{config}/plugins`, which is usually at `$HOME/.config/kak/plugins`: + +``` sh +mkdir -p $HOME/.config/kak/plugins +git clone https://github.com/andreyorst/plug.kak.git $HOME/.config/kak/plugins/plug.kak +``` + +Now, when **plug.kak** is installed, we need to tell Kakoune about it. +Add this to the `kakrc` file: + +``` kak +source "%val{config}/plugins/plug.kak/rc/plug.kak" +plug "andreyorst/plug.kak" noload +``` + +Alternatively, this process can be automated, by adding the following snippet to the `kakrc`: + +``` sh +evaluate-commands %sh{ + plugins="$kak_config/plugins" + mkdir -p "$plugins" + [ ! -e "$plugins/plug.kak" ] && \ + git clone -q https://github.com/andreyorst/plug.kak.git "$plugins/plug.kak" + printf "%s\n" "source '$plugins/plug.kak/rc/plug.kak'" +} +plug "andreyorst/plug.kak" noload +``` + +This will create all needed directories on Kakoune launch, and download **plug.kak** if it is not installed already. + +**Note**: `plug "andreyorst/plug.kak" noload` is needed to register **plug.kak** as manually loaded plugin, so `plug-clean` will not delete **plug.kak**. + + +## Usage + +All plugins are installed and loaded with the `plug` command. +This command accepts one-or-more arguments, which are keywords and attributes, that change how **plug.kak** behaves. + +The first strict rule of the `plug` command is that the first argument is always the plugin name formatted as in GitHub URL: `"author/repository"`. + +``` kak +plug "author/repository" +``` + +By default **plug.kak** will look for the plugin at GitHub.com, and download it. +When the plugin is hosted on a different service, a URL can be used as the first argument. +So in most cases it is enough to add this to the `kakrc` to use a plugin: + +```kak +plug "delapouite/kakoune-text-objects" +``` + +Or with URL: + +```kak +plug "https://gitlab.com/Screwtapello/kakoune-inc-dec" +``` + +After adding this, `kakrc` needs to be re-sourced to let **plug.kak** know that configuration was changed. +Alternatively, Kakoune can be restarted. +After that newly added plugins can be installed with the `plug-install` command. +More information about other commands available in [Commands](#Commands) section. + + +### Keywords and attributes + +The `plug` command accepts optional attributes, that change how **plug.kak** works, or add additional steps for `plug` to perform. + +These keywords are supported: + +- [branch, tag, commit](#branch-tag-or-commit) +- [load-path](#loading-plugin-from-different-path) +- [noload](#skipping-loading-of-a-plugin) +- [do](#automatically-do-certain-tasks-on-install-or-update) +- [theme](#installing-color-schemes) +- [config](#handling-user-configurations) +- [defer](#deferring-plugin-configuration) +- [demand](#demanding-plugin-module-configuration) +- [ensure](#ensuring-that-plugins-are-installed) + + +#### Branch, Tag or Commit + +`plug` can checkout a plugin to desired branch, commit or tag before loading it. +It can be done by adding the following keywords with parameters: `branch "branch_name"`, `tag "tag_name"` or `commit "commit_hash"`. + + +#### Loading plugin from different path + +Plugins can be loaded from arbitrary path by specifying the `load-path` keyword and providing the path as an argument: + +``` kak +plug "plugin_name" load-path "~/Development/plugin_dir" +``` + +However all `plug` related commands, like `plug-update` or `plug-clean` will not work for plugins that aren't installed to `plug_install_dir`. + + +#### Skipping loading of a plugin + +If plugin needs to be loaded manually, the `noload` keyword can be used. +This can also be used to avoid loading the plugin second time, like in the example with **plug.kak** from the [installation](#installation) section: + +```kak +source "%val{config}/plugins/plug.kak/rc/plug.kak" +plug "andreyorst/plug.kak" noload +``` + +Note, that plugins with the `noload` keyword are still configured and managed. +See [handling-user-configuration](#handling-user-configurations) for more details. + + +#### Automatically do certain tasks on install or update + +When the plugin requires some additional steps to preform after installation or update, the `do` keyword can be used. +This keyword expects the body which will be executed in the shell, thus it can only contain shell commands, not Kakoune commands. + +```kak +plug "ul/kak-lsp" do %{ + cargo build --release --locked + cargo install --force --path . +} +``` + +In the example above **plug.kak** will run these `cargo` commands after `kak-lsp` was installed or updated. + +**Note** that even though this is technically a shell expansion, the `%sh{}` expansion can't be used with `do`, as it will be evaluated immediately each time `kakrc` loaded. +Use `%{}` instead. + + +#### Installing color schemes + +To register the plugin as a color scheme, use `theme` keyword. +Such plugins will be copied to the `%val{config}/colors` directory. + +```kak +plug "andreyorst/base16-gruvbox.kak" theme config %{ + colorscheme base16-gruvbox-dark-soft +} +``` + + +#### Ensuring that plugins are installed + +`plug` command can be explicitly told to install the plugin automatically with the `ensure` keyword. +The `plug_always_ensure` option can be set to `true` to perform this for each and every plugin specified in the `kakrc`. + +Note that `ensure` plugins are installed (if missing) in a background job; they are then only loaded when the install finishes. +Thus, subsequent `kakrc` commands should not depend on functionality provided by such plugins. +Only use `ensure` with non-essential plugins, which are not required for `kakrc` to complete loading. + + +#### Handling user configurations + +The configuration of the plugin is performed only when the plugin is installed. +There's a second strict rule of `plug` command: every parameter that doesn't have a keyword before it, is treated as plugin configuration. +For example: + +```kak +plug "andreyorst/fzf.kak" config %{ + map -docstring 'fzf mode' global normal '' ': fzf-mode' +} +``` + +Here, `plug` will map Ctrl+p key only if the plugin is installed. +Everything within the `config %{}` block is an ordinary kakscript. + +The `config` keyword is optional, and can be skipped. +Multiple `config` blocks are also supported. + + +#### Commenting out `plug` options + +It may be tricky to "toggle" `plug` options, for debugging or testing purposes, because it is impossible to continue a command past a `#...` comment (also, `config` blocks usually span multiple lines). +To solve this, `plug` supports a `comment` keyword that ignores its next argument. +For example, to toggle a `load-path` option, wrap it in `comment %{}`; then remove the "wrapper" to turn it back on (without having to re-type the full path): +```kak +plug "andreyorst/fzf.kak" comment %{load-path /usr/local/src/fzf} config %{ + # ... +} +``` + + +### Deferring plugin configuration + +With the introduction of the module system, some configurations have to be preformed after loading the module. +The `defer` keyword is a shorthand to register a `ModuleLoaded` hook for given `module`. +You need to **`require` the module explicitly** elsewhere. + +Below is the configuration of [fzf.kak](https://github.com/andreyorst/fzf.kak) plugin, which provides the `fzf` module: + +```kak +plug "andreyorst/fzf.kak" config %{ + map -docstring 'fzf mode' global normal '' ': fzf-mode' +} defer fzf %{ + set-option global fzf_preview_width '65%' + set-option global fzf_project_use_tilda true +} +``` + +**Note**: the `ModuleLoaded` hook is defined as early as possible - before sourcing any of plugin files. + +### Demanding plugin module configuration + +Works the same as `defer` except requires the module immediately: + +```kak +plug "andreyorst/fzf.kak" config %{ + # config1 (evaluated before demanding the module) +} demand fzf %{ + # demand block (will generate `require-modlue fzf` call, and a respective hook) + set-option global fzf_project_use_tilda true +} config %{ + # config2 (evaluated after demanding the module) +} +``` + +The above snippet is a shorthand for this code: + +``` kak +plug "andreyorst/fzf.kak" defer fzf %{ + # the body of demand block + set-option global fzf_project_use_tilda true # demand block +} config %{ + # config1 (evaluated before demanding the module) + require-module fzf # the demand hook + # config2 (evaluated after demanding the module) +} +``` + +**Note**: the `ModuleLoaded` hook is defined as early as possible - before sourcing any of plugin files. +The place where `require-module` call will be placed depends on the order of config blocks in the `plug` command. +As soon as the module is required, the `ModuleLoaded` hook will execute. + + +## **plug.kak** Configuration + +Several configuration options are available: + +- Changing the [plugin installation directory](#plugin-installation-directory), +- Limiting the [maximum amount of active downloads](#maximum-downloads), +- Specifying the [default git domain](#default-git-domain), +- And [ensuring that plugins are installed](#ensuring-that-plugins-are-installed). + +Proper way to configure **plug.kak** is to load it with the `plug` command, and providing both `noload` and `config` blocks: +This should be done before loading other plugins. + +```kak +plug "andreyorst/plug.kak" noload config %{ + # configure plug.kak here +} +``` + + +### Plugin installation directory + +By default **plug.kak** automatically detects its installation path and installs plugins to the same directory. +To change this, use the `plug_install_dir` option: + +```kak +plug "andreyorst/plug.kak" noload config %{ + set-option global plug_install_dir %sh{ echo $HOME/.cache/kakoune_plugins } +} +``` + + +### Maximum downloads + +**plug.kak** downloads plugins from github.com asynchronously via `git`. +By default it allows only `10` simultaneously active `git` processes. +To change this, use the `plug_max_simultaneous_downloads` option. + + +### Default git domain + +If majority of plugins is installed from the service other than GitHub, default git domain can be changed to avoid specifying the `domain` keyword for each plugin, or using URLs. + + +### Notify on configuration error + +By default, **plug.kak** will display an `info` box when any plugin's `config` block has errors while being evaluated. +To change this, use the `plug_report_conf_errors` option: + +```kak +set-option global plug_report_conf_errors false +``` + + +## Commands + +**plug.kak** adds five new commands to Kakoune. + + +### `plug-install` + +This command installs all plugins that were specified in any of the configuration files sourced after Kakoune launch. +It accepts optional argument, which can be the plugin name or the URL, so it could be used to install a plugin from command prompt without restarting Kakoune. +This plugin will be enabled automatically, but you still need to add `plug` command to your configuration files in order to use that plugin after the restart. + + +### `plug-list` + +Display the buffer with all installed plugins, and check for updates. +The Enter key is remapped to execute `plug-update` or `plug-install` command for selected plugin, depending on its state. +This command accepts an optional argument `noupdate`, and if it is specified, check for updates will not be performed. + + +### `plug-update` + +This command updates all installed plugins. +It accepts one optional argument, which is a plugin name, so it could be used to update single plugin. +When called from prompt, it shows all installed plugins in the completion menu. + + +### `plug-clean` + +Remove plugins, that are installed, but disabled or missing in configuration files. +This command also accepts optional argument, which is a plugin name, and can be used to remove any installed plugin. + + +### `plug` + +Load plugin from plugin installation directory by its name. + + +### `plug-chain` + +This command can collapse separate `plug` invocations and thus saves startup time by reducing multiple shell calls; it may come in handy if you're invoking `kak` frequently (e.g. as the `$EDITOR`). Replace the first `plug` command in your `kakrc` with `plug-chain`, then append subsequent `plug` calls and their parameters, as in the following: +``` +plug-chain https://github.com/Delapouite/kakoune-select-view config %{ + map global view s ': select-view' -docstring 'select view' +} plug https://github.com/occivink/kakoune-vertical-selection %{ +} plug https://github.com/jbomanson/search-doc.kak demand search-doc %{ + alias global doc-search search-doc +} +``` + +Backslashes can also be used to separate individual `plug` "clauses" (which avoids the "visual hack" of empty config blocks, as above, serving as newlines). +An initial `plug` redundant argument is also supported for symmetry. +Either way, `plug-chain` simply figures out the parameters intended for each individual `plug` clause (using "`plug`" as a delimiter), and executes all implied `plug`s in a single shell call. +All regular `plug` features are supported. +Mix and match `plug` / `plug-chain` invocations in any order, any number of times. + +Note, that if plug.kak own variables are altered in the `plug-chain` body, the chained `plug` commands won't get updated values. +This happens because Kakoune reads its variables only once per shell invocation, and calling `set-option` won't update the value of a variable for current shell. + + +### Alternative plugin managers + +Here are some other plugin managers to consider as alternatives to plug.kak: + +- [kak-bundle][7] +- [cork.kak][8] + +[1]: https://img.shields.io/github/issues/andreyorst/plug.kak.svg +[2]: https://github.com/andreyorst/plug.kak/issues +[3]: https://img.shields.io/github/license/andreyorst/plug.kak.svg +[4]: https://user-images.githubusercontent.com/19470159/51197223-f2c26a80-1901-11e9-9494-b79ce823a364.png +[5]: https://github.com/junegunn/vim-plug +[6]: https://github.com/jwiegley/use-package +[7]: https://github.com/jdugan6240/kak-bundle +[8]: https://github.com/topisani/cork.kak + + diff --git a/config/kak/plugins/plug.kak/rc/plug.kak b/config/kak/plugins/plug.kak/rc/plug.kak new file mode 100644 index 00000000..3ab2ab52 --- /dev/null +++ b/config/kak/plugins/plug.kak/rc/plug.kak @@ -0,0 +1,330 @@ +# Author: Andrey Listopadov +# plug.kak is a plugin manager for Kakoune. It can install plugins, keep them updated, configure and build dependencies +# https://github.com/andreyorst/plug.kak + +# Public options +declare-option -docstring \ +"Path where plugins should be installed. + + Defaults to the plug.kak installation directory" \ +str plug_install_dir %sh{ echo "${kak_source%%/rc*}/../" } + +declare-option -docstring \ +"Default domain to access git repositories. Can be changed to any preferred domain, like gitlab, bitbucket, gitea, etc. + + Default value: 'https://github.com'" \ +str plug_git_domain 'https://github.com' + +declare-option -docstring \ +"Profile plugin loading." \ +bool plug_profile false + +declare-option -docstring \ +"Maximum amount of simultaneously active downloads when installing or updating all plugins + Default value: 10 +" \ +int plug_max_active_downloads 10 + +declare-option -docstring \ +"Always ensure that all plugins are installed. If this option specified, all uninstalled plugins are being installed when Kakoune starts." \ +bool plug_always_ensure false + +declare-option -docstring "name of the client in which utilities display information" \ +str toolsclient + +declare-option -docstring \ +"Block UI until operation completes." \ +bool plug_block_ui false + +# Private options +declare-option -hidden -docstring \ +"Path to plug.sh script." \ +str plug_sh_source %sh{ echo "${kak_source%%.kak}.sh" } + +declare-option -hidden -docstring \ +"Array of all plugins, mentioned in any configuration file. +Empty by default, and erased on reload of main Kakoune configuration, to track if some plugins were disabled +Should not be modified by user." \ +str plug_plugins "" + +declare-option -hidden -docstring \ +"List of loaded plugins. Has no default value. +Should not be cleared during update of configuration files. Should not be modified by user." \ +str plug_loaded_plugins "" + +declare-option -docstring \ +"Whether or not to report errors in config blocks. Defaults to true." \ +bool plug_report_conf_errors true + +declare-option -hidden -docstring \ +"This will be set if there are any errors with a plugin's config block. Has no default value. +Should not be cleared during update of configuration files. Should not be modified by user." \ +str plug_conf_errors "" + +# since we want to add highlighters to kak filetype we need to require kak module +# using `try' here since kakrc module may not be available in rare cases +try %@ + require-module kak + + try %$ + add-highlighter shared/kakrc/code/plug_keywords regex '\b(plug|plug-chain|do|config|domain|defer|demand|load-path|branch|tag|commit|comment)(?=[ \t])' 0:keyword + add-highlighter shared/kakrc/code/plug_attributes regex '(?<=[ \t])(noload|ensure|theme)\b' 0:attribute + add-highlighter shared/kakrc/plug_post_hooks1 region -recurse '\{' '\bdo\K\h+%\{' '\}' ref sh + add-highlighter shared/kakrc/plug_post_hooks2 region -recurse '\[' '\bdo\K\h+%\[' '\]' ref sh + add-highlighter shared/kakrc/plug_post_hooks3 region -recurse '\(' '\bdo\K\h+%\(' '\)' ref sh + add-highlighter shared/kakrc/plug_post_hooks4 region -recurse '<' '\bdo\K\h+%<' '>' ref sh + $ catch %$ + echo -debug "Error: plug.kak: can't declare highlighters for 'kak' filetype: %val{error}" + $ +@ catch %{ + echo -debug "Error: plug.kak: can't require 'kak' module to declare highlighters for plug.kak. Check if kakrc.kak is available in your autoload." +} + +# *plug* highlighters +try %{ + add-highlighter shared/plug_buffer group + add-highlighter shared/plug_buffer/done regex [^:]+:\h+(Up\h+to\h+date|Done|Installed)$ 1:string + add-highlighter shared/plug_buffer/update regex [^:]+:\h+(Update\h+available|Deleted)$ 1:keyword + add-highlighter shared/plug_buffer/not_installed regex [^:]+:\h+(Not\h+(installed|loaded)|(\w+\h+)?Error([^\n]+)?)$ 1:red+b + add-highlighter shared/plug_buffer/updating regex [^:]+:\h+(Installing|Updating|Local\h+changes)$ 1:type + add-highlighter shared/plug_buffer/working regex [^:]+:\h+(Running\h+post-update\h+hooks|Waiting[^\n]+)$ 1:attribute +} catch %{ + echo -debug "Error: plug.kak: Can't declare highlighters for *plug* buffer: %val{error}" +} + +hook -group plug-syntax global WinSetOption filetype=plug %{ + add-highlighter buffer/plug_buffer ref plug_buffer + hook -always -once window WinSetOption filetype=.* %{ + remove-highlighter buffer/plug_buffer + } +} + +define-command -override -docstring \ +"plug []: manage from ""%opt{plug_install_dir}"" +Switches: + branch (tag, commit) checkout to before loading plugin + noload do not source plugin files + subset source only of plugin files + load-path path for loading plugin from foreign location + defer load plugin only when is loaded + config plugin " \ +plug -params 1.. -shell-script-candidates %{ ls -1 ${kak_opt_plug_install_dir} } %{ try %{ + evaluate-commands %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug "$@" + } +}} + +define-command -override plug-chain -params 0.. -docstring %{ + Chain plug commands (see docs, saves startup time by reducing sh calls) +} %{ try %{ + evaluate-commands %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + set -u + . "${kak_opt_plug_sh_source}" + plug1() { + for _plug_param; do + # reset "$@" on 1st iteration; args still in 'for' + [ "$_plug_processed_args" != 0 ] || set -- + _plug_processed_args=$((_plug_processed_args + 1)) + [ plug != "$_plug_param" ] || break + set -- "$@" "$_plug_param" + done + [ $# = 0 ] || plug "$@" # subshell would be safer, but slower + } + while [ "$#" != 0 ]; do + _plug_processed_args=0 + plug1 "$@" + shift "$_plug_processed_args" + done + } +}} + +define-command -override -docstring \ +"plug-install [] []: install . +If omitted installs all plugins mentioned in configuration +files. If is supplied skip loading the plugin." \ +plug-install -params ..2 %{ nop %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug_install "$@" +}} + +define-command -override -docstring \ +"plug-update []: Update plugin. +If omitted all installed plugins are updated" \ +plug-update -params ..1 -shell-script-candidates %{ printf "%s\n" ${kak_opt_plug_plugins} | tr ' ' '\n' } %{ + evaluate-commands %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug_update "$@" +}} + +define-command -override -docstring \ +"plug-clean []: delete . +If omitted deletes all plugins that are installed but not presented in configuration files" \ +plug-clean -params ..1 -shell-script-candidates %{ ls -1 ${kak_opt_plug_install_dir} } %{ nop %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug_clean "$@" +}} + +define-command -override -hidden \ +-docstring "plug-eval-hooks: wrapper for post update/install hooks" \ +plug-eval-hooks -params 1 %{ nop %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug_eval_hooks "$@" +}} + +define-command -override \ +-docstring "plug-list []: list all installed plugins in *plug* buffer. Checks updates by default unless is specified." \ +plug-list -params ..1 %{ evaluate-commands -try-client %opt{toolsclient} %sh{ + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug_list "$@" +}} + +define-command -hidden -override \ +-docstring "operate on *plug* buffer contents based on current cursor position" \ +plug-fifo-operate -params 1 %{ evaluate-commands -save-regs t %{ + execute-keys -save-regs '' "" + set-register t %val{selection} + evaluate-commands %sh{ + # $kak_reg_t + # $kak_client + # $kak_config + # $kak_opt_plug_always_ensure + # $kak_opt_plug_git_domain + # $kak_opt_plug_install_dir + # $kak_opt_plug_loaded_plugins + # $kak_opt_plug_max_active_downloads + # $kak_opt_plug_plugin + # $kak_opt_plug_plugins + # $kak_opt_plug_profile + # $kak_opt_plug_block_ui + # $kak_opt_plug_report_conf_errors + # $kak_opt_plug_conf_errors + # $kak_session + + . "${kak_opt_plug_sh_source}" + plug_fifo_operate "$@" +}}} + +define-command -hidden -override \ +plug-display-log -params 1 %{ evaluate-commands %sh{ + plugin_log="${TMPDIR:-/tmp}/${1##*/}-log" + [ -s "${plugin_log}" ] && printf "%s\n" "edit! -existing -debug -readonly -scroll %{${plugin_log}}" +}} + +define-command -override \ +-docstring "displays help message" \ +plug-show-help %{ + info -title "plug.kak Help" "h,j,k,l: Move +: Update or Install plugin +I: Install plugin +U: Update plugin +D: clean (Delete) plugin +L: show Log, if any +R: Run post-update hooks manually +H show Help message" +} diff --git a/config/kak/plugins/plug.kak/rc/plug.sh b/config/kak/plugins/plug.kak/rc/plug.sh new file mode 100644 index 00000000..efca9f8e --- /dev/null +++ b/config/kak/plugins/plug.kak/rc/plug.sh @@ -0,0 +1,531 @@ +#!/usr/bin/env sh + +# Author: Andrey Listopadov +# https://github.com/andreyorst/plug.kak +# +# plug.kak is a plugin manager for Kakoune. It can install plugins, +# keep them updated, configure and build dependencies. +# +# plug.sh contains a set of functions plug.kak calls via shell +# expansions. + +plug_code_append () { + eval "$1=\"\$$1 +\$2\"" +} + +plug () { + [ "${kak_opt_plug_profile:-}" = "true" ] && plug_save_timestamp profile_start + plugin_arg=$1 + plugin="${1%%.git}"; plugin=${plugin%%/} + shift + plugin_name="${plugin##*/}" + path_to_plugin="${kak_opt_plug_install_dir:?}/$plugin_name" + build_dir="${kak_opt_plug_install_dir:?}/.build/$plugin_name" + conf_file="$build_dir/config" + hook_file="$build_dir/hooks" + domain_file="$build_dir/domain" + + configurations= hooks= domain= checkout= checkout_type= noload= ensure= + + case "${kak_opt_plug_loaded_plugins:-}" in + (*"$plugin"*) + printf "%s\n" "echo -markup %{{Information}$plugin_name already loaded}" + exit + ;; + (*) + printf "%s\n" "set-option -add global plug_plugins %{$plugin }" + ;; + esac + + while [ $# -gt 0 ]; do + case $1 in + (branch|tag|commit) checkout_type=$1; shift; checkout=${1?} ;; + (noload) noload=1 ;; + (load-path) shift; eval "path_to_plugin=${1?}" ;; + (comment) shift ;; + (defer|demand) + demand=$1 + shift; module=${1?} + if [ $# -ge 2 ]; then + case "$2" in + (branch|tag|commit|noload|load-path|ensure|theme|domain|depth-sort|subset|no-depth-sort|config|defer|demand|comment) + ;; + (*) + shift + deferred=$1 + case "$deferred" in (*[![:space:]]*) + case "$deferred" in (*'@'*) + deferred=$(printf "%s\n" "$deferred" | sed "s/@/@@/g") ;; + esac + printf "%s\n" "hook global ModuleLoaded '$module' %@ $deferred @" + esac + [ "$demand" = demand ] && plug_code_append configurations "require-module $module" ;; + esac + fi + ;; + ('do') shift; plug_code_append hooks "set -e +${1?}" ;; + (ensure) ensure=1 ;; + (theme) + noload=1 + plug_code_append hooks "[ -d \"${kak_config:?}/colors\" ] || mkdir -p \"${kak_config}/colors\"; ln -sf \"\$PWD\" \"$kak_config/colors\"" + ;; + (domain) shift; domain=${1?} ;; + (depth-sort|subset) + printf "%s\n" "echo -debug %{Error: plug.kak: '$plugin_name': keyword '$1' is no longer supported. Use the module system instead}" + exit 1 ;; + (no-depth-sort) printf "%s\n" "echo -debug %{Warning: plug.kak: '$plugin_name': use of deprecated '$1' keyword which has no effect}" ;; + (config) shift; plug_code_append configurations "${1?}" ;; + (*) plug_code_append configurations "$1" ;; + esac + shift + done + + [ -d "$build_dir" ] || mkdir -p "$build_dir" + rm -rf "$build_dir"/* "$build_dir"/.[!.]* "$build_dir"/..?* + [ -n "$hooks" ] && printf "%s" "$hooks" > "$hook_file" + [ -n "$domain" ] && printf "%s" "$domain" > "$domain_file" + + if [ -n "$configurations" ]; then + if [ "${kak_opt_plug_report_conf_errors:-}" = "true" ]; then + cat > "$conf_file" < "$conf_file" + fi + fi + + if [ -d "$path_to_plugin" ]; then + if [ -n "$checkout" ]; then + ( + cd "$path_to_plugin" || exit + # shellcheck disable=SC2030,SC2031 + [ -z "${GIT_TERMINAL_PROMPT:-}" ] && export GIT_TERMINAL_PROMPT=0 + if [ "$checkout_type" = "branch" ]; then + [ "$(git branch --show-current)" != "$checkout" ] && git fetch >/dev/null 2>&1 + fi + git checkout "$checkout" >/dev/null 2>&1 + ) + fi + plug_load "$plugin" "$path_to_plugin" "$noload" + if [ "$kak_opt_plug_profile" = "true" ]; then + plug_save_timestamp profile_end + profile_time=$(echo "scale=3; x=($profile_end-$profile_start)/1000; if(x<1) print 0; x" | bc -l) + printf "%s\n" "echo -debug %{'$plugin_name' loaded in $profile_time sec}" + fi + else + if [ -n "$ensure" ] || [ "${kak_opt_plug_always_ensure:-}" = "true" ]; then + ( + plug_install "$plugin_arg" "$noload" + wait + if [ "$kak_opt_plug_profile" = "true" ]; then + plug_save_timestamp profile_end + profile_time=$(echo "scale=3; x=($profile_end-$profile_start)/1000; if(x<1) print 0; x" | bc -l) + printf "%s\n" "echo -debug %{'$plugin_name' loaded in $profile_time sec}" | kak -p "${kak_session:?}" + fi + ) > /dev/null 2>&1 < /dev/null & + fi + fi +} + +plug_install () { + ( + plugin="${1%%.git}"; plugin=${plugin%%/} + noload=$2 + plugin_name="${plugin##*/}" + build_dir="${kak_opt_plug_install_dir:?}/.build/$plugin_name" + domain_file="$build_dir/domain" + + # shellcheck disable=SC2030,SC2031 + [ -z "${GIT_TERMINAL_PROMPT:-}" ] && export GIT_TERMINAL_PROMPT=0 + + if [ ! -d "${kak_opt_plug_install_dir}" ]; then + if ! mkdir -p "${kak_opt_plug_install_dir}" >/dev/null 2>&1; then + printf "%s\n" "evaluate-commands -client ${kak_client:-client0} echo -debug 'Error: plug.kak: unable to create directory for plugins'" | kak -p "${kak_session:?}" + exit + fi + fi + + printf "%s\n" "evaluate-commands -client ${kak_client:-client0} %{ try %{ buffer *plug* } catch %{ plug-list noupdate } }" | kak -p "${kak_session}" + sleep 0.3 + + lockfile="${kak_opt_plug_install_dir}/.${plugin_name:-global}.plug.kak.lock" + if [ -d "${lockfile}" ]; then + plug_fifo_update "${plugin_name}" "Waiting for .plug.kak.lock" + fi + + # this creates the lock file for a plugin, if specified to + # prevent several processes of installation of the same + # plugin, but will allow install different plugins without + # waiting for each other. Should be fine, since different + # plugins doesn't interfere with each other. + while ! mkdir "${lockfile}" 2>/dev/null; do sleep 1; done + # shellcheck disable=SC2064 + trap "rmdir '${lockfile}'" EXIT + + # if plugin specified as an argument add it to the *plug* + # buffer, if it isn't there already otherwise update all + # plugins + if [ -n "${plugin}" ]; then + plugin_list=${plugin} + printf "%s\n" " + evaluate-commands -buffer *plug* %{ try %{ + execute-keys /${plugin} + } catch %{ + execute-keys gjO${plugin}:Notinstalled + }}" | kak -p "${kak_session}" + sleep 0.2 + else + plugin_list=${kak_opt_plug_plugins} + fi + + for plugin in ${plugin_list}; do + plugin_name="${plugin##*/}" + [ -e "$domain_file" ] && git_domain="https://$(cat "$domain_file")" || git_domain=${kak_opt_plug_git_domain:?} + if [ ! -d "${kak_opt_plug_install_dir}/${plugin_name}" ]; then + ( + plugin_log="${TMPDIR:-/tmp}/${plugin_name}-log" + printf "%s\n" "hook global -always KakEnd .* %{ nop %sh{rm -rf \"$plugin_log\"}} " | kak -p "${kak_session}" + plug_fifo_update "${plugin_name}" "Installing" + cd "${kak_opt_plug_install_dir}" || exit + case ${plugin} in + (https://*|http://*|*@*|file://*|ext::*) + git clone --recurse-submodules "${plugin}" "$plugin_name" >> "$plugin_log" 2>&1 ;; + (*) + git clone --recurse-submodules "$git_domain/$plugin" "$plugin_name" >> "$plugin_log" 2>&1 ;; + esac + status=$? + if [ ${status} -ne 0 ]; then + plug_fifo_update "$plugin_name" "Download Error ($status)" + else + plug_eval_hooks "$plugin_name" + wait + plug_load "$plugin" "${kak_opt_plug_install_dir:?}/$plugin_name" "$noload" | kak -p "${kak_session:?}" + fi + ) > /dev/null 2>&1 < /dev/null & + fi + # this is a hacky way to measure amount of active + # processes. We need this because dash shell has this long + # term bug: + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482999 + jobs=$(mktemp "${TMPDIR:-/tmp}"/plug.kak.jobs.XXXXXX) + jobs > "${jobs}"; active=$(wc -l < "${jobs}") + while [ "${active}" -ge "${kak_opt_plug_max_active_downloads:?}" ]; do + sleep 1 + jobs > "${jobs}"; active=$(wc -l < "${jobs}") + done + rm -rf "${jobs}" + done + wait + ) > /dev/null 2>&1 < /dev/null & +} + +plug_load() { + plugin="${1%%.git}" + path_to_plugin=$2 + noload=$3 + plugin_name="${plugin##*/}" + build_dir="${kak_opt_plug_install_dir:?}/.build/$plugin_name" + conf_file="$build_dir/config" + + if [ -z "${noload}" ]; then + find -L "${path_to_plugin}" -path '*/.git' -prune -o -type f -name '*.kak' -exec printf 'source "%s"\n' {} + + fi + [ -e "$conf_file" ] && printf "%s\n" "source $conf_file" + printf "%s\n" "set-option -add global plug_loaded_plugins %{${plugin} }" +} + +plug_update () { + ( + plugin="${1%%.git}" + plugin_name="${plugin##*/}" + + # shellcheck disable=SC2030,SC2031 + [ -z "${GIT_TERMINAL_PROMPT:-}" ] && export GIT_TERMINAL_PROMPT=0 + + printf "%s\n" "evaluate-commands -client ${kak_client:-client0} %{ try %{ buffer *plug* } catch %{ plug-list noupdate } }" | kak -p "${kak_session}" + + lockfile="${kak_opt_plug_install_dir}/.${plugin_name:-global}.plug.kak.lock" + if [ -d "${lockfile}" ]; then + plug_fifo_update "${plugin##*/}" "Waiting for .plug.kak.lock" + fi + + while ! mkdir "${lockfile}" 2>/dev/null; do sleep 1; done + # shellcheck disable=SC2064 + trap "rmdir '${lockfile}'" EXIT + + [ -n "${plugin}" ] && plugin_list=${plugin} || plugin_list=${kak_opt_plug_plugins} + for plugin in ${plugin_list}; do + plugin_name="${plugin##*/}" + if [ -d "${kak_opt_plug_install_dir}/${plugin_name}" ]; then + ( + plugin_log="${TMPDIR:-/tmp}/${plugin_name}-log" + printf "%s\n" "hook global -always KakEnd .* %{ nop %sh{rm -rf ${plugin_log}}} " | kak -p "${kak_session}" + plug_fifo_update "${plugin_name}" "Updating" + cd "${kak_opt_plug_install_dir}/${plugin_name}" && rev=$(git rev-parse HEAD) && git pull --recurse-submodules >> "${plugin_log}" 2>&1 + status=$? + if [ ${status} -ne 0 ]; then + plug_fifo_update "${plugin_name}" "Update Error (${status})" + else + if [ "${rev}" != "$(git rev-parse HEAD)" ]; then + printf "%s\n" "evaluate-commands -client ${kak_client:-client0} plug-eval-hooks ${plugin_name}" | kak -p "${kak_session}" + else + plug_fifo_update "${plugin_name}" "Done" + fi + fi + ) > /dev/null 2>&1 < /dev/null & + fi + jobs=$(mktemp "${TMPDIR:-/tmp}"/jobs.XXXXXX) + jobs > "${jobs}"; active=$(wc -l < "${jobs}") + # TODO: re-check this + # For some reason I need to multiply the amount of jobs by five here. + while [ "${active}" -ge $((kak_opt_plug_max_active_downloads * 5)) ]; do + sleep 1 + jobs > "${jobs}"; active=$(wc -l < "${jobs}") + done + rm -rf "${jobs}" + done + wait + ) > /dev/null 2>&1 < /dev/null & + + if [ "${kak_opt_plug_block_ui:-}" = "true" ]; then + wait + fi +} + + +plug_clean () { + ( + plugin="${1%%.git}" + plugin_name="${plugin##*/}" + + printf "%s\n" "evaluate-commands -client ${kak_client:-client0} %{ try %{ buffer *plug* } catch %{ plug-list noupdate } }" | kak -p "${kak_session}" + + lockfile="${kak_opt_plug_install_dir}/.${plugin_name:-global}.plug.kak.lock" + if [ -d "${lockfile}" ]; then + plug_fifo_update "${plugin_name}" "Waiting for .plug.kak.lock" + fi + + while ! mkdir "${lockfile}" 2>/dev/null; do sleep 1; done + # shellcheck disable=SC2064 + trap "rmdir '${lockfile}'" EXIT + + if [ -n "${plugin}" ]; then + if [ -d "${kak_opt_plug_install_dir}/${plugin_name}" ]; then + ( + cd "${kak_opt_plug_install_dir}" && rm -rf "${plugin_name}" + plug_fifo_update "${plugin_name}" "Deleted" + ) + else + printf "%s\n" "evaluate-commands -client ${kak_client:-client0} echo -markup %{{Error}No such plugin '${plugin}'}" | kak -p "${kak_session}" + exit + fi + else + for installed_plugin in $(printf "%s\n" "${kak_opt_plug_install_dir}"/*); do + skip= + for enabled_plugin in ${kak_opt_plug_plugins}; do + [ "${installed_plugin##*/}" = "${enabled_plugin##*/}" ] && { skip=1; break; } + done + [ "${skip}" = "1" ] || plugins_to_remove=${plugins_to_remove}" ${installed_plugin}" + done + for plugin in ${plugins_to_remove}; do + plug_fifo_update "${plugin##*/}" "Deleted" + rm -rf "${plugin}" + done + fi + ) > /dev/null 2>&1 < /dev/null & + + if [ "$kak_opt_plug_block_ui" = "true" ]; then + wait + fi +} + +plug_eval_hooks () { + ( + plugin="${1%%.git}" + plugin_name="${plugin##*/}" + path_to_plugin="${kak_opt_plug_install_dir:?}/$plugin_name" + build_dir="${kak_opt_plug_install_dir:?}/.build/$plugin_name" + hook_file="$build_dir/hooks" + + plugin_log="${TMPDIR:-/tmp}/${plugin_name}-log" + cd "$path_to_plugin" || exit + + printf "%s\n" "hook global -always KakEnd .* %{ nop %sh{rm -rf ${plugin_log}}}" | kak -p "${kak_session}" + plug_fifo_update "${plugin_name}" "Running post-update hooks" + + status=0 + if [ -e "$hook_file" ]; then + # shellcheck disable=SC1090 + (. "$hook_file" >> "$plugin_log" 2>&1) + status=$? + fi + [ ${status} -ne 0 ] && message="Error (${status})" || message="Done" + + plug_fifo_update "${plugin_name}" "${message}" + ) > /dev/null 2>&1 < /dev/null & + + if [ "$kak_opt_plug_block_ui" = "true" ]; then + wait + fi +} + +plug_list () { + noupdate=$1 + tmp=$(mktemp -d "${TMPDIR:-/tmp}/plug-kak.XXXXXXXX") + fifo="${tmp}/fifo" + plug_buffer="${tmp}/plug-buffer" + mkfifo "${fifo}" + + printf "%s\n" "edit! -fifo ${fifo} *plug* + set-option buffer filetype plug + plug-show-help + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -rf ${tmp} } } + map buffer normal '' ':plug-fifo-operate install-update' + map buffer normal 'H' ':plug-show-help' + map buffer normal 'U' ':plug-fifo-operate update' + map buffer normal 'I' ':plug-fifo-operate install' + map buffer normal 'L' ':plug-fifo-operate log' + map buffer normal 'D' ':plug-fifo-operate clean' + map buffer normal 'R' ':plug-fifo-operate hooks'" + + # get those plugins which were loaded by plug.kak + eval "set -- ${kak_opt_plug_plugins}" + while [ $# -gt 0 ]; do + if [ -d "${kak_opt_plug_install_dir}/${1##*/}" ]; then + printf "%s: Installed\n" "$1" >> "${plug_buffer}" + else + printf "%s: Not installed\n" "$1" >> "${plug_buffer}" + fi + shift + done + + # get those plugins which have a directory at installation path, + # but wasn't mentioned in any config file + for existing_plugin in "${kak_opt_plug_install_dir}"/*; do + case "${kak_opt_plug_plugins}" in + (*"${existing_plugin##*/}"*) ;; + (*) + printf "%s: Not loaded\n" "${existing_plugin##*/}" >> "${plug_buffer}" + ;; + esac + done + + ( sort "${plug_buffer}" > "${fifo}" ) > /dev/null 2>&1 < /dev/null & + + if [ -z "${noupdate}" ]; then + ( + # shellcheck disable=SC2030,SC2031 + [ -z "${GIT_TERMINAL_PROMPT:-}" ] && export GIT_TERMINAL_PROMPT=0 + eval "set -- ${kak_opt_plug_plugins}" + while [ $# -gt 0 ]; do + plugin_dir="${1##*/}" + if [ -d "${kak_opt_plug_install_dir}/${plugin_dir}" ]; then ( + cd "${kak_opt_plug_install_dir}/${plugin_dir}" || exit + git fetch > /dev/null 2>&1 + status=$? + if [ ${status} -eq 0 ]; then + { IFS= read -r LOCAL; IFS= read -r REMOTE; IFS= read -r BASE; } < /dev/null 2>&1 < /dev/null & fi + shift + done + ) > /dev/null 2>&1 < /dev/null & + fi +} + +plug_fifo_operate() { + plugin="${kak_reg_t%:*}" + case $1 in + (install-update) + if [ -d "${kak_opt_plug_install_dir}/${plugin##*/}" ]; then + plug_update "${plugin}" + else + plug_install "${plugin}" true + fi ;; + (update) + if [ -d "${kak_opt_plug_install_dir}/${plugin##*/}" ]; then + plug_update "${plugin}" + else + printf "%s\n" "echo -markup %{{Information}'${plugin}' is not installed}" + fi ;; + (install) + if [ ! -d "${kak_opt_plug_install_dir}/${plugin##*/}" ]; then + plug_install "${plugin}" + else + printf "%s\n" "echo -markup %{{Information}'${plugin}' already installed}" + fi ;; + (clean) plug_clean "${plugin}" ;; + (log) printf "%s\n" "plug-display-log $plugin" ;; + (hooks) plug_eval_hooks "${plugin##*/}" ;; + (*) ;; + esac +} + +plug_fifo_update() { + printf "%s\n" " + evaluate-commands -draft -buffer *plug* -save-regs \"/\"\"\" %{ try %{ + set-register / \"$1: \" + set-register dquote %{$2} + execute-keys -draft /lGlR + }}" | kak -p "$kak_session" +} + +plug_save_timestamp() { + plug_tstamp=${EPOCHREALTIME:-} + if [ -n "$plug_tstamp" ]; then + plug_tstamp_ms=${plug_tstamp#*.} + case "$plug_tstamp_ms" in + (????*) plug_tstamp_ms=${plug_tstamp_ms%"${plug_tstamp_ms#???}"} ;; + (???) ;; + (*) plug_tstamp= ;; # redo with date + esac + if [ -n "$plug_tstamp" ]; then + plug_tstamp=${plug_tstamp%.*}${plug_tstamp_ms} + fi + fi + : "${plug_tstamp:=$(date +%s%3N)}" + if [ -n "$1" ]; then eval "$1=\$plug_tstamp"; fi +} + +# Spell-checker local dictionary +# LocalWords: Andrey Listopadov github kak usr config dir Kakoune +# LocalWords: expr ModuleLoaded mkdir ln PWD conf shellcheck noload +# LocalWords: TMPDIR tmp noupdate lockfile rmdir ret gjO esc KakEnd +# LocalWords: nop rf hacky eval fifo filetype BufCloseFifo regs +# LocalWords: dquote lGlR diff --git a/config/kak/plugins/powerline.kak b/config/kak/plugins/powerline.kak new file mode 160000 index 00000000..16be282e --- /dev/null +++ b/config/kak/plugins/powerline.kak @@ -0,0 +1 @@ +Subproject commit 16be282ec6aa514997ec370049babd3a070f2e1f diff --git a/config/kak/plugins/prelude.kak/CONTRIBUTING b/config/kak/plugins/prelude.kak/CONTRIBUTING new file mode 100644 index 00000000..3d438b27 --- /dev/null +++ b/config/kak/plugins/prelude.kak/CONTRIBUTING @@ -0,0 +1,18 @@ +The preferred way to contribute would be through GitHub pull requests, +as an alternative patches can be discussed on the IRC channel. + +When contributing your first changes, please include an empty commit for +copyright waiver using the following message (replace 'John Doe' with +your name or nickname): + + John Doe Copyright Waiver + + I dedicate any and all copyright interest in this software to the + public domain. I make this dedication for the benefit of the public at + large and to the detriment of my heirs and successors. I intend this + dedication to be an overt act of relinquishment in perpetuity of all + present and future rights to this software under copyright law. + +The command to create an empty commit from the command-line is: + + git commit --allow-empty diff --git a/config/kak/plugins/prelude.kak/README.md b/config/kak/plugins/prelude.kak/README.md new file mode 100644 index 00000000..d1fe1354 --- /dev/null +++ b/config/kak/plugins/prelude.kak/README.md @@ -0,0 +1,37 @@ +# prelude.kak + +Prelude of shell blocks for [Kakoune]. + +## Installation + +Add [`prelude.kak`](rc/prelude.kak) to your autoload or source it manually. + +``` kak +require-module prelude +``` + +## Usage + +``` +kak_escape [text…] +``` + +Similar to `shell_escape` you may find in other programming languages, +`kak_escape` escapes each argument so that it can be safely passed to Kakoune. + +**Implementation**: +Single quotes each argument and doubles the single quotes inside. + +**Note**: +The resulted text should be used unquoted and is not intended for use in double quotes, nor in single quotes. + +**Example**: + +``` kak +evaluate-commands %sh{ + . "$kak_opt_prelude_path" + kak_escape evaluate-commands -try-client "$kak_client" 'echo Tchou' | kak -p "$kak_session" +} +``` + +[Kakoune]: https://kakoune.org diff --git a/config/kak/plugins/prelude.kak/UNLICENSE b/config/kak/plugins/prelude.kak/UNLICENSE new file mode 100644 index 00000000..efb98088 --- /dev/null +++ b/config/kak/plugins/prelude.kak/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +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 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. + +For more information, please refer to diff --git a/config/kak/plugins/prelude.kak/rc/prelude.kak b/config/kak/plugins/prelude.kak/rc/prelude.kak new file mode 100644 index 00000000..6454ef06 --- /dev/null +++ b/config/kak/plugins/prelude.kak/rc/prelude.kak @@ -0,0 +1,5 @@ +declare-option -hidden str prelude_root_path %sh(dirname "$kak_source") + +provide-module prelude %{ + declare-option -docstring 'Path to the prelude of shell blocks' str prelude_path "%opt{prelude_root_path}/prelude.sh" +} diff --git a/config/kak/plugins/prelude.kak/rc/prelude.sh b/config/kak/plugins/prelude.kak/rc/prelude.sh new file mode 100644 index 00000000..c7dead68 --- /dev/null +++ b/config/kak/plugins/prelude.kak/rc/prelude.sh @@ -0,0 +1,24 @@ +kak_escape() { + for text do + printf "'" + while true; do + case "$text" in + *"'"*) + head=${text%%"'"*} + tail=${text#*"'"} + printf "%s''" "$head" + text=$tail + ;; + *) + printf "%s' " "$text" + break + ;; + esac + done + done + printf "${KAK_ESCAPE_EOF:-\n}" +} + +kak_escape_partial() { + KAK_ESCAPE_EOF=' ' kak_escape "$@" +} diff --git a/config/kak/plugins/shellcheck.kak/LICENSE b/config/kak/plugins/shellcheck.kak/LICENSE new file mode 100644 index 00000000..cf1ab25d --- /dev/null +++ b/config/kak/plugins/shellcheck.kak/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +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 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. + +For more information, please refer to diff --git a/config/kak/plugins/shellcheck.kak/README.md b/config/kak/plugins/shellcheck.kak/README.md new file mode 100644 index 00000000..ad06a7cf --- /dev/null +++ b/config/kak/plugins/shellcheck.kak/README.md @@ -0,0 +1,48 @@ +# shellcheck.kak +[ShellCheck](https://www.shellcheck.net) integration for [Kakoune](https://kakoune.org) + +## Installation + +First, install `shellcheck`. See [here](https://github.com/koalaman/shellcheck#installing) for directions. + +### With plug.kak + +To install the plugin, I recommend using [`plug.kak`](https://github.com/andreyorst/plug.kak). You can install it by adding the following to your `kakrc`: + +``` +plug "whereswaldon/shellcheck.kak" +``` + +### Manually + +If you prefer to install it manually, you can use: + +```bash +mkdir -p ~/.config/kak/plugins/ +git clone https://github.com/whereswaldon/shellcheck.kak ~/.config/kak/plugins/shellcheck.kak/ +``` + +You'll need to add the following to your kakrc as well: + +``` +source "%val{config}/plugins/shellcheck.kak/shellcheck.kak" +``` + +## Commands + +- `shellcheck-enable` starts linting the current window with shellcheck when you `:write` it. +- `shellcheck-disable` turns off linting the current window. + +## Configuration + +Currently, the plugin will automatically enable linting when kakoune +determines that the current filetype is a shell script. + +## Contribute + +Feature requests and pull requests welcome! + +## License + +Unlicense + diff --git a/config/kak/plugins/shellcheck.kak/shellcheck.kak b/config/kak/plugins/shellcheck.kak/shellcheck.kak new file mode 100644 index 00000000..a388136f --- /dev/null +++ b/config/kak/plugins/shellcheck.kak/shellcheck.kak @@ -0,0 +1,74 @@ +###################### +# Internal utilities # +###################### + +define-command -hidden -override -docstring "check whether shellcheck is installed" shellcheck-check-installed %{ + evaluate-commands %sh{ + if command -v shellcheck > /dev/null 2>&1; then + printf "set-option window shellcheck_installed true\n" + else + printf "set-option window shellcheck_installed false\n" + fi + } +} + +define-command -hidden -override -docstring "populate options with shellcheck version information" shellcheck-parse-version %{ + evaluate-commands %sh{ + version="$(shellcheck -V|egrep 'version:'|tr -s ' '|cut -d' ' -f2)" + printf "set-option window shellcheck_major_version %d\n" "$(echo "$version" | cut -d'.' -f 1)" + printf "set-option window shellcheck_minor_version %d\n" "$(echo "$version" | cut -d'.' -f 2)" + printf "set-option window shellcheck_patch_version %d\n" "$(echo "$version" | cut -d'.' -f 3)" + } + echo -debug "Using shellcheck v%opt{shellcheck_major_version}.%opt{shellcheck_minor_version}.%opt{shellcheck_patch_version}" +} + +define-command -hidden -override -docstring "enable shellcheck in the current window" shellcheck-configure-window %{ + set window lintcmd %sh{ + # format like gcc, check files other than the current buffer if they are 'source'd + flags="-f gcc -x" + # if version >= v0.4.7 + if [ "$kak_opt_shellcheck_minor_version" -ge 4 ] && [ "$kak_opt_shellcheck_patch_version" -ge 7 ]; then + # enable warnings from sourced files + flags="$flags -a" + fi + echo "shellcheck $flags" + } + lint + hook -group shellcheck window BufWritePre .* %{ + lint + } +} + +############################### +# Externally-visible commands # +############################### + +define-command -override -docstring "enable shellcheck in the current window" shellcheck-enable %{ + evaluate-commands %sh{ + if $kak_optshellcheck_installed; then + echo "shellcheck-parse-version" + echo "shellcheck-configure-window" + else + echo "echo -debug 'Missing shellcheck executable'" + fi + } +} +define-command -override -docstring "disable shellcheck in the current window" shellcheck-disable %{ + lint-hide-diagnostics + remove-hooks window shellcheck +} + +################## +# Initialization # +################## + +declare-option -hidden int shellcheck_major_version +declare-option -hidden int shellcheck_minor_version +declare-option -hidden int shellcheck_patch_version +declare-option -hidden bool shellcheck_installed + +hook global WinSetOption filetype=sh %{ + # check whether binary exists + shellcheck-check-installed + shellcheck-enable +} diff --git a/config/kak/plugins/smarttab.kak/LICENSE b/config/kak/plugins/smarttab.kak/LICENSE new file mode 100644 index 00000000..fb09a1ac --- /dev/null +++ b/config/kak/plugins/smarttab.kak/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Andrey Orst + +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. diff --git a/config/kak/plugins/smarttab.kak/README.md b/config/kak/plugins/smarttab.kak/README.md new file mode 100644 index 00000000..1df6e150 --- /dev/null +++ b/config/kak/plugins/smarttab.kak/README.md @@ -0,0 +1,125 @@ +# smarttab.kak +![license](https://img.shields.io/github/license/andreyorst/smarttab.kak.svg) + +`smarttab.kak` is a plugin for [Kakoune](https://github.com/mawww/kakoune). +It provides three different ways for handling indentation and alignment with the tab key. + + +## Installation + +### With [plug.kak](https://github.com/andreyorst/plug.kak) + +Add this to your `kakrc`: + +```kak +plug "andreyorst/smarttab.kak" +``` + +Source your `kakrc`, or restart Kakoune. +Then execute `:plug-install`. +Or, if you don't want to restart Kakoune or source its config, simply run `plug-install andreyorst/smarttab.kak`. +It will then be enabled automatically. + +### Without plugin manager + +Clone this repo: + +```sh +git clone https://github.com/andreyorst/smarttab.kak.git +``` + +You can put this repo in your `autoload` directory, or else manually `source` the `smarttab.kak` script in your configuration file. + +After that, you can use `smarttab.kak`. + + +## Usage + +This plugin adds three commands to toggle between different policies when using the Tab and > keys: + +- `noexpandtab` - use `tab` for everything. + Tab will insert the `\t` character, and > will use the `\t` character when indenting. + Aligning cursors with & uses the `\t` character. +- `expandtab` - use `space` for everything. + Tab will insert `%opt{indentwidth}` amount of spaces, and > will indent with spaces. +- `smarttab` - indent with `tab`, align with `space`. + Tab will insert the `\t` character if your cursor is inside an indentation area, e.g., before any non-whitespace character, and insert spaces if the cursor is after any non-whitespace character. + Aligning cursors with & uses `space`. +- `autoconfigtab` - choose the above based upon one of the existing settings (see later section). + +By default, smarttab.kak affects only the Tab and > keys. +If you want to deindent lines that are being indented with spaces when hitting Backspace, you can set the `softtabstop` option. +This option specifies how many `space`s should be treated as a single `tab` character when deleting them with a backspace. + +In order to automatically enable different modes for different languages, you can use `hook`s like so: + +```kak +hook global WinSetOption filetype=c smarttab +hook global WinSetOption filetype=rust expandtab +``` + +To adjust smarttab.kak related options, you need to use the `ModuleLoaded` hook, because all options are defined withing the `smarttab` module: + +```sh +hook global ModuleLoaded smarttab %{ + set-option global softtabstop 4 + # you can configure text that is being used to represent curent active mode + set-option global smarttab_expandtab_mode_name 'exp' + set-option global smarttab_noexpandtab_mode_name 'noexp' + set-option global smarttab_smarttab_mode_name 'smart' +} +``` + +If you've used plug.kak for installation, it's better to configure smarttab.kak from within the `plug` command because it can handle lazy loading the configurations for the plugin, as well as configure the editor's behavior: + +```sh +plug "andreyorst/smarttab.kak" defer smarttab %{ + # when `backspace' is pressed, 4 spaces are deleted at once + set-option global softtabstop 4 +} config %{ + # these languages will use `expandtab' behavior + hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|sh|perl) expandtab + # these languages will use `noexpandtab' behavior + hook global WinSetOption filetype=(makefile|gas) noexpandtab + # these languages will use `smarttab' behavior + hook global WinSetOption filetype=(c|cpp) smarttab +} +``` + +### Setting the default mode + +In your `kakrc` add: + +```kak +hook global BufOpenFile .* _mode_ +hook global BufNewFile .* _mode_ +``` + +Where the `_mode_` is one of the `smarttab.kak` modes, described [above](#usage). + + +### `autoconfigtab` configuration + +If you just want to set the behavior based upon your `editorconfig` settings, you can use the `autoconfigtab` setting: + +```kak +hook global BufCreate .* %{ + editorconfig-load + autoconfigtab +} +``` + +This config will choose `expandtab` or `noexpandtab` based upon whether `indent_style` is set as `space` or `tab` respectively. + +If you'd prefer to use `smarttab` instead of `noexpandtab` for `indent_style = tab` (without affecting `indent_style = space`), you can manually override the `aligntab` option to `false` before running `autoconfigtab`, as seen in the below config: + +```kak +hook global BufCreate .* %{ + editorconfig-load + set-option buffer aligntab false + autoconfigtab +} +``` + +Currently, `autoconfigtab` does not cover the case where `indentwidth` is nonzero but `aligntab` is set to `true`, as this would mean indenting with spaces and aligning with tabs. +In this particular case, tab alignment takes priority and `noexpandtab` is chosen. diff --git a/config/kak/plugins/smarttab.kak/rc/smarttab-powerline.kak b/config/kak/plugins/smarttab.kak/rc/smarttab-powerline.kak new file mode 100644 index 00000000..1b030380 --- /dev/null +++ b/config/kak/plugins/smarttab.kak/rc/smarttab-powerline.kak @@ -0,0 +1,45 @@ +# ╭─────────────╥────────────────────────╮ +# │ Author: ║ File: │ +# │ Andrey Orst ║ smarttab-powerline.kak │ +# ╞═════════════╩════════════════════════╡ +# │ Smarttab module for powerline.kak │ +# ╞══════════════════════════════════════╡ +# │ GitHub.com/andreyorst/smarttab.kak │ +# │ GitHub.com/andreyorst/powerline.kak │ +# ╰──────────────────────────────────────╯ + +hook global ModuleLoaded powerline %{ require-module powerline_expandtab } + +provide-module powerline_expandtab %§ + +declare-option -hidden bool powerline_module_smarttab true + +declare-option -hidden str-list powerline_modules +set-option -add global powerline_modules 'smarttab' + +define-command -hidden powerline-smarttab %{ evaluate-commands %sh{ + default=$kak_opt_powerline_base_bg + next_bg=$kak_opt_powerline_next_bg + normal=$kak_opt_powerline_separator + thin=$kak_opt_powerline_separator_thin + if [ "$kak_opt_powerline_module_smarttab" = "true" ]; then + fg=$kak_opt_powerline_color18 + bg=$kak_opt_powerline_color20 + if [ ! -z "$kak_opt_smarttab_mode" ]; then + [ "$next_bg" = "$bg" ] && separator="{$fg,$bg}$thin" || separator="{$bg,${next_bg:-$default}}$normal" + echo "set-option -add global powerlinefmt %{$separator{$fg,$bg} %opt{smarttab_mode} }" + echo "set-option global powerline_next_bg $bg" + fi + fi +}} + +define-command -hidden powerline-toggle-smarttab -params ..1 %{ evaluate-commands %sh{ + [ "$kak_opt_powerline_module_smarttab" = "true" ] && value=false || value=true + if [ -n "$1" ]; then + [ "$1" = "on" ] && value=true || value=false + fi + echo "set-option global powerline_module_smarttab $value" + echo "powerline-rebuild" +}} + +§ diff --git a/config/kak/plugins/smarttab.kak/rc/smarttab.kak b/config/kak/plugins/smarttab.kak/rc/smarttab.kak new file mode 100644 index 00000000..53b53b65 --- /dev/null +++ b/config/kak/plugins/smarttab.kak/rc/smarttab.kak @@ -0,0 +1,119 @@ +# ╭─────────────╥──────────────────────╮ +# │ Author: ║ File: │ +# │ Andrey Orst ║ smarttab.kak │ +# ╞═════════════╩══════════════════════╡ +# │ Extends tab handling by adding │ +# │ three different commands for │ +# │ each mode. │ +# ╞════════════════════════════════════╡ +# │ Rest of .dotfiles: │ +# │ GitHub.com/andreyorst/smarttab.kak │ +# ╰────────────────────────────────────╯ + +define-command -docstring "noexpandtab: use tab character to indent and align" \ +noexpandtab %{ require-module smarttab; noexpandtab-impl } + +define-command -docstring "expandtab: use space character to indent and align" \ +expandtab %{ require-module smarttab; expandtab-impl } + +define-command -docstring "smarttab: use tab character for indentation and space character for alignment" \ +smarttab %{ require-module smarttab; smarttab-impl } + +# note: there is no space-indent, tab-align setting; this is assumed to be equivalent to noexpandtab +define-command -docstring "autoconfigtab: use tab or space character to indent and align based upon existing settings (e.g. via editorconfig)" \ +autoconfigtab %{ require-module smarttab; autoconfigtab-impl } + +provide-module smarttab %§ + +# Options +# ‾‾‾‾‾‾‾ + +declare-option -docstring "amount of spaces that should be treated as single tab character when deleting spaces" \ +int softtabstop 0 + +declare-option -docstring "displays current tab handling mode" \ +str smarttab_mode '' + +declare-option -docstring 'what text to display in ''%opt{smarttab_mode}'' when expandtab mode is on' \ +str smarttab_expandtab_mode_name 'expandtab' + +declare-option -docstring 'what text to display in ''%opt{smarttab_mode}'' when expandtab mode is on' \ +str smarttab_noexpandtab_mode_name 'noexpandtab' + +declare-option -docstring 'what text to display in ''%opt{smarttab_mode}'' when expandtab mode is on' \ +str smarttab_smarttab_mode_name 'smarttab' + +declare-option -hidden int oldindentwidth %opt{indentwidth} + +# Commands +# ‾‾‾‾‾‾‾‾ + +define-command -hidden noexpandtab-impl %{ + set-option buffer smarttab_mode %opt{smarttab_noexpandtab_mode_name} + remove-hooks buffer smarttab-mode + smarttab-set + set-option buffer indentwidth 0 + set-option buffer aligntab true + hook -group smarttab-mode buffer InsertDelete ' ' %{ try %sh{ + if [ $kak_opt_softtabstop -gt 1 ]; then + printf "%s\n" 'execute-keys -draft "^\h+.\zI"' + fi + } catch %{ try %{ + execute-keys -itersel -draft "h%opt{softtabstop}2s\h+\zd" + }}} +} + +define-command -hidden expandtab-impl %{ + set-option buffer smarttab_mode %opt{smarttab_expandtab_mode_name} + remove-hooks buffer smarttab-mode + smarttab-set + set-option buffer aligntab false + hook -group smarttab-mode buffer InsertChar '\t' %{ execute-keys -draft "h%opt{indentwidth}@" } + hook -group smarttab-mode buffer InsertDelete ' ' %{ try %sh{ + if [ $kak_opt_softtabstop -gt 1 ]; then + printf "%s\n" 'execute-keys -draft -itersel "^\h+.\zI"' + fi + } catch %{ try %{ + execute-keys -itersel -draft "h%opt{softtabstop}2s\h+\zd" + }}} +} + +define-command -hidden smarttab-impl %{ + set-option buffer smarttab_mode %opt{smarttab_smarttab_mode_name} + remove-hooks buffer smarttab-mode + smarttab-set + set-option buffer indentwidth 0 + set-option buffer aligntab false + hook -group smarttab-mode buffer InsertChar '\t' %{ try %{ + execute-keys -draft "^\h*.\z" + } catch %{ + execute-keys -draft "h@" + }} + hook -group smarttab-mode buffer InsertDelete ' ' %{ try %sh{ + if [ $kak_opt_softtabstop -gt 1 ]; then + printf "%s\n" 'execute-keys -draft "^\h+.\zI"' + fi + } catch %{ try %{ + execute-keys -itersel -draft "h%opt{softtabstop}2s\h+\zd" + }}} +} + +define-command -hidden autoconfigtab-impl %{ evaluate-commands %sh{ + if [ $kak_opt_aligntab = true ]; then + echo "noexpandtab" + elif [ $kak_opt_indentwidth -eq 0 ]; then + echo "smarttab" + else + echo "expandtab" + fi +}} + +define-command -hidden smarttab-set %{ evaluate-commands %sh{ + if [ $kak_opt_indentwidth -eq 0 ]; then + printf "%s\n" "set-option buffer indentwidth $kak_opt_oldindentwidth" + else + printf "%s\n" "set-option buffer oldindentwidth $kak_opt_indentwidth" + fi +}} + +§ diff --git a/config/mako/config b/config/mako/config new file mode 100644 index 00000000..6e722f29 --- /dev/null +++ b/config/mako/config @@ -0,0 +1,53 @@ +## Mako configuration file + +# GLOBAL CONFIGURATION OPTIONS +max-history=100 +sort=-time + +# BINDING OPTIONS +on-button-left=dismiss +on-button-middle=none +on-button-right=dismiss-all +on-touch=dismiss +on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga + +# STYLE OPTIONS +font=LiterationMono Nerd Font 16 +width=500 +height=132 +margin=10 +padding=15 +border-size=2 +border-radius=0 +icons=1 +max-icon-size=128 +icon-location=left +markup=1 +actions=1 +history=1 +text-alignment=left +default-timeout=5000 +ignore-timeout=0 +max-visible=5 +layer=overlay +anchor=bottom-center + + +background-color=#181818cc +text-color=#d8d8d8 +border-color=#7cafc2 + +[urgency=low] +background-color=#181818cc +text-color=#f7ca88 +border-color=#7cafc2 + +[urgency=high] +background-color=#181818cc +text-color=#ab4642 +border-color=#7cafc2 + +[category=mpd] +border-color=#f9e2af +default-timeout=2000 +group-by=category diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf new file mode 100644 index 00000000..86cc1591 --- /dev/null +++ b/config/mpd/mpd.conf @@ -0,0 +1,39 @@ +user "andy" +bind_to_address "localhost" + +log_file "~/mpd/log" +pid_file "~/mpd/pid" +state_file "~/mpd/state" +sticker_file "~/mpd/sticker.sql" + +database { + plugin "simple" + path "~/mpd/database" + cache_directory "~/.cache/mpd" +} + +auto_update "yes" +auto_update_depth "2" + +filesystem_charset "UTF-8" +music_directory "/mnt/multimedia/Musik" +playlist_directory "/mnt/multimedia/Musik/Playlists" + + +input { + plugin "curl" +} + +audio_output { + type "pipewire" + name "Pipewire Output" +} + +audio_output { + type "fifo" + name "mpdFIFO" + path "/tmp/mpd.fifo" + enabled "yes" + format "44100:16:2" +} + diff --git a/config/ncmpcpp/bindings b/config/ncmpcpp/bindings new file mode 100644 index 00000000..20e26f89 --- /dev/null +++ b/config/ncmpcpp/bindings @@ -0,0 +1,32 @@ +def_key "j" + scroll_down +def_key "k" + scroll_up +def_key "J" + move_sort_order_down +def_key "K" + move_sort_order_up +def_key "h" + previous_column +def_key "l" + next_column +def_key "ctrl-b" + page_up +def_key "ctrl-u" + page_up +def_key "ctrl-f" + page_down +def_key "ctrl-d" + page_down +def_key "g" + move_home +def_key "G" + move_end +def_key "n" + next_found_item +def_key "N" + previous_found_item +def_key "9" + show_lyrics +def_key "0" + show_clock diff --git a/config/ncmpcpp/config b/config/ncmpcpp/config new file mode 100644 index 00000000..d1deba7a --- /dev/null +++ b/config/ncmpcpp/config @@ -0,0 +1,20 @@ +visualizer_output_name = mpdFIFO +visualizer_fps = 60 +visualizer_in_stereo = yes +visualizer_spectrum_hz_min = 28 +visualizer_spectrum_hz_max = 18000 +visualizer_spectrum_smooth_look = yes +visualizer_spectrum_gain = 1.5 + +volume_change_step = 5 +user_interface = alternative +#progressbar_look = ⤼⤻ +store_lyrics_in_song_dir = no +generate_win32_compatible_filenames = yes +follow_now_playing_lyrics = yes +display_bitrate = yes +display_remaining_time = yes +use_console_editor = yes + +execute_on_song_change = $HOME/.local/bin/songinfo + diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py new file mode 100644 index 00000000..1b1e36a7 --- /dev/null +++ b/config/qutebrowser/config.py @@ -0,0 +1,1260 @@ +# Autogenerated config.py +# +# NOTE: config.py is intended for advanced users who are comfortable +# with manually migrating the config file on qutebrowser upgrades. If +# you prefer, you can also configure qutebrowser using the +# :set/:bind/:config-* commands without having to write a config.py +# file. +# +# Documentation: +# qute://help/configuring.html +# qute://help/settings.html + +# Change the argument to True to still load settings configured via autoconfig.yml +config.load_autoconfig(False) + +# Require a confirmation before quitting the application. +# Type: ConfirmQuit +# Valid values: +# - always: Always show a confirmation. +# - multiple-tabs: Show a confirmation if multiple tabs are opened. +# - downloads: Show a confirmation if downloads are running +# - never: Never show a confirmation. +c.confirm_quit = ['downloads'] + +# When to show a changelog after qutebrowser was upgraded. +# Type: String +# Valid values: +# - major: Show changelog for major upgrades (e.g. v2.0.0 -> v3.0.0). +# - minor: Show changelog for major and minor upgrades (e.g. v2.0.0 -> v2.1.0). +# - patch: Show changelog for major, minor and patch upgrades (e.g. v2.0.0 -> v2.0.1). +# - never: Never show changelog after upgrades. +c.changelog_after_upgrade = 'patch' + +# How to open links in an existing instance if a new one is launched. +# This happens when e.g. opening a link from a terminal. See +# `new_instance_open_target_window` to customize in which window the +# link is opened in. +# Type: String +# Valid values: +# - tab: Open a new tab in the existing window and activate the window. +# - tab-bg: Open a new background tab in the existing window and activate the window. +# - tab-silent: Open a new tab in the existing window without activating the window. +# - tab-bg-silent: Open a new background tab in the existing window without activating the window. +# - window: Open in a new window. +# - private-window: Open in a new private window. +c.new_instance_open_target = 'tab-bg' + +# Load a restored tab as soon as it takes focus. +# Type: Bool +c.session.lazy_restore = True + +# Backend to use to display websites. qutebrowser supports two different +# web rendering engines / backends, QtWebEngine and QtWebKit (not +# recommended). QtWebEngine is Qt's official successor to QtWebKit, and +# both the default/recommended backend. It's based on a stripped-down +# Chromium and regularly updated with security fixes and new features by +# the Qt project: https://wiki.qt.io/QtWebEngine QtWebKit was +# qutebrowser's original backend when the project was started. However, +# support for QtWebKit was discontinued by the Qt project with Qt 5.6 in +# 2016. The development of QtWebKit was picked up in an official fork: +# https://github.com/qtwebkit/qtwebkit - however, the project seems to +# have stalled again. The latest release (5.212.0 Alpha 4) from March +# 2020 is based on a WebKit version from 2016, with many known security +# vulnerabilities. Additionally, there is no process isolation and +# sandboxing. Due to all those issues, while support for QtWebKit is +# still available in qutebrowser for now, using it is strongly +# discouraged. +# Type: String +# Valid values: +# - webengine: Use QtWebEngine (based on Chromium - recommended). +# - webkit: Use QtWebKit (based on WebKit, similar to Safari - many known security issues!). +c.backend = 'webengine' + +# Force software rendering for QtWebEngine. This is needed for +# QtWebEngine to work with Nouveau drivers and can be useful in other +# scenarios related to graphic issues. +# Type: String +# Valid values: +# - software-opengl: Tell LibGL to use a software implementation of GL (`LIBGL_ALWAYS_SOFTWARE` / `QT_XCB_FORCE_SOFTWARE_OPENGL`) +# - qt-quick: Tell Qt Quick to use a software renderer instead of OpenGL. (`QT_QUICK_BACKEND=software`) +# - chromium: Tell Chromium to disable GPU support and use Skia software rendering instead. (`--disable-gpu`) +# - none: Don't force software rendering. +c.qt.force_software_rendering = 'chromium' + +# Force a Qt platform to use. This sets the `QT_QPA_PLATFORM` +# environment variable and is useful to force using the XCB plugin when +# running QtWebEngine on Wayland. +# Type: String +c.qt.force_platform = None + +# Force a Qt platformtheme to use. This sets the `QT_QPA_PLATFORMTHEME` +# environment variable which controls dialogs like the filepicker. By +# default, Qt determines the platform theme based on the desktop +# environment. +# Type: String +c.qt.force_platformtheme = 'qt6ct' + +# Which Chromium process model to use. Alternative process models use +# less resources, but decrease security and robustness. See the +# following pages for more details: - +# https://www.chromium.org/developers/design-documents/process-models +# - https://doc.qt.io/qt-6/qtwebengine-features.html#process-models +# Type: String +# Valid values: +# - process-per-site-instance: Pages from separate sites are put into separate processes and separate visits to the same site are also isolated. +# - process-per-site: Pages from separate sites are put into separate processes. Unlike Process per Site Instance, all visits to the same site will share an OS process. The benefit of this model is reduced memory consumption, because more web pages will share processes. The drawbacks include reduced security, robustness, and responsiveness. +# - single-process: Run all tabs in a single process. This should be used for debugging purposes only, and it disables `:open --private`. +c.qt.chromium.process_model = 'process-per-site-instance' + +# Turn on Qt HighDPI scaling. This is equivalent to setting +# QT_ENABLE_HIGHDPI_SCALING=1 (Qt >= 5.14) in the environment. It's off +# by default as it can cause issues with some bitmap fonts. As an +# alternative to this, it's possible to set font sizes and the +# `zoom.default` setting. +# Type: Bool +c.qt.highdpi = False + +# Always restore open sites when qutebrowser is reopened. Without this +# option set, `:wq` (`:quit --save`) needs to be used to save open tabs +# (and restore them), while quitting qutebrowser in any other way will +# not save/restore the session. By default, this will save to the +# session which was last loaded. This behavior can be customized via the +# `session.default_name` setting. +# Type: Bool +c.auto_save.session = True + +# Automatically start playing `