34 Commits

Author SHA1 Message Date
tonitch 082824261b adding a bunch of stuff (vim, nvim, bspwm) 2025-01-06 21:22:17 +01:00
tonitch 851e88be15 adding emoji green 2025-01-06 21:20:33 +01:00
tonitch f755edaa08 Merge branch 'master' of git.herisson.ovh:tonitch/dotfiles 2025-01-06 21:18:17 +01:00
tonitch 0c5f9af76f Config rounded edge picom 2025-01-06 21:17:33 +01:00
tonitch c94010fb12 adding dunst 2024-10-17 16:57:52 +02:00
tonitch c2b404b17f vim and nvim 2024-10-04 08:55:11 +02:00
tonitch 3808dc2b23 vim to neovim 2024-08-23 11:20:30 +02:00
tonitch 64e3e458bc adding vim-abolish 2024-06-26 10:30:53 +02:00
tonitch 719dab7021 tmux to stow 2024-06-15 13:20:00 +02:00
tonitch faf7b09231 zsh enhancd 2024-06-15 13:19:48 +02:00
tonitch 95b8678f15 Getting rid of Vundle and utilizing git power and pack builtin 2024-06-15 13:19:11 +02:00
tonitch 21de46be60 some changes 2024-05-08 12:30:33 +02:00
tonitch 9564a2fa86 notification toggler 2024-04-24 16:16:21 +02:00
tonitch e206905123 lombok 2024-04-16 12:29:28 +02:00
tonitch 19a9c145b3 adding tmux 2024-04-09 21:44:32 +02:00
tonitch fce84614f9 fap and dog commands 2024-03-06 18:48:48 +01:00
tonitch 92335b8773 Adding submodules 2024-01-13 13:07:39 +01:00
tonitch e73ff72331 Avoiding zathura to be transparent because you need to read 2024-01-11 12:02:40 +01:00
tonitch 6f1a904990 vim qol 2024-01-10 14:46:47 +01:00
tonitch 00c6530485 Lot of small changes 2024-01-09 16:08:23 +01:00
Debucquoy 71b5d1313a Some changes from minitoninux 2024-01-06 18:04:23 +01:00
tonitch f306afddb8 gitconfig 2023-12-14 21:19:31 +01:00
tonitch 4c27a8e3f1 Adding bin files
tmuxssh allow to connect and attach or create a tmux session.
2023-11-29 13:12:15 +01:00
tonitch 9902c0db9d zathura no gui bar 2023-11-22 10:43:23 +01:00
tonitch 51cc27407c picom 2023-11-20 21:54:47 +01:00
Debucquoy 4f54cedca0 zathura 2023-11-20 15:05:12 +01:00
Debucquoy ed81ad21b8 bspwm and sxhkd 2023-11-11 16:26:39 +01:00
tonitch 73a022bfe6 zoom, and fixit with f9 2023-11-02 14:28:05 +01:00
Debucquoy aa79a6d024 adding texlab to ycm 2023-11-02 11:52:44 +01:00
Debucquoy 7f78647c46 merging vim folders 2023-11-02 10:11:39 +01:00
Debucquoy 4234763787 merging vimrc 2023-11-02 09:57:45 +01:00
Debucquoy e45b4905da zsh more and less 2023-11-02 09:24:47 +01:00
tonitch 300b4e0a6e zsh 2023-10-25 13:44:49 +02:00
tonitch 9eede5ef5f First Commit
This is a first dotfiles config. I think I have a lot more to add tho...
2023-10-24 23:29:07 +02:00
48 changed files with 43 additions and 2281 deletions
-2
View File
@@ -2,5 +2,3 @@ vim/.vim/.netrwhist
vim/.vim/bundle vim/.vim/bundle
!vim/.vim/bundle/Vundle.vim !vim/.vim/bundle/Vundle.vim
__pycache__/
-27
View File
@@ -103,30 +103,3 @@
[submodule "vim/.vim/pack/autoload/start/vim-textidote"] [submodule "vim/.vim/pack/autoload/start/vim-textidote"]
path = vim/.vim/pack/autoload/start/vim-textidote path = vim/.vim/pack/autoload/start/vim-textidote
url = https://github.com/PatrBal/vim-textidote url = https://github.com/PatrBal/vim-textidote
[submodule "nvim/.config/nvim/pack/autoload/start/nvim-dap"]
path = nvim/.config/nvim/pack/autoload/start/nvim-dap
url = git@github.com:mfussenegger/nvim-dap
[submodule "nvim/.config/nvim/pack/autoload/start/LanguageTool.nvim"]
path = nvim/.config/nvim/pack/autoload/start/LanguageTool.nvim
url = git@github.com:vigoux/LanguageTool.nvim
[submodule "nvim/.config/nvim/pack/autoload/start/nvim-dap-ui"]
path = nvim/.config/nvim/pack/autoload/start/nvim-dap-ui
url = git@github.com:rcarriga/nvim-dap-ui
[submodule "nvim/.config/nvim/pack/autoload/start/nvim-jdtls"]
path = nvim/.config/nvim/pack/autoload/start/nvim-jdtls
url = git@github.com:mfussenegger/nvim-jdtls
[submodule "nvim/.config/nvim/pack/autoload/start/nvim-lspconfig"]
path = nvim/.config/nvim/pack/autoload/start/nvim-lspconfig
url = git@github.com:neovim/nvim-lspconfig
[submodule "nvim/.config/nvim/pack/autoload/start/nvim-nio"]
path = nvim/.config/nvim/pack/autoload/start/nvim-nio
url = git@github.com:nvim-neotest/nvim-nio
[submodule "nvim/.config/nvim/pack/autoload/start/ranger.vim"]
path = nvim/.config/nvim/pack/autoload/start/ranger.vim
url = git@github.com:francoiscabrol/ranger.vim
[submodule "nvim/.config/nvim/pack/autoload/start/reply.vim"]
path = nvim/.config/nvim/pack/autoload/start/reply.vim
url = git@github.com:rhysd/reply.vim
[submodule "nvim/.config/nvim/pack/autoload/start/vim-dispatch"]
path = nvim/.config/nvim/pack/autoload/start/vim-dispatch
url = git@github.com:tpope/vim-dispatch
-71
View File
@@ -1,71 +0,0 @@
[minecraftonitch]
source = imaps://minecraftonitch%40gmail.com@imap.gmail.com:993
source-cred-cmd = cat $HOME/.config/pass/minecraftonitch_aerc.txt
outgoing = smtps://minecraftonitch%40gmail.com@smtp.gmail.com:465
outgoing-cred-cmd = cat $HOME/.config/pass/minecraftonitch_aerc.txt
default = INBOX
archive = [Gmail]/All Mail
postpone = [Gmail]/Drafts
from = tonitch <minecraftonitch@gmail.com>
cache-headers = true
# carddav-source = https://minecraftonitch%40gmail.com@www.googleapis.com/carddav/v1/principals/minecraftonitch@gmail.com/lists/default
# carddav-cred-cmd = cat $HOME/.config/pass/minecraftonitch_aerc.txt
# address-book-cmd = carddav-query -S minecraftonitch %s
[d.tonitch]
source = imaps://d.tonitch%40gmail.com@imap.gmail.com:993
source-cred-cmd = cat $HOME/.config/pass/dtonitch_aerc.txt
outgoing = smtps://d.tonitch%40gmail.com@smtp.gmail.com:465
outgoing-cred-cmd = cat $HOME/.config/pass/dtonitch_aerc.txt
default = INBOX
archive = [Gmail]/Tous les messages
from = "anthony debucquoy (tonitch)" <d.tonitch@gmail.com>
cache-headers = true
# carddav-source = https://d.tonitch%40gmail.com@www.googleapis.com/carddav/v1/principals/d.tonitch@gmail.com/lists/default
# carddav-cred-cmd = cat $HOME/.config/pass/dtonitch_aerc.txt
# address-book-cmd = carddav-query -S d.tonitch %s
[debucquoy.anthony]
source = imaps://debucquoy.anthony%40gmail.com@imap.gmail.com:993
source-cred-cmd = cat $HOME/.config/pass/debucquoyanthony_aerc.txt
outgoing = smtps://debucquoy.anthony%40gmail.com@smtp.gmail.com:465
outgoing-cred-cmd = cat $HOME/.config/pass/debucquoyanthony_aerc.txt
default = INBOX
archive = [Gmail]/Tous les messages
from = "Debucquoy Anthony" <debucquoy.anthony@gmail.com>
cache-headers = true
# carddav-source = https://debucquoy.anthony%40gmail.com@www.googleapis.com/carddav/v1/principals/debucquoy.anthony@gmail.com/lists/default
# carddav-cred-cmd = cat $HOME/.config/pass/debucquoyanthony_aerc.txt
# address-book-cmd = carddav-query -S debucquoy.anthony %s
[herisson]
source = imaps://tonitch@mail.herisson.ovh:993
source-cred-cmd = cat $HOME/.config/pass/herisson_aerc.txt
outgoing = smtp://tonitch@mail.herisson.ovh:587
outgoing-cred-cmd = cat $HOME/.config/pass/herisson_aerc.txt
default = INBOX
from = tonitch <tonitch@herisson.ovh>
cache-headers = true
[University]
source = imaps+xoauth2://231687%40umons.ac.be@outlook.office365.com:993
source-cred-cmd = python3 $HOME/.config/aerc/mutt_oauth2.py $HOME/.config/pass/231687@umons.ac.be.tokens
outgoing = smtp+xoauth2://231687%40umons.ac.be@smtp.office365.com:587
outgoing-cred-cmd = python3 $HOME/.config/aerc/mutt_oauth2.py $HOME/.config/pass/231687@umons.ac.be.tokens
default = INBOX
cache-headers = true
archive = Archives
# from = "Debucquoy Anthony" <cpumons@umons.ac.be>
from = "Debucquoy Anthony" <anthony.debucquoy@student.umons.ac.be>
[EnCheminVers]
source = imaps://info%40encheminvers.be@imap.mail.ovh.net:993
source-cred-cmd = cat $HOME/.config/pass/encheminvers_aerc.txt
outgoing = smtps://info%40encheminvers.be@smtp.mail.ovh.net
outgoing-cred-cmd = cat $HOME/.config/pass/encheminvers_aerc.txt
default = INBOX
from = Anthony <info@encheminvers.be>
copy-to = Sent
cache-headers = true
-863
View File
@@ -1,863 +0,0 @@
#
# aerc main configuration
[general]
#
# Used as a default path for save operations if no other path is specified.
# ~ is expanded to the current user home dir.
#
default-save-path=~/Downloads/aerc/
# If set to "gpg", aerc will use system gpg binary and keystore for all crypto
# operations. If set to "internal", the internal openpgp keyring will be used.
# If set to "auto", the system gpg will be preferred unless the internal
# keyring already exists, in which case the latter will be used.
#
# Default: auto
pgp-provider=auto
# 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
# Output log messages to specified file. A path starting with ~/ is expanded to
# the user home dir. When redirecting aerc's output to a file using > shell
# redirection, this setting is ignored and log messages are printed to stdout.
#
#log-file=
# Only log messages above the specified level to log-file. Supported levels
# are: trace, debug, info, warn and error. When redirecting aerc's output to
# a file using > shell redirection, this setting is ignored and the log level
# is forced to trace.
#
# Default: info
#log-level=debug
# Disable IPC entirely. Don't run commands (including mailto:... and mbox:...)
# in an existing aerc instance, and don't start an IPC server to allow
# subsequent aerc instances to run commands in the current one.
#
# Default: false
#disable-ipc=false
# Don't run mailto:... commands over IPC; start a new aerc instance with the
# composer instead.
#
# Default: false
#disable-ipc-mailto=false
#
# Don't run mbox:... commands over IPC; start a new aerc instance with the mbox
# file instead.
#
# Default: false
#disable-ipc-mbox=false
# Set the $TERM environment variable used for the embedded terminal.
#
# Default: xterm-256color
term=st-256color
# Display OSC8 strings in the embedded terminal
#
# Default: false
#enable-osc8=false
# Default shell command to use for :menu. This will be executed with sh -c and
# will run in an popover dialog.
#
# Any occurrence of %f will be replaced by a temporary file path where the
# command is expected to write output lines to be consumed by :menu. Otherwise,
# the lines will be read from the command's standard output.
#
# Examples:
# default-menu-cmd=fzf
# default-menu-cmd=fzf --multi
# default-menu-cmd=dmenu -l 20
# default-menu-cmd=ranger --choosefiles=%f
#
#default-menu-cmd=
[ui]
#
# Describes the format for each row in a mailbox view. This is a comma
# separated list of column names with an optional align and width suffix. After
# the column name, one of the '<' (left), ':' (center) or '>' (right) alignment
# characters can be added (by default, left) followed by an optional width
# specifier. The width is either an integer representing a fixed number of
# characters, or a percentage between 1% and 99% representing a fraction of the
# terminal width. It can also be one of the '*' (auto) or '=' (fit) special
# width specifiers. Auto width columns will be equally attributed the remaining
# terminal width. Fit width columns take the width of their contents. If no
# width specifier is set, '*' is used by default.
#
# Default: flags:4,name<20%,subject,date>=
#index-columns=flags:4,name<20%,subject,date>=
#
# Each name in index-columns must have a corresponding column-$name setting.
# All column-$name settings accept golang text/template syntax. See
# aerc-templates(7) for available template attributes and functions.
#
# Here are some examples to show the To field instead of the From field for
# an email (modifying column-name):
#
# 1. a generic one
# column-name={{ .Peer | names | join ", " }}
# 2. based upon the selected folder
# column-name={{if match .Folder "^(Gesendet|Sent)$"}}{{index (.To | names) 0}}{{else}}{{index (.From | names) 0}}{{end}}
#
# Default settings
#column-flags={{.Flags | join ""}}
#column-name={{index (.From | names) 0}}
#column-subject={{.ThreadPrefix}}{{.Subject}}
#column-date={{.DateAutoFormat .Date.Local}}
#
# String separator inserted between columns. When the column width specifier is
# an exact number of characters, the separator is added to it (i.e. the exact
# width will be fully available for the column contents).
#
# Default: " "
#column-separator=" "
#
# See time.Time#Format at https://godoc.org/time#Time.Format
#
# Default: 2006 Jan 02
#timestamp-format=2006 Jan 02
#
# Index-only time format for messages that were received/sent today.
# If this is empty, timestamp-format is used instead.
#
# Default: 15:04
#this-day-time-format=15:04
#
# Index-only time format for messages that were received/sent within the last
# 7 days. If this is empty, timestamp-format is used instead.
#
# Default: Jan 02
#this-week-time-format=Jan 02
#
# Index-only time format for messages that were received/sent this year.
# If this is empty, timestamp-format is used instead.
#
#Default: Jan 02
#this-year-time-format=Jan 02
#
# Overrides timestamp-format for the message view.
#
# Default: 2006 Jan 02, 15:04 GMT-0700
#message-view-timestamp-format=2006 Jan 02, 15:04 GMT-0700
#
# If set, overrides timestamp-format in the message view for messages
# that were received/sent today.
#
#message-view-this-day-time-format=
# If set, overrides timestamp-format in the message view for messages
# that were received/sent within the last 7 days.
#
#message-view-this-week-time-format=
#
# If set, overrides *timestamp-format* in the message view for messages
# that were received/sent this year.
#
#message-view-this-year-time-format=
#
# Width of the sidebar, including the border.
#
# Default: 22
#sidebar-width=22
#
# Default split layout for message list tabs. The syntax is:
#
# [<direction>] <size>
#
# <direction> is optional and defaults to horizontal. It can take one
# of the following values: h, horiz, horizontal, v, vert, vertical.
#
# <size> is a positive integer representing the size (in terminal cells)
# of the message list window.
#
#message-list-split=
#
# 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)
#
# Value to set {{.Subject}} template to when subject is empty.
#
# Default: (no subject)
#empty-subject=(no subject)
# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel
#
# Default: false
mouse-enabled=true
#
# Ring the bell when new messages are received
#
# Default: true
#new-message-bell=true
#
# Template to use for Account tab titles
#
# Default: {{.Account}}
#tab-title-account={{.Account}}
#
# Template to use for Composer tab titles
#
# Default: {{if .To}}to:{{index (.To | shortmboxes) 0}} {{end}}{{.SubjectBase}}
#tab-title-composer={{if .To}}to:{{index (.To | shortmboxes) 0}} {{end}}{{.SubjectBase}}
#
# Template to use for Message Viewer tab titles
#
# Default: {{.Subject}}
#tab-title-viewer={{.Subject}}
# Marker to show before a pinned tab's name.
#
# Default: `
#pinned-tab-marker='`'
# Template for the left side of the directory list.
# See aerc-templates(7) for all available fields and functions.
#
# Default: {{.Folder}}
#dirlist-left={{.Folder}}
# Template for the right side of the directory list.
# See aerc-templates(7) for all available fields and functions.
#
# Default: {{if .Unread}}{{humanReadable .Unread}}{{end}}
#dirlist-right={{if .Unread}}{{humanReadable .Unread}}{{end}}
# 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"
#
# sort=from -r date
# Moves to next message when the current message is deleted
#
# Default: true
#next-message-on-delete=true
# Automatically set the "seen" flag when a message is opened in the message
# viewer.
#
# Default: true
#auto-mark-read=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
#
#stylesets-dirs=
# Uncomment to use box-drawing characters for vertical and horizontal borders.
#
# Default: "│" and "─"
#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.
#
# Default: false
#fuzzy-complete=false
# How long to wait after the last input before auto-completion is triggered.
#
# Default: 250ms
#completion-delay=250ms
# The minimum required characters to allow auto-completion to be triggered after
# completion-delay.
#
# Setting this to "manual" disables automatic completion, leaving only the
# manually triggered completion with the $complete key (see aerc-binds(5) for
# more details).
#
# Default: 1
#completion-min-chars=1
#
# 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=⚠
# Reverses the order of the message list. By default, the message list is
# ordered with the newest (highest UID) message on top. Reversing the order
# will put the oldest (lowest UID) message on top. This can be useful in cases
# where the backend does not support sorting.
#
# Default: false
reverse-msglist-order = true
# Reverse display of the message threads. Default order is the initial
# message is on the top with all the replies being displayed below. The
# reverse option will put the initial message at the bottom with the
# replies on top.
#
# Default: false
# reverse-thread-order=true
# Positions the cursor on the last message in the message list (at the
# bottom of the view) when opening a new folder.
#
# Default: false
#select-last-message=false
# Sort the thread siblings according to the sort criteria for the messages. If
# sort-thread-siblings is false, the thread siblings will be sorted based on
# the message UID in ascending order. This option is only applicable for
# client-side threading with a backend that enables sorting. Note that there's
# a performance impact when sorting is activated.
#
# Default: false
#sort-thread-siblings=false
# Set the scroll offset in number of lines from the top and bottom of the
# message list.
#
# Default: 0
#msglist-scroll-offset = 0
#
# 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=true
# Force client-side thread building
#
# Default: false
#force-client-threads=false
# If no References nor In-Reply-To headers can be matched to build client side
# threads, fallback to similar subjects.
#
# Default: false
#threading-by-subject=false
# Show thread context enables messages which do not match the current query (or
# belong to the current mailbox) to be shown for context. These messages can be
# styled separately using "msglist_thread_context" in a styleset. This feature
# is not supported by all backends
#
# Default: false
#show-thread-context=false
# Debounce client-side thread building
#
# Default: 50ms
#client-threads-delay=50ms
#
# Thread prefix customization:
#
# Customize the thread prefix appearance by selecting the arrow head.
#
# Default: ">"
#thread-prefix-tip = ">"
#
# Customize the thread prefix appearance by selecting the arrow indentation.
#
# Default: " "
#thread-prefix-indent = " "
#
# Customize the thread prefix appearance by selecting the vertical extension of
# the arrow.
#
# Default: "│"
#thread-prefix-stem = "│"
#
# Customize the thread prefix appearance by selecting the horizontal extension
# of the arrow.
#
# Default: ""
#thread-prefix-limb = ""
#
# Customize the thread prefix appearance by selecting the folded thread
# indicator.
#
# Default: "+"
#thread-prefix-folded = "+"
#
# Customize the thread prefix appearance by selecting the unfolded thread
# indicator.
#
# Default: ""
#thread-prefix-unfolded = ""
#
# Customize the thread prefix appearance by selecting the first child connector.
#
# Default: ""
#thread-prefix-first-child = ""
#
# Customize the thread prefix appearance by selecting the connector used if
# the message has siblings.
#
# Default: "├─"
#thread-prefix-has-siblings = "├─"
#
# Customize the thread prefix appearance by selecting the connector used if the
# message has no parents and no children.
#
# Default: ""
#thread-prefix-lone = ""
#
# Customize the thread prefix appearance by selecting the connector used if the
# message has no parents and has children.
#
# Default: ""
#thread-prefix-orphan = ""
#
# Customize the thread prefix appearance by selecting the connector for the last
# sibling.
#
# Default: "└─"
#thread-prefix-last-sibling = "└─"
#
# Customize the reversed thread prefix appearance by selecting the connector for
# the last sibling.
#
# Default: "┌─"
#thread-prefix-last-sibling-reverse = "┌─"
#
# Customize the thread prefix appearance by selecting the connector for dummy
# thread.
#
# Default: "┬─"
#thread-prefix-dummy = "┬─"
#
# Customize the reversed thread prefix appearance by selecting the connector for
# dummy thread.
#
# Default: "┴─"
#thread-prefix-dummy-reverse = "┴─"
#
# Customize the reversed thread prefix appearance by selecting the first child
# connector.
#
# Default: ""
#thread-prefix-first-child-reverse = ""
#
# Customize the reversed thread prefix appearance by selecting the connector
# used if the message has no parents and has children.
#
# Default: ""
#thread-prefix-orphan-reverse = ""
[statusline]
#
# Describes the format for the status line. This is a comma separated list of
# column names with an optional align and width suffix. See [ui].index-columns
# for more details. To completely mute the status line except for push
# notifications, explicitly set status-columns to an empty string.
#
# Default: left<*,center:=,right>*
#status-columns=left<*,center:=,right>*
#
# Each name in status-columns must have a corresponding column-$name setting.
# All column-$name settings accept golang text/template syntax. See
# aerc-templates(7) for available template attributes and functions.
#
# Default settings
#column-left=[{{.Account}}] {{.StatusInfo}}
#column-center={{.PendingKeys}}
#column-right={{.TrayInfo}} | {{cwd}}
#
# String separator inserted between columns.
# See [ui].column-separator for more details.
#
#column-separator=" "
# Specifies the separator between grouped statusline elements.
#
# Default: " | "
#separator=" | "
# Defines the mode for displaying the status elements.
# Options: text, icon
#
# Default: text
#display-mode=text
[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 -Rc
#pager=less -Rc
#
# 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
# Define the maximum height of the mimetype switcher before a scrollbar is used.
# The height of the mimetype switcher is restricted to half of the display
# height. If the provided value for the height is zero, the number of parts will
# be used as the height of the type switcher.
#
# Default: 0
#max-mime-height = 0
# 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=
#
# When set, aerc will create and read .eml files for composing that have
# non-standard \n linebreaks. This is only relevant if the used editor does not
# support CRLF linebreaks.
#
#lf-editor=false
#
# 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
#
# Edit headers into the text editor instead than separate fields.
#
# When this is true, address-book-cmd is not supported and address completion
# is left to the editor itself. Also, displaying multiple headers on the same
# line is not possible.
#
# Default: false
#edit-headers=false
#
# 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=
# address-book-cmd=emailbook /home/tonitch/.cache/emailbook --search "%s"
# address-book-cmd=carddav-query %s
address-book-cmd=khard email --parsable --search-in-source-files --remove-first-line %s
# Specifies the command to be used to select attachments. Any occurrence of
# '%s' in the file-picker-cmd will be replaced with the argument <arg>
# to :attach -m <arg>. Any occurence of '%f' will be replaced by the
# location of a temporary file, from which aerc will read the selected files.
#
# If '%f' is not present, the command must output the selected files to
# standard output, one file per line. If it is present, then aerc does not
# capture the standard output and instead reads the files from the temporary
# file which should have the same format.
#file-picker-cmd=
#
# Allow to address yourself when replying
#
# Default: true
#reply-to-self=true
# Warn before sending an email with an empty subject.
#
# Default: false
#empty-subject-warning=false
#
# Warn before sending an email that matches the specified regexp but does not
# have any attachments. Leave empty to disable this feature.
#
# Uses Go's regexp syntax, documented at https://golang.org/s/re2syntax. The
# "(?im)" flags are set by default (case-insensitive and multi-line).
#
# Example:
# no-attachment-warning=^[^>]*attach(ed|ment)
#
#no-attachment-warning=
#
# When set, aerc will generate "format=flowed" bodies with a content type of
# "text/plain; format=flowed" as described in RFC3676. This format is easier to
# handle for some mailing software, and generally just looks like ordinary
# text. To actually make use of this format's features, you'll need support in
# your editor.
#
#format-flowed=false
[multipart-converters]
#
# Converters allow to generate multipart/alternative messages by converting the
# main text/plain part into any other MIME type. Only exact MIME types are
# accepted. The commands are invoked with sh -c and are expected to output
# valid UTF-8 text.
#
# Example (obviously, this requires that you write your main text/plain body
# using the markdown syntax):
# text/html=pandoc -f markdown -t html --standalone
[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 commands are invoked with sh -c. The following folders are prepended to
# the system $PATH to allow referencing filters from their name only:
#
# ${XDG_CONFIG_HOME:-~/.config}/aerc/filters
# ~/.local/libexec/aerc/filters
# ${XDG_DATA_HOME:-~/.local/share}/aerc/filters
# $PREFIX/libexec/aerc/filters
# $PREFIX/share/aerc/filters
# /usr/libexec/aerc/filters
# /usr/share/aerc/filters
#
# If you want to run a program in your default $PATH which has the same name
# as a builtin filter (e.g. /usr/bin/colorize), use its absolute path.
#
# The following variables are defined in the filter command environment:
#
# AERC_MIME_TYPE the part MIME type/subtype
# AERC_FORMAT the part content type format= parameter
# AERC_FILENAME the attachment filename (if any)
# AERC_SUBJECT the message Subject header value
# AERC_FROM the message From header value
#
# 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.
#
text/plain=colorize
text/calendar=calendar
message/delivery-status=colorize
message/rfc822=colorize
text/html=pandoc -f html -t plain | colorize
#text/html=html | colorize
#text/*=bat -fP --file-name="$AERC_FILENAME"
#application/x-sh=bat -fP -l sh
image/*=catimg -w $(tput cols) -
#subject,~Git(hub|lab)=lolcat -f
#from,thatguywhodoesnothardwraphismessages=wrap -w 100 | colorize
# This special filter is only used to post-process email headers when
# [viewer].show-headers=true
# By default, headers are piped directly into the pager.
#
.headers=colorize
[openers]
#
# Openers allow you to specify the command to use for the :open and :open-link
# actions on a per-MIME-type basis. The :open-link URL scheme is used to
# determine the MIME type as follows: x-scheme-handler/<scheme>.
#
# {} is expanded as the temporary filename or URL to be opened with proper
# shell quoting. If it is not encountered in the command, the filename/URL will
# be appended to the end of the command. The command will then be executed with
# `sh -c`.
#
# Like [filters], openers support basic shell globbing. The first opener which
# matches the part's MIME type (or URL scheme handler MIME type) will be used,
# so order them from most to least specific.
#
# Examples:
# x-scheme-handler/irc=hexchat
# x-scheme-handler/http*=printf '%s' {} | wl-copy
# text/html=surf -dfgms
# text/plain=gvim {} +125
# message/rfc822=thunderbird
[hooks]
#
# Hooks are triggered whenever the associated event occurs.
#
# Executed when a new email arrives in the selected folder
mail-received=notify-send "[$AERC_ACCOUNT/$AERC_FOLDER] New mail from $AERC_FROM_NAME" "$AERC_SUBJECT"
#
# Executed when mail is deleted from a folder
#mail-deleted=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" &
#
# Executed when aerc adds mail to a folder
#mail-added=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" &
#
# Executed when aerc starts
#aerc-startup=aerc :terminal calcurse && aerc :next-tab
aerc-startup=aerc :terminal khal interactive && aerc :next-tab
#
# Executed when aerc shuts down.
#aerc-shutdown=
#
# Executed when notmuch tags are modified.
#tag-modified=
#
# Executed when flags are changed on a message.
#flag-changed=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" &
[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
#
# template-dirs=/home/tonitch/Documents/cpumons/pulls/mails/
# 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
-186
View File
@@ -1,186 +0,0 @@
# Binds are of the form <key sequence> = <command to run>
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
<C-p> = :prev-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgDn> = :next-tab<Enter>
\[t = :prev-tab<Enter>
\]t = :next-tab<Enter>
<C-t> = :term<Enter>
? = :help keys<Enter>
<C-c> = :prompt 'Quit?' quit<Enter>
<C-q> = :prompt 'Quit?' quit<Enter>
<C-z> = :suspend<Enter>
[messages]
q = :prompt 'Quit?' quit<Enter>
j = :next<Enter>
<Down> = :next<Enter>
<C-d> = :next 50%<Enter>
<C-f> = :next 100%<Enter>
<PgDn> = :next 100%<Enter>
k = :prev<Enter>
<Up> = :prev<Enter>
<C-u> = :prev 50%<Enter>
<C-b> = :prev 100%<Enter>
<PgUp> = :prev 100%<Enter>
g = :select 0<Enter>
G = :select -1<Enter>
J = :next-folder<Enter>
<C-Down> = :next-folder<Enter>
K = :prev-folder<Enter>
<C-Up> = :prev-folder<Enter>
H = :collapse-folder<Enter>
<C-Left> = :collapse-folder<Enter>
L = :expand-folder<Enter>
<C-Right> = :expand-folder<Enter>
v = :mark -t<Enter>
<Space> = :mark -t<Enter>:next<Enter>
V = :mark -v<Enter>
T = :toggle-threads<Enter>
zc = :fold<Enter>
zo = :unfold<Enter>
za = :fold -t<Enter>
zM = :fold -a<Enter>
zR = :unfold -a<Enter>
<tab> = :fold -t<Enter>
zz = :align center<Enter>
zt = :align top<Enter>
zb = :align bottom<Enter>
<Enter> = :view<Enter>
d = :choose -o y 'Really delete this message' delete-message<Enter>
D = :delete<Enter>
a = :archive flat<Enter>
A = :unmark -a<Enter>:mark -T<Enter>:archive flat<Enter>
C = :compose<Enter>
m = :compose<Enter>
b = :bounce<space>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
Rr = :reply<Enter>
Rq = :reply -q<Enter>
c = :cf<space>
$ = :term<space>
! = :term<space>
| = :pipe<space>
/ = :search<space>
\ = :filter<space>
n = :next-result<Enter>
N = :prev-result<Enter>
<Esc> = :clear<Enter>
s = :split<Enter>
S = :vsplit<Enter>
pl = :patch list<Enter>
pa = :patch apply <Tab>
pd = :patch drop <Tab>
pb = :patch rebase<Enter>
pt = :patch term<Enter>
ps = :patch switch <Tab>
[messages:folder=Drafts]
<Enter> = :recall<Enter>
[view]
/ = :toggle-key-passthrough<Enter>/
q = :close<Enter>
O = :open<Enter>
o = :open<Enter>
S = :save<space>
| = :pipe<space>
D = :delete<Enter>
#A = :archive flat<Enter>
A = :archive flat<Enter>:close<Enter>
<C-l> = :open-link <space>
f = :forward<Enter>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
Rr = :reply<Enter>
Rq = :reply -q<Enter>
H = :toggle-headers<Enter>
<C-k> = :prev-part<Enter>
<C-Up> = :prev-part<Enter>
<C-j> = :next-part<Enter>
<C-Down> = :next-part<Enter>
J = :next<Enter>
<C-Right> = :next<Enter>
K = :prev<Enter>
<C-Left> = :prev<Enter>
aa = :pipe -m khard add-email -f<Enter>
[view::passthrough]
$noinherit = true
$ex = <C-x>
<Esc> = :toggle-key-passthrough<Enter>
[compose]
# Keybindings used when the embedded terminal is not selected in the compose
# view
$noinherit = true
$ex = <C-x>
$complete = <C-o>
<C-k> = :prev-field<Enter>
<C-Up> = :prev-field<Enter>
<C-j> = :next-field<Enter>
<C-Down> = :next-field<Enter>
<A-p> = :switch-account -p<Enter>
<C-Left> = :switch-account -p<Enter>
<A-n> = :switch-account -n<Enter>
<C-Right> = :switch-account -n<Enter>
<tab> = :next-field<Enter>
<backtab> = :prev-field<Enter>
<C-p> = :prev-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgDn> = :next-tab<Enter>
[compose::editor]
# Keybindings used when the embedded terminal is selected in the compose view
$noinherit = true
$ex = <C-x>
<C-k> = :prev-field<Enter>
<C-Up> = :prev-field<Enter>
<C-j> = :next-field<Enter>
<C-Down> = :next-field<Enter>
<C-p> = :prev-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgDn> = :next-tab<Enter>
[compose::review]
# Keybindings used when reviewing a message to be sent
# Inline comments are used as descriptions on the review screen
y = :send<Enter> # Send
n = :abort<Enter> # Abort (discard message, no confirmation)
v = :preview<Enter> # Preview message
p = :postpone<Enter> # Postpone
q = :choose -o d discard abort -o p postpone postpone<Enter> # Abort or postpone
e = :edit<Enter> # Edit
a = :attach<space> # Add attachment
d = :detach<space> # Remove attachment
[terminal]
$noinherit = true
$ex = <C-x>
<C-p> = :prev-tab<Enter>
<C-n> = :next-tab<Enter>
<C-PgUp> = :prev-tab<Enter>
<C-PgDn> = :next-tab<Enter>
-422
View File
@@ -1,422 +0,0 @@
#!/usr/bin/env python3
#
# Mutt OAuth2 token management script, version 2020-08-07
# Written against python 3.7.3, not tried with earlier python versions.
#
# Copyright (C) 2020 Alexander Perlis
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
'''Mutt OAuth2 token management'''
import sys
import json
import argparse
import urllib.parse
import urllib.request
import imaplib
import poplib
import smtplib
import base64
import secrets
import hashlib
import time
from datetime import timedelta, datetime
from pathlib import Path
import socket
import http.server
import subprocess
import readline
# The token file must be encrypted because it contains multi-use bearer tokens
# whose usage does not require additional verification. Specify whichever
# encryption and decryption pipes you prefer. They should read from standard
# input and write to standard output. The example values here invoke GPG,
# although won't work until an appropriate identity appears in the first line.
ENCRYPTION_PIPE = ['gpg', '--encrypt', '--recipient', 'debucquoy.anthony@gmail.com']
DECRYPTION_PIPE = ['gpg', '--decrypt']
registrations = {
'google': {
'authorize_endpoint': 'https://accounts.google.com/o/oauth2/auth',
'devicecode_endpoint': 'https://oauth2.googleapis.com/device/code',
'token_endpoint': 'https://accounts.google.com/o/oauth2/token',
'redirect_uri': 'urn:ietf:wg:oauth:2.0:oob',
'imap_endpoint': 'imap.gmail.com',
'pop_endpoint': 'pop.gmail.com',
'smtp_endpoint': 'smtp.gmail.com',
'sasl_method': 'OAUTHBEARER',
'scope': 'https://mail.google.com/',
'client_id': '',
'client_secret': '',
},
'microsoft': {
'authorize_endpoint': 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
'devicecode_endpoint': 'https://login.microsoftonline.com/common/oauth2/v2.0/devicecode',
'token_endpoint': 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
# 'redirect_uri': 'https://login.microsoftonline.com/common/oauth2/nativeclient',
'redirect_uri': 'https://localhost',
'tenant': 'common',
'imap_endpoint': 'outlook.office365.com',
'pop_endpoint': 'outlook.office365.com',
'smtp_endpoint': 'smtp.office365.com',
'sasl_method': 'XOAUTH2',
'scope': ('offline_access https://outlook.office.com/IMAP.AccessAsUser.All '
'https://outlook.office.com/POP.AccessAsUser.All '
'https://outlook.office.com/SMTP.Send'),
'client_id': '9e5f94bc-e8a4-4e73-b8be-63364c29d753',
'client_secret': '',
},
}
ap = argparse.ArgumentParser(epilog='''
This script obtains and prints a valid OAuth2 access token. State is maintained in an
encrypted TOKENFILE. Run with "--verbose --authorize" to get started or whenever all
tokens have expired, optionally with "--authflow" to override the default authorization
flow. To truly start over from scratch, first delete TOKENFILE. Use "--verbose --test"
to test the IMAP/POP/SMTP endpoints.
''')
ap.add_argument('-v', '--verbose', action='store_true', help='increase verbosity')
ap.add_argument('-d', '--debug', action='store_true', help='enable debug output')
ap.add_argument('tokenfile', help='persistent token storage')
ap.add_argument('-a', '--authorize', action='store_true', help='manually authorize new tokens')
ap.add_argument('--authflow', help='authcode | localhostauthcode | devicecode')
ap.add_argument('-t', '--test', action='store_true', help='test IMAP/POP/SMTP endpoints')
args = ap.parse_args()
token = {}
path = Path(args.tokenfile)
if path.exists():
if 0o777 & path.stat().st_mode != 0o600:
sys.exit('Token file has unsafe mode. Suggest deleting and starting over.')
try:
sub = subprocess.run(DECRYPTION_PIPE, check=True, input=path.read_bytes(),
capture_output=True)
token = json.loads(sub.stdout)
except subprocess.CalledProcessError:
sys.exit('Difficulty decrypting token file. Is your decryption agent primed for '
'non-interactive usage, or an appropriate environment variable such as '
'GPG_TTY set to allow interactive agent usage from inside a pipe?')
def writetokenfile():
'''Writes global token dictionary into token file.'''
if not path.exists():
path.touch(mode=0o600)
if 0o777 & path.stat().st_mode != 0o600:
sys.exit('Token file has unsafe mode. Suggest deleting and starting over.')
sub2 = subprocess.run(ENCRYPTION_PIPE, check=True, input=json.dumps(token).encode(),
capture_output=True)
path.write_bytes(sub2.stdout)
if args.debug:
print('Obtained from token file:', json.dumps(token))
if not token:
if not args.authorize:
sys.exit('You must run script with "--authorize" at least once.')
print('Available app and endpoint registrations:', *registrations)
token['registration'] = input('OAuth2 registration: ')
token['authflow'] = input('Preferred OAuth2 flow ("authcode" or "localhostauthcode" '
'or "devicecode"): ')
token['email'] = input('Account e-mail address: ')
token['access_token'] = ''
token['access_token_expiration'] = ''
token['refresh_token'] = ''
writetokenfile()
if token['registration'] not in registrations:
sys.exit(f'ERROR: Unknown registration "{token["registration"]}". Delete token file '
f'and start over.')
registration = registrations[token['registration']]
authflow = token['authflow']
if args.authflow:
authflow = args.authflow
baseparams = {'client_id': registration['client_id']}
# Microsoft uses 'tenant' but Google does not
if 'tenant' in registration:
baseparams['tenant'] = registration['tenant']
def access_token_valid():
'''Returns True when stored access token exists and is still valid at this time.'''
token_exp = token['access_token_expiration']
return token_exp and datetime.now() < datetime.fromisoformat(token_exp)
def update_tokens(r):
'''Takes a response dictionary, extracts tokens out of it, and updates token file.'''
token['access_token'] = r['access_token']
token['access_token_expiration'] = (datetime.now() +
timedelta(seconds=int(r['expires_in']))).isoformat()
if 'refresh_token' in r:
token['refresh_token'] = r['refresh_token']
writetokenfile()
if args.verbose:
print(f'NOTICE: Obtained new access token, expires {token["access_token_expiration"]}.')
if args.authorize:
p = baseparams.copy()
p['scope'] = registration['scope']
if authflow in ('authcode', 'localhostauthcode'):
verifier = secrets.token_urlsafe(90)
challenge = base64.urlsafe_b64encode(hashlib.sha256(verifier.encode()).digest())[:-1]
redirect_uri = registration['redirect_uri']
listen_port = 0
if authflow == 'localhostauthcode':
# Find an available port to listen on
s = socket.socket()
s.bind(('127.0.0.1', 0))
listen_port = s.getsockname()[1]
s.close()
redirect_uri = 'http://localhost:'+str(listen_port)+'/'
# Probably should edit the port number into the actual redirect URL.
p.update({'login_hint': token['email'],
'response_type': 'code',
'redirect_uri': redirect_uri,
'code_challenge': challenge,
'code_challenge_method': 'S256'})
print(registration["authorize_endpoint"] + '?' +
urllib.parse.urlencode(p, quote_via=urllib.parse.quote))
authcode = ''
if authflow == 'authcode':
authcode = input('Visit displayed URL to retrieve authorization code. Enter '
'code from server (might be in browser address bar): ')
else:
print('Visit displayed URL to authorize this application. Waiting...',
end='', flush=True)
class MyHandler(http.server.BaseHTTPRequestHandler):
'''Handles the browser query resulting from redirect to redirect_uri.'''
# pylint: disable=C0103
def do_HEAD(self):
'''Response to a HEAD requests.'''
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
def do_GET(self):
'''For GET request, extract code parameter from URL.'''
# pylint: disable=W0603
global authcode
querystring = urllib.parse.urlparse(self.path).query
querydict = urllib.parse.parse_qs(querystring)
if 'code' in querydict:
authcode = querydict['code'][0]
self.do_HEAD()
self.wfile.write(b'<html><head><title>Authorizaton result</title></head>')
self.wfile.write(b'<body><p>Authorization redirect completed. You may '
b'close this window.</p></body></html>')
with http.server.HTTPServer(('127.0.0.1', listen_port), MyHandler) as httpd:
try:
httpd.handle_request()
except KeyboardInterrupt:
pass
if not authcode:
sys.exit('Did not obtain an authcode.')
for k in 'response_type', 'login_hint', 'code_challenge', 'code_challenge_method':
del p[k]
p.update({'grant_type': 'authorization_code',
'code': authcode,
'client_secret': registration['client_secret'],
'code_verifier': verifier})
print('Exchanging the authorization code for an access token')
try:
response = urllib.request.urlopen(registration['token_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
print(err.code, err.reason)
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' in response:
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
sys.exit(1)
elif authflow == 'devicecode':
try:
response = urllib.request.urlopen(registration['devicecode_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
print(err.code, err.reason)
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' in response:
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
sys.exit(1)
print(response['message'])
del p['scope']
p.update({'grant_type': 'urn:ietf:params:oauth:grant-type:device_code',
'client_secret': registration['client_secret'],
'device_code': response['device_code']})
interval = int(response['interval'])
print('Polling...', end='', flush=True)
while True:
time.sleep(interval)
print('.', end='', flush=True)
try:
response = urllib.request.urlopen(registration['token_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
# Not actually always an error, might just mean "keep trying..."
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' not in response:
break
if response['error'] == 'authorization_declined':
print(' user declined authorization.')
sys.exit(1)
if response['error'] == 'expired_token':
print(' too much time has elapsed.')
sys.exit(1)
if response['error'] != 'authorization_pending':
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
sys.exit(1)
print()
else:
sys.exit(f'ERROR: Unknown OAuth2 flow "{token["authflow"]}. Delete token file and '
f'start over.')
update_tokens(response)
if not access_token_valid():
if args.verbose:
print('NOTICE: Invalid or expired access token; using refresh token '
'to obtain new access token.')
if not token['refresh_token']:
sys.exit('ERROR: No refresh token. Run script with "--authorize".')
p = baseparams.copy()
p.update({'client_secret': registration['client_secret'],
'refresh_token': token['refresh_token'],
'grant_type': 'refresh_token'})
try:
response = urllib.request.urlopen(registration['token_endpoint'],
urllib.parse.urlencode(p).encode())
except urllib.error.HTTPError as err:
print(err.code, err.reason)
response = err
response = response.read()
if args.debug:
print(response)
response = json.loads(response)
if 'error' in response:
print(response['error'])
if 'error_description' in response:
print(response['error_description'])
print('Perhaps refresh token invalid. Try running once with "--authorize"')
sys.exit(1)
update_tokens(response)
if not access_token_valid():
sys.exit('ERROR: No valid access token. This should not be able to happen.')
if args.verbose:
print('Access Token: ', end='')
print(token['access_token'])
def build_sasl_string(user, host, port, bearer_token):
'''Build appropriate SASL string, which depends on cloud server's supported SASL method.'''
if registration['sasl_method'] == 'OAUTHBEARER':
return f'n,a={user},\1host={host}\1port={port}\1auth=Bearer {bearer_token}\1\1'
if registration['sasl_method'] == 'XOAUTH2':
return f'user={user}\1auth=Bearer {bearer_token}\1\1'
sys.exit(f'Unknown SASL method {registration["sasl_method"]}.')
if args.test:
errors = False
imap_conn = imaplib.IMAP4_SSL(registration['imap_endpoint'])
sasl_string = build_sasl_string(token['email'], registration['imap_endpoint'], 993,
token['access_token'])
if args.debug:
imap_conn.debug = 4
try:
imap_conn.authenticate(registration['sasl_method'], lambda _: sasl_string.encode())
# Microsoft has a bug wherein a mismatch between username and token can still report a
# successful login... (Try a consumer login with the token from a work/school account.)
# Fortunately subsequent commands fail with an error. Thus we follow AUTH with another
# IMAP command before reporting success.
imap_conn.list()
if args.verbose:
print('IMAP authentication succeeded')
except imaplib.IMAP4.error as e:
print('IMAP authentication FAILED (does your account allow IMAP?):', e)
errors = True
pop_conn = poplib.POP3_SSL(registration['pop_endpoint'])
sasl_string = build_sasl_string(token['email'], registration['pop_endpoint'], 995,
token['access_token'])
if args.debug:
pop_conn.set_debuglevel(2)
try:
# poplib doesn't have an auth command taking an authenticator object
# Microsoft requires a two-line SASL for POP
# pylint: disable=W0212
pop_conn._shortcmd('AUTH ' + registration['sasl_method'])
pop_conn._shortcmd(base64.standard_b64encode(sasl_string.encode()).decode())
if args.verbose:
print('POP authentication succeeded')
except poplib.error_proto as e:
print('POP authentication FAILED (does your account allow POP?):', e.args[0].decode())
errors = True
# SMTP_SSL would be simpler but Microsoft does not answer on port 465.
smtp_conn = smtplib.SMTP(registration['smtp_endpoint'], 587)
sasl_string = build_sasl_string(token['email'], registration['smtp_endpoint'], 587,
token['access_token'])
smtp_conn.ehlo('test')
smtp_conn.starttls()
smtp_conn.ehlo('test')
if args.debug:
smtp_conn.set_debuglevel(2)
try:
smtp_conn.auth(registration['sasl_method'], lambda _=None: sasl_string)
if args.verbose:
print('SMTP authentication succeeded')
except smtplib.SMTPAuthenticationError as e:
print('SMTP authentication FAILED:', e)
errors = True
if errors:
sys.exit(1)
-18
View File
@@ -1,18 +0,0 @@
{{ if or
(eq .OriginalMIMEType "text/html")
(contains (toLower .OriginalText) "<html")
}}
{{- $text := exec `/usr/lib/aerc/filters/html` .OriginalText | replace `\r` `` -}}
{{- range split "\n" $text -}}
{{- if eq . "References:" }}{{break}}{{end}}
{{- if or
(eq (len .) 0)
(match `^\[.+\]\s*$` .)
}}{{continue}}{{end}}
{{- printf "%s\n" . | replace `^[\s]+` "" | quote}}
{{- end -}}
{{- else }}
{{- trimSignature .OriginalText | quote -}}
{{- end -}}
{{.Signature -}}
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
curl -F"file=@$@" https://0x0.st | tee >(xclip -sel clip)
-8
View File
@@ -1,8 +0,0 @@
#!/bin/sh
tmux ls -F \#S | grep disc && \
tmux attach -t disc \
|| \
tmux new-session -s disc 'scli --save-history' \; \
split-window -h -l 75% 'aerc' \; \
split-window -v 'weechat' \; \
-141
View File
@@ -1,141 +0,0 @@
#!/bin/sh
VERSION="0.2.1"
usage() {
echo "emailbook $VERSION"'
A minimalistic address book for e-mails only.
Usage: emailbook FILE [OPTIONS]
Prints all values in FILE if no option is given.
Options:
-a, --add [KEY] VALUE Add KEY/VALUE pair to FILE. If KEY is omitted,
VALUE is used as key, too.
[-s, --search] QUERY Search FILE for entries with keys or values containing QUERY.
-k, --key QUERY Like `--search` but limit search to keys/aliases.
-v, --value QUERY Like `--search` but limit search to values.
-p, --parse SOURCE Parse stdin for e-mail addresses in header and add them to FILE.
SOURCE might be either --from, --to , --cc, --bcc, or --all.
-h, --help Show this help.
-V, --version Print version.
'
}
checkfilename() {
[ $QUIET ] || [ -e "$filename" ] \
|| echo "File $filename not found. Creating it." 1>&2
}
keyexists() {
escaped=$(echo "$*" | sed 's/[][\.|$(){}?+*^]/\\&/g')
# also check display name with/without double quotes
quotestoggled=$(echo "$*" | sed -E 's/^"([^"]+)"( +<[^>]+>)/\1\2/;t;s/^([^"]+?)( +<[^>]+>)/"\1"\2/')
quotestoggledescaped=$(echo "$quotestoggled" | sed 's/[][\.|$(){}?+*^]/\\&/g')
grep -q -E "^$escaped( :|\$)" "$filename" 2> /dev/null \
|| grep -q -E "^$quotestoggledescaped( :|\$)" "$filename" 2> /dev/null
}
addentry() {
if keyexists "$1"; then
[ $QUIET ] || echo "! $1 (skipped)"
else
[ "$2" ] && line="$1 : $2" || line="$1"
[ $QUIET ] || echo "+ $line"
echo "$line" >> "$filename"
fi
}
add() {
checkfilename
case $# in
1|2) addentry "$@" ;;
*) echo "Expected one or two arguments after -a!"; exit 1 ;;
esac
}
addfromstdin() {
# Skip lines without "@", skip lines containing no-reply (or similar),
# strip \r, strip leading spaces, do the following replacements:
# "'John Doe'" <xxx> → "John Doe" <xxx>
# 'John Doe' <xxx> → John Doe <xxx>
# "john.doe@example.com" <john.doe@example.com> → <john.doe@example.com>
# "<john.doe@example.com>" <john.doe@example.com> → <john.doe@example.com>
# john.doe@example.com → <john.doe@example.com>
grep '@' \
| grep -v -i -E '\bnot?[_-]?reply' \
| sed 's/\r$//' \
| sed -E 's/^ +//g' \
| sed -E "s/(\"?)'([^'\"]+)'(\"?)/\1\2\3/" \
| sed -E 's/^"<?([^">]*)>?" +<\1>/<\1>/' \
| sed -E 's/^[^<>@ ]*@[^<>@ ]+$/<\0>/' \
| sort -u \
| while read -r line; do addentry "$line"; done
}
searchall() {
# show entries with matching alias first
searchbyalias "$*"
searchbyvalueonly "$*"
}
searchbyalias() {
grep -i -E "$* :" "$filename" | sed -E 's/^[^:]+:\s*//'
}
searchbyvalue() {
sed -E 's/^[^:]+:\s*//' "$filename" | grep -i -E "$*"
}
searchbyvalueonly() {
# exclude matches found by searchbyalias
grep -i -E -v "$* :" "$filename" | sed -E 's/^[^:]+:\s*//' | grep -i -E "$*"
}
parsefields() {
# Find header fields starting with $1 (p.e. 'To:') plus following lines
# starting with a space. Split entries at commas except when quoted. Skip
# empty lines. Decode encoded strings. Squeeze double spaces.
sed -E '/^\r?$/Q' - \
| sed -E -n "/^$1:/{:a ; \$!N ; s/\n\s+/ / ; ta ; P ; D}" \
| sed -E "s/^$1:\\s*//" \
| grep -v -P '[\x80-\xFF]' \
| awk -vFPAT='([^,"]*)("[^"]+")?([^,]*)?' -vOFS='\n' \
'{for(i=1;i<=NF;i++) printf("%s\n",$i)}' \
| sed -E -e '/^ *$/d' \
| perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' \
| sed -E -e 's/ +/ /g' \
| addfromstdin
}
parse() {
checkfilename
case "$1" in
--all) parsefields '(From|To|Cc|CC|Bcc)' ;;
# TODO: Include References, In-Reply-To, Reply-To, Return-Path?
--from) parsefields 'From' ;;
--to) parsefields 'To' ;;
--cc) parsefields '(Cc|CC)' ;;
--bcc) parsefields 'Bcc' ;;
esac
}
case "$1" in
-h|--help|'') usage; exit ;;
-V|--version) echo "$VERSION"; exit ;;
esac
filename="$1"; shift
case "$1" in
-q|--quiet) shift; QUIET=1 ;;
esac
case "$1" in
-a|--add) shift; add "$@" ;;
-s|--search) shift; searchall "$*" ;;
-k|--key) shift; searchbyalias "$*" ;;
-v|--value) shift; searchbyvalue "$*" ;;
-p|--parse) shift; parse "$@" ;;
*) searchall "$*" ;;
esac
-168
View File
@@ -1,168 +0,0 @@
-- Conky, a system monitor https://github.com/brndnmtthws/conky
--
-- This configuration file is Lua code. You can write code in here, and it will
-- execute when Conky loads. You can use it to generate your own advanced
-- configurations.
--
-- Try this (remove the `--`):
--
-- print("Loading Conky config")
--
-- For more on Lua, see:
-- https://www.lua.org/pil/contents.html
--
-- Conky Lua API: https://conky.cc/lua
-- Configuration settings: https://conky.cc/config_settings
io.input("/etc/hostname")
hostname = io.read()
conky.config = {
alignment = 'top_right',
background = false,
border_width = 1,
cpu_avg_samples = 2,
double_buffer = true,
update_interval = 1.0,
default_color = 'green',
default_outline_color = 'green',
default_shade_color = 'dark green',
draw_borders = false,
draw_graph_borders = true,
draw_outline = false,
draw_shades = true,
extra_newline = false,
font = 'Fira Code:size=10',
gap_x = -1800,
gap_y = 40,
minimum_height = 950,
minimum_width = 300,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_wayland = false,
out_to_x = true,
own_window = true,
own_window_class = 'Conky',
own_window_type = 'desktop',
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 200,
own_window_colour = "#222222",
show_graph_range = false,
show_graph_scale = false,
stippled_borders = 0,
uppercase = false,
use_spacer = 'none',
use_xft = true,
}
if hostname == "minitonitchtop" then
conky.config.gap_x = 20
conky.config.font = 'Fira Code:size=14'
end
function disksbars()
if hostname == "minitonitchtop" then
return [[
${color grey}root $color${fs_bar 6 /}
]]
else
return [[
${color grey}root $color${fs_bar 6 /}
${color grey}home $color${fs_bar 6 /home}
${color grey}OneT $color${fs_bar 6 /disks/OneTO/}
${color grey}TwoT $color${fs_bar 6 /disks/TwoTO/}
]]
end
end
function cpubars()
if hostname == "minitonitchtop" then
return [[
${color}${cpubar cpu1 8, 150} ${cpubar cpu2 8, 150}
${cpubar cpu3 8, 150} ${cpubar cpu4 8, 150}
]]
else
return [[
${color}${cpubar cpu1 8, 120} ${cpubar cpu2 8, 120} ${cpubar cpu3 8, 120}
${cpubar cpu4 8, 120} ${cpubar cpu5 8, 120} ${cpubar cpu6 8, 120}
${cpubar cpu7 8, 120} ${cpubar cpu8 8, 120} ${cpubar cpu9 8, 120}
${cpubar cpu10 8, 120} ${cpubar cpu11 8, 120} ${cpubar cpu12 8, 120}
]]
end
end
function networks()
if hostname == "minitonitchtop" then
return [[
IP: $color${addrs wlo1}
${color grey}UP $color${upspeedgraph wlo1 -x -t}
${color grey}DOWN $color${downspeedgraph wlo1 -x -t }
]]
else
return [[
IP: $color${addrs enp3s0}
${color grey}UP $color${upspeedgraph enp3s0 -x -t}
${color grey}DOWN $color${downspeedgraph enp3s0 -x -t }
]]
end
end
function gpu()
if hostname == "minitonitchtop" then
return [[
${color red} Todo
]]
else
return [[
${color gray}Temp: ${nvidia temp}°
${color gray}GPU: $color%${nvidia gpuutil} ${nvidiabar gpuutil}
${color gray}Mem: $color%${nvidia memperc} ${nvidiabar mem}
${color gray}Fan: $color%${nvidia fanlevel} ${nvidiabar fanlevel}
]]
end
end
-- Variables: https://conky.cc/variables
conky.text = [[
${color gray}Date: $color${time %a %d %b %Y %H:%M}
${color gray}Uptime: $color$uptime on $kernel
${color gray}RAM + SWAP $hr
${color gray}$color$memperc% ${membar 6}
${color gray}$color$swapperc% ${swapbar 6}
${color gray}CPU $hr
]]..cpubars()..[[
${color gray}GPU $hr
]]..gpu()..[[
${color grey}File systems $hr
]]..disksbars()..[[
${color grey}Networking $hr
]]..networks()..[[
${color grey}Processes $hr
${color grey}Name PID CPU% MEM%
${color}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color}${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color}${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color}${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color gray}Count: $color$processes
${color grey}Infos $hr
$color${font FiraCode Nerd Font:size=10}${execi 1800 curl -s 'wttr.in/?format=4'}$font
${color gray}mto $color${new_mails /disks/TwoTO/Mails/minecraftonitch/INBOX/ 900} / ${mails /disks/TwoTO/Mails/minecraftonitch/INBOX/ 900} | ${color gray}d.t $color${new_mails /disks/TwoTO/Mails/d.tonitch/INBOX/ 900} / ${mails /disks/TwoTO/Mails/d.tonitch/INBOX/ 900} | ${color gray}d.a $color${new_mails /disks/TwoTO/Mails/debucquoy.anthony/INBOX/ 900} / ${mails /disks/TwoTO/Mails/debucquoy.anthony/INBOX/ 900}
${color grey}TODO $hr
$color${execi 60 todo list --sort priority}
${color grey}CALENDAR $hr
$color${execi 60 khal list}
]]
+8 -8
View File
@@ -1,6 +1,6 @@
[user] [user]
email = tonitch@herisson.ovh email = tonitch@herisson.ovh
name = Anthony Debucquoy name = tonitch
signingkey = 3D06B2E67463D272D769DF59A78D6421F083D42E signingkey = 3D06B2E67463D272D769DF59A78D6421F083D42E
[init] [init]
defaultBranch = master defaultBranch = master
@@ -17,10 +17,10 @@
fap = fetch --all --prune fap = fetch --all --prune
[push] [push]
autoSetupRemote = true autoSetupRemote = true
[filter "lfs"] [sendemail]
process = git-lfs filter-process smtpServer = mail.herisson.ovh
required = true smtpEncryption = tls
clean = git-lfs clean -- %f smtpServerPort = 587
smudge = git-lfs smudge -- %f smtpUser = tonitch
[credential] smtpPass = bateaux
helper = store annotate = yes
-30
View File
@@ -1,30 +0,0 @@
[calendars]
[[nextcloud_cal_local]]
path = ~/.cache/calendar/nextcloud/*
type = discover
[[nextcloud_card_local]]
path = ~/.cache/contact/nextcloud/*
type = discover
[locale]
timeformat = %H:%M
dateformat = %d %b
longdateformat = %d %b %Y
datetimeformat = %d %b à %H:%M
longdatetimeformat = %a %d %b %Y %H:%M
[default]
default_calendar = personal
highlight_event_days = True
timedelta = 14d
print_new = event
[highlight_days]
color = dark green
default_color = dark blue
multiple = dark red
[view]
agenda_event_format = {calendar-color} {cancelled}{start-time} - {title}{repeat-symbol}{alarm-symbol}{reset}
-50
View File
@@ -1,50 +0,0 @@
[addressbooks]
[[contacts]]
path = ~/.cache/contact/**/*
type = discover
[general]
debug = no
default_action = list
# These are either strings or comma seperated lists
editor = vim, -i, NONE
merge_editor = vimdiff
[contact table]
# display names by first or last name: first_name / last_name / formatted_name
display = first_name
# group by address book: yes / no
group_by_addressbook = no
# reverse table ordering: yes / no
reverse = no
# append nicknames to name column: yes / no
show_nicknames = no
# show uid table column: yes / no
show_uids = yes
# show kind table column: yes / no
show_kinds = no
# sort by first or last name: first_name / last_name / formatted_name
sort = last_name
# localize dates: yes / no
localize_dates = yes
# set a comma separated list of preferred phone number types in descending priority
# or nothing for non-filtered alphabetical order
preferred_phone_number_type = pref, cell, home
# set a comma separated list of preferred email address types in descending priority
# or nothing for non-filtered alphabetical order
preferred_email_address_type = pref, work, home
[vcard]
# extend contacts with your own private objects
# these objects are stored with a leading "X-" before the object name in the vcard files
# every object label may only contain letters, digits and the - character
# example:
# private_objects = Jabber, Skype, Twitter
# default: , (the empty list)
# private_objects = Jabber, Skype, Twitter
# preferred vcard version: 3.0 / 4.0
preferred_version = 3.0
# Look into source vcf files to speed up search queries: yes / no
search_in_source_files = no
# skip unparsable vcard files: yes / no
skip_unparsable = no
@@ -1,9 +0,0 @@
[Unit]
Description=Syncronise Nextcloud instance
[Service]
Type=oneshot
ExecStart=nextcloudcmd /media/nextcloud 'https://tonitch:jOkN5UaCMRRnjLIe3cH9KEXzb@nc.debucquoy.me'
[Install]
WantedBy=default.target
@@ -1,9 +0,0 @@
[Unit]
Description=Run nextcloud sync every 15 minutes
[Timer]
OnActiveSec=10min
OnUnitActiveSec=10min
[Install]
WantedBy=timers.target
@@ -1,5 +0,0 @@
path = "~/.cache/calendar/nextcloud/*/"
# date_format = "%d/%m/%Y"
# time_format = "%H:%M"
default_list = "whatdo"
default_due = 0
-36
View File
@@ -1,36 +0,0 @@
[general]
status_path = "~/.vdirsyncer/status/"
[storage nextcloud_cal_remote]
type = "caldav"
url = "https://nc.debucquoy.me/remote.php/dav"
username = "tonitch"
password.fetch = ["command", "cat", "~/.config/pass/vdirsyncer.txt"]
[storage nextcloud_card_remote]
type = "carddav"
url = "https://nc.debucquoy.me/remote.php/dav"
username = "tonitch"
password.fetch = ["command", "cat", "~/.config/pass/vdirsyncer.txt"]
[storage nextcloud_cal_local]
type = "filesystem"
path = "~/.cache/calendar/nextcloud"
fileext = ".ics"
[storage nextcloud_card_local]
type = "filesystem"
path = "~/.cache/contact/nextcloud"
fileext = ".vcf"
[pair nextcloud_cal]
a = "nextcloud_cal_remote"
b = "nextcloud_cal_local"
collections = ["from a"]
metadata= ["color", "displayname", "description", "order"]
[pair nextcloud_card]
a = "nextcloud_card_remote"
b = "nextcloud_card_local"
collections = ["from a"]
metadata= ["displayname"]
+5
View File
@@ -0,0 +1,5 @@
vim.lsp.start({
name = 'clangd',
cmd = {'clangd'},
-- root_dir = vim.fs.root(args.buf, {'Makefile'})
})
@@ -0,0 +1,4 @@
vim.lsp.start({
name = 'cmake-language-server',
cmd = {'cmake-language-server'},
})
+4
View File
@@ -0,0 +1,4 @@
vim.lsp.start({
name = 'lua-language-server',
cmd = {'lua-language-server'},
})
@@ -1 +0,0 @@
vim.opt.textwidth = 100
+4 -5
View File
@@ -1,5 +1,4 @@
vim.keymap.set('n', '<F12>', ":Repl<cr>") vim.lsp.start({
vim.keymap.set('v', '<F12>', ":'<,'>Repl<cr>") name = 'jedi',
cmd = {'jedi-language-server'},
vim.keymap.set('n', '<F11>', ":ReplSend<cr>") })
vim.keymap.set('v', '<F11>', ":'<,'>ReplSend<cr>")
@@ -1,5 +0,0 @@
vim.keymap.set('n', '<F12>', ":Repl<cr>")
vim.keymap.set('v', '<F12>', ":'<,'>Repl<cr>")
vim.keymap.set('n', '<F11>', ":ReplSend<cr>")
vim.keymap.set('v', '<F11>', ":'<,'>ReplSend<cr>")
+4
View File
@@ -0,0 +1,4 @@
vim.lsp.start({
name = 'bash-language-server',
cmd = {'bash-language-server'},
})
+4
View File
@@ -0,0 +1,4 @@
vim.lsp.start({
name = 'texlab',
cmd = {'texlab'},
})
-1
View File
@@ -1 +0,0 @@
vim.g.zig_fmt_autosave = 0
-50
View File
@@ -1,50 +0,0 @@
vim.cmd('set runtimepath^=~/.vim runtimepath+=~/.vim/after')
vim.cmd('let &packpath = &runtimepath')
vim.cmd('let g:python3_host_prog="/usr/bin/python"')
vim.cmd('source ~/.vimrc"')
-- Enable LSPs
vim.lsp.enable('bashls')
vim.lsp.enable('clangd')
vim.lsp.enable('cmake')
vim.lsp.enable('jdtls')
vim.lsp.enable('jedi_language_server')
vim.lsp.enable('lua_ls')
vim.lsp.enable('texlab')
vim.lsp.enable('zls')
-- LSPs config
vim.lsp.config("lua_ls", {
settings = {
Lua = {
diagnostics = {
globals = { "vim" }
},
workspace = {
checkThirdParty = "Apply",
telemetry = { enable = false },
library = {
-- vim.env.VIMRUNTIME,
"${3rd}/love2d/library"
}
}
},
}
})
vim.lsp.config("zls", {
on_attach = function(client, bufnr)
vim.lsp.completion.enable(true, client.id, bufnr, {
autotrigger = true,
})
end
})
-- vim.lsp.config("jdtls", {
-- settings = {
-- java = {
--
-- }
-- }
-- })
+4
View File
@@ -0,0 +1,4 @@
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
let g:python3_host_prog="/usr/bin/python"
source ~/.vimrc
-51
View File
@@ -1,51 +0,0 @@
local dap = require('dap')
dap.adapters.gdb = {
id = 'gdb',
type = 'executable',
command = 'gdb',
args = { '--quiet', '--interpreter=dap' },
}
dap.configurations.c = {
{
name = 'Run executable (GDB)',
type = 'gdb',
request = 'launch',
program = function()
local path = vim.fn.input({
prompt = 'Path to executable: ',
default = vim.fn.getcwd() .. '/',
completion = 'file',
})
return (path and path ~= '') and path or dap.ABORT
end,
},
{
name = 'Run executable with arguments (GDB)',
type = 'gdb',
request = 'launch',
program = function()
local path = vim.fn.input({
prompt = 'Path to executable: ',
default = vim.fn.getcwd() .. '/',
completion = 'file',
})
return (path and path ~= '') and path or dap.ABORT
end,
args = function()
local args_str = vim.fn.input({
prompt = 'Arguments: ',
})
return vim.split(args_str, ' +')
end
},
{
name = 'Attach to process (GDB)',
type = 'gdb',
request = 'gdb',
processId = require('dap.utils').pick_process,
},
}
dap.configurations.rust = dap.configurations.c
-48
View File
@@ -1,48 +0,0 @@
local dap = require('dap')
dap.adapters.lldb = {
id = 'lldb',
type = 'executable',
command = 'lldb-dap',
}
dap.configurations.zig = {
{
name = 'Run executable (lldb)',
type = 'lldb',
request = 'launch',
program = function()
local path = vim.fn.input({
prompt = 'Path to executable: ',
default = vim.fn.getcwd() .. '/',
completion = 'file',
})
return (path and path ~= '') and path or dap.ABORT
end,
},
{
name = 'Run executable with arguments (lldb)',
type = 'lldb',
request = 'launch',
program = function()
local path = vim.fn.input({
prompt = 'Path to executable: ',
default = vim.fn.getcwd() .. '/',
completion = 'file',
})
return (path and path ~= '') and path or dap.ABORT
end,
args = function()
local args_str = vim.fn.input({
prompt = 'Arguments: ',
})
return vim.split(args_str, ' +')
end
},
{
name = 'Attach to process (lldb)',
type = 'lldb',
request = 'lldb',
processId = require('dap.utils').pick_process,
},
}
-4
View File
@@ -1,6 +1,2 @@
vim.g.vimtex_view_method="zathura" vim.g.vimtex_view_method="zathura"
vim.opt.completeopt="menu,popup,noinsert,noselect" vim.opt.completeopt="menu,popup,noinsert,noselect"
require("dapui").setup()
require("plugin.dap.c")
require("plugin.dap.zig")
-3
View File
@@ -1,3 +0,0 @@
nnoremap sd :lua vim.diagnostic.open_float()<CR>
nnoremap <c-t> :FloatermToggle<CR>
let g:neomake_open_list = 2
-26
View File
@@ -1,26 +0,0 @@
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<F10>', function() require('dap').step_over() end)
vim.keymap.set('n', '<F11>', function() require('dap').step_into() end)
vim.keymap.set('n', '<F12>', function() require('dap').step_out() end)
vim.keymap.set('n', '<Leader>b', function() require('dap').toggle_breakpoint() end)
vim.keymap.set('n', '<Leader>B', function() require('dap').set_breakpoint() end)
vim.keymap.set('n', '<Leader>lp', function() require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end)
vim.keymap.set('n', '<Leader>dr', function() require('dap').repl.open() end)
vim.keymap.set('n', '<Leader>dl', function() require('dap').run_last() end)
vim.keymap.set({'n', 'v'}, '<Leader>dh', function()
require('dap.ui.widgets').hover()
end)
vim.keymap.set({'n', 'v'}, '<Leader>dp', function()
require('dap.ui.widgets').preview()
end)
vim.keymap.set('n', '<Leader>df', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.frames)
end)
vim.keymap.set('n', '<Leader>ds', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.scopes)
end)
vim.keymap.set('n', '<F9>', function() require("dapui").toggle() end)
vim.keymap.set('n', '<M-k>', function() require("dapui").eval() end)
vim.keymap.set('v', '<M-k>', function() require("dapui").eval() end)
-8
View File
@@ -5,11 +5,3 @@ function! OpenCompletion()
endfunction endfunction
autocmd InsertCharPre * if &omnifunc != "" | call OpenCompletion() | endif autocmd InsertCharPre * if &omnifunc != "" | call OpenCompletion() | endif
" https://github.com/mfussenegger/nvim-jdtls?tab=readme-ov-file
nnoremap <A-o> <Cmd>lua require'jdtls'.organize_imports()<CR>
nnoremap crv <Cmd>lua require('jdtls').extract_variable()<CR>
vnoremap crv <Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>
nnoremap crc <Cmd>lua require('jdtls').extract_constant()<CR>
vnoremap crc <Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>
vnoremap crm <Esc><Cmd>lua require('jdtls').extract_method(true)<CR>
-2
View File
@@ -1,11 +1,9 @@
aerc
bin bin
bspwm bspwm
dmenu dmenu
dunst dunst
feh feh
git git
khal_todo_khard
nvim nvim
picom picom
polybar polybar
+1 -2
View File
@@ -192,8 +192,7 @@ super + shift + {comma,period}
# Change window gap # Change window gap
super + g super + g
{bspc config window_gap 0 && bspc config top_padding 0 && bspc config bottom_padding 0 && bspc config right_padding 0 && bspc config left_padding 0,\ bspc config -d focused window_gap {$gap,$(($gap+$cgap)),$(($gap+$cgap+$gap))}
bspc config window_gap $(($gap+$cgap)) && bspc config top_padding $(($PANEL_HEIGHT-($gap-$cgap))) && bspc config bottom_padding -$gap && bspc config right_padding -$gap && bspc config left_padding -$gap}
super + button{4,5} super + button{4,5}
bspc config -d focused window_gap $((`bspc config -d focused window_gap` {+,-} 2 )) bspc config -d focused window_gap $((`bspc config -d focused window_gap` {+,-} 2 ))
-1
View File
@@ -1,6 +1,5 @@
set -g mouse set -g mouse
set -g set-clipboard on set -g set-clipboard on
set -g focus-events on
bind h selectp -L bind h selectp -L
bind j selectp -D bind j selectp -D
+5 -8
View File
@@ -20,7 +20,7 @@ zstyle ':completion:*' cache-path ~/.zsh/cache
HISTFILE=~/.zhistory HISTFILE=~/.zhistory
HISTSIZE=1000 HISTSIZE=1000
SAVEHIST=500 SAVEHIST=500
#export EDITOR=/usr/bin/vim export EDITOR=/usr/bin/vim
#export VISUAL=/usr/bin/gvim #export VISUAL=/usr/bin/gvim
WORDCHARS=${WORDCHARS//\/[&.;]} # Don't consider certain characters part of the word WORDCHARS=${WORDCHARS//\/[&.;]} # Don't consider certain characters part of the word
@@ -72,8 +72,6 @@ alias open="xdg-open"
alias sxiv=nsxiv alias sxiv=nsxiv
alias :q=exit alias :q=exit
alias vim=nvim alias vim=nvim
alias radio="mpv https://radio.freenode.net/radio.ogg --volume=30"
alias calc="calcurse-caldav && calcurse && calcurse-caldav"
# Theming section # Theming section
autoload -U compinit colors zcalc autoload -U compinit colors zcalc
@@ -179,6 +177,9 @@ zmodload zsh/terminfo
# Enabling fzf capabilities # Enabling fzf capabilities
source /usr/share/fzf/*.zsh source /usr/share/fzf/*.zsh
source /usr/share/enhancd/init.sh
export ENHANCD_ENABLE_DOUBLE_DOT=false
bindkey "$terminfo[kcuu1]" history-substring-search-up bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey '^[[A' history-substring-search-up bindkey '^[[A' history-substring-search-up
@@ -216,8 +217,4 @@ case $(basename "$(cat "/proc/$PPID/comm")") in
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
;; ;;
esac esac
# PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/tonitch/.config/tea/autocomplete.zsh"
# Add level of ranger nesting if in ranger
if [ -n "$RANGER_LEVEL" ]; then
export RPROMPT="[r$RANGER_LEVEL]$RPROMPT";
fi