Initial commit
This commit is contained in:
commit
6a41699d95
|
@ -0,0 +1,207 @@
|
|||
# Configuration for Alacritty, the GPU enhanced terminal emulator.
|
||||
|
||||
# Import additional configuration files
|
||||
# Imports are loaded in order, skipping all missing files, with the importing
|
||||
# file being loaded last. If a field is already present in a previous import, it
|
||||
# will be replaced.
|
||||
#
|
||||
# All imports must either be absolute paths starting with `/`, or paths relative
|
||||
# to the user's home directory starting with `~/`.
|
||||
#import:
|
||||
# - /path/to/alacritty.yml
|
||||
|
||||
# Any items in the `env` entry below will be added as
|
||||
# environment variables. Some entries may override variables
|
||||
# set by alacritty itself.
|
||||
env:
|
||||
TERM: xterm-256color
|
||||
|
||||
window:
|
||||
#dimensions:
|
||||
# columns: 0
|
||||
# lines: 0
|
||||
|
||||
#position:
|
||||
# x: 0
|
||||
# y: 0
|
||||
|
||||
padding:
|
||||
x: 0
|
||||
y: 2
|
||||
|
||||
dynamic_padding: true
|
||||
#opacity: 1.0
|
||||
dynamic_title: false
|
||||
|
||||
shell:
|
||||
program: /bin/bash
|
||||
args:
|
||||
- --init-file
|
||||
- "/home/vitorg/.config/bash/rc"
|
||||
|
||||
font:
|
||||
normal:
|
||||
family: monospace
|
||||
style: Regular
|
||||
|
||||
bold:
|
||||
family: monospace
|
||||
style: Bold
|
||||
|
||||
italic:
|
||||
family: monospace
|
||||
style: Italic
|
||||
|
||||
bold_italic:
|
||||
family: monospace
|
||||
style: Bold Italic
|
||||
|
||||
size: 12.0
|
||||
|
||||
offset:
|
||||
x: 0
|
||||
y: 0
|
||||
|
||||
#glyph_offset:
|
||||
# x: 0
|
||||
# y: 0
|
||||
|
||||
draw_bold_text_with_bright_colors: true
|
||||
|
||||
schemes:
|
||||
gruvbox_material_hard_dark: &gruvbox_material_hard_dark
|
||||
primary:
|
||||
background: '0x1d2021'
|
||||
foreground: '0xd4be98'
|
||||
normal:
|
||||
black: '0x32302f'
|
||||
red: '0xea6962'
|
||||
green: '0xa9b665'
|
||||
yellow: '0xd8a657'
|
||||
blue: '0x7daea3'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x89b482'
|
||||
white: '0xd4be98'
|
||||
bright:
|
||||
black: '0x32302f'
|
||||
red: '0xea6962'
|
||||
green: '0xa9b665'
|
||||
yellow: '0xd8a657'
|
||||
blue: '0x7daea3'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x89b482'
|
||||
white: '0xd4be98'
|
||||
gruvbox_material_medium_dark: &gruvbox_material_medium_dark
|
||||
primary:
|
||||
background: '0x282828'
|
||||
foreground: '0xd4be98'
|
||||
normal:
|
||||
black: '0x3c3836'
|
||||
red: '0xea6962'
|
||||
green: '0xa9b665'
|
||||
yellow: '0xd8a657'
|
||||
blue: '0x7daea3'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x89b482'
|
||||
white: '0xd4be98'
|
||||
bright:
|
||||
black: '0x3c3836'
|
||||
red: '0xea6962'
|
||||
green: '0xa9b665'
|
||||
yellow: '0xd8a657'
|
||||
blue: '0x7daea3'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x89b482'
|
||||
white: '0xd4be98'
|
||||
gruvbox_material_soft_dark: &gruvbox_material_soft_dark
|
||||
primary:
|
||||
background: '0x32302f'
|
||||
foreground: '0xd4be98'
|
||||
normal:
|
||||
black: '0x45403d'
|
||||
red: '0xea6962'
|
||||
green: '0xa9b665'
|
||||
yellow: '0xd8a657'
|
||||
blue: '0x7daea3'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x89b482'
|
||||
white: '0xd4be98'
|
||||
bright:
|
||||
black: '0x45403d'
|
||||
red: '0xea6962'
|
||||
green: '0xa9b665'
|
||||
yellow: '0xd8a657'
|
||||
blue: '0x7daea3'
|
||||
magenta: '0xd3869b'
|
||||
cyan: '0x89b482'
|
||||
white: '0xd4be98'
|
||||
gruvbox_material_hard_light: &gruvbox_material_hard_light
|
||||
primary:
|
||||
background: '0xf9f5d7'
|
||||
foreground: '0x654735'
|
||||
normal:
|
||||
black: '0x654735'
|
||||
red: '0xc14a4a'
|
||||
green: '0x6c782e'
|
||||
yellow: '0xb47109'
|
||||
blue: '0x45707a'
|
||||
magenta: '0x945e80'
|
||||
cyan: '0x4c7a5d'
|
||||
white: '0xf2e5bc'
|
||||
bright:
|
||||
black: '0x654735'
|
||||
red: '0xc14a4a'
|
||||
green: '0x6c782e'
|
||||
yellow: '0xb47109'
|
||||
blue: '0x45707a'
|
||||
magenta: '0x945e80'
|
||||
cyan: '0x4c7a5d'
|
||||
white: '0xf2e5bc'
|
||||
gruvbox_material_medium_light: &gruvbox_material_medium_light
|
||||
primary:
|
||||
background: '0xfbf1c7'
|
||||
foreground: '0x654735'
|
||||
normal:
|
||||
black: '0x654735'
|
||||
red: '0xc14a4a'
|
||||
green: '0x6c782e'
|
||||
yellow: '0xb47109'
|
||||
blue: '0x45707a'
|
||||
magenta: '0x945e80'
|
||||
cyan: '0x4c7a5d'
|
||||
white: '0xeee0b7'
|
||||
bright:
|
||||
black: '0x654735'
|
||||
red: '0xc14a4a'
|
||||
green: '0x6c782e'
|
||||
yellow: '0xb47109'
|
||||
blue: '0x45707a'
|
||||
magenta: '0x945e80'
|
||||
cyan: '0x4c7a5d'
|
||||
white: '0xeee0b7'
|
||||
gruvbox_material_soft_light: &gruvbox_material_soft_light
|
||||
primary:
|
||||
background: '0xf2e5bc'
|
||||
foreground: '0x654735'
|
||||
normal:
|
||||
black: '0x654735'
|
||||
red: '0xc14a4a'
|
||||
green: '0x6c782e'
|
||||
yellow: '0xb47109'
|
||||
blue: '0x45707a'
|
||||
magenta: '0x945e80'
|
||||
cyan: '0x4c7a5d'
|
||||
white: '0xe6d5ae'
|
||||
bright:
|
||||
black: '0x654735'
|
||||
red: '0xc14a4a'
|
||||
green: '0x6c782e'
|
||||
yellow: '0xb47109'
|
||||
blue: '0x45707a'
|
||||
magenta: '0x945e80'
|
||||
cyan: '0x4c7a5d'
|
||||
white: '0xe6d5ae'
|
||||
|
||||
# Apply the color scheme.
|
||||
colors: *gruvbox_material_medium_dark
|
||||
|
|
@ -0,0 +1,403 @@
|
|||
# This is the default config file.
|
||||
# It also shows all the default values, if you don't create the file.
|
||||
# You can edit this file to set your own configuration for Amfora.
|
||||
|
||||
# When Amfora updates, defaults may change, but this file on your drive will not.
|
||||
# You can always get the latest defaults on GitHub.
|
||||
# https://github.com/makeworld-the-better-one/amfora/blob/master/default-config.toml
|
||||
|
||||
# Please also check out the Amfora Wiki for more help
|
||||
# https://github.com/makeworld-the-better-one/amfora/wiki
|
||||
# gemini://makeworld.space/amfora-wiki/
|
||||
|
||||
|
||||
|
||||
# All URL values may omit the scheme and/or port, as well as the beginning double slash
|
||||
# Valid URL examples:
|
||||
# gemini://example.com
|
||||
# //example.com
|
||||
# example.com
|
||||
# example.com:123
|
||||
|
||||
|
||||
[a-general]
|
||||
# Press Ctrl-H to access it
|
||||
home = "gemini://gemini.circumlunar.space"
|
||||
|
||||
# Follow up to 5 Gemini redirects without prompting.
|
||||
# A prompt is always shown after the 5th redirect and for redirects to protocols other than Gemini.
|
||||
# If set to false, a prompt will be shown before following redirects.
|
||||
auto_redirect = false
|
||||
|
||||
# What command to run to open a HTTP(S) URL.
|
||||
# Set to "default" to try to guess the browser, or set to "off" to not open HTTP(S) URLs.
|
||||
# If a command is set, than the URL will be added (in quotes) to the end of the command.
|
||||
# A space will be prepended to the URL.
|
||||
#
|
||||
# The best way to define a command is using a string array.
|
||||
# Examples:
|
||||
# http = ['firefox']
|
||||
# http = ['custom-browser', '--flag', '--option=2']
|
||||
# http = ['/path/with spaces/in it/firefox']
|
||||
#
|
||||
# Note the use of single quotes, so that backslashes will not be escaped.
|
||||
# Using just a string will also work, but it is deprecated, and will degrade if
|
||||
# you use paths with spaces.
|
||||
|
||||
http = 'default'
|
||||
|
||||
# Any URL that will accept a query string can be put here
|
||||
search = "gemini://geminispace.info/search"
|
||||
|
||||
# Whether colors will be used in the terminal
|
||||
color = true
|
||||
|
||||
# Whether ANSI color codes from the page content should be rendered
|
||||
ansi = true
|
||||
|
||||
# Whether to replace list asterisks with unicode bullets
|
||||
bullets = true
|
||||
|
||||
# Whether to show link after link text
|
||||
show_link = false
|
||||
|
||||
# A number from 0 to 1, indicating what percentage of the terminal width the left margin should take up.
|
||||
left_margin = 0.15
|
||||
|
||||
# The max number of columns to wrap a page's text to. Preformatted blocks are not wrapped.
|
||||
max_width = 100
|
||||
|
||||
# 'downloads' is the path to a downloads folder.
|
||||
# An empty value means the code will find the default downloads folder for your system.
|
||||
# If the path does not exist it will be created.
|
||||
# Note the use of single quotes, so that backslashes will not be escaped.
|
||||
downloads = ''
|
||||
|
||||
# Max size for displayable content in bytes - after that size a download window pops up
|
||||
page_max_size = 2097152 # 2 MiB
|
||||
# Max time it takes to load a page in seconds - after that a download window pops up
|
||||
page_max_time = 10
|
||||
|
||||
# When a scrollbar appears. "never", "auto", and "always" are the only valid values.
|
||||
# "auto" means the scrollbar only appears when the page is longer than the window.
|
||||
scrollbar = "auto"
|
||||
|
||||
# Underline non-gemini URLs
|
||||
# This is done to help color blind users
|
||||
underline = true
|
||||
|
||||
|
||||
[auth]
|
||||
# Authentication settings
|
||||
# Note the use of single quotes for values, so that backslashes will not be escaped.
|
||||
|
||||
[auth.certs]
|
||||
# Client certificates
|
||||
# Set domain name equal to path to client cert
|
||||
# "example.com" = 'mycert.crt'
|
||||
|
||||
[auth.keys]
|
||||
# Client certificate keys
|
||||
# Set domain name equal to path to key for the client cert above
|
||||
# "example.com" = 'mycert.key'
|
||||
|
||||
|
||||
[keybindings]
|
||||
# If you have a non-US keyboard, use bind_tab1 through bind_tab0 to
|
||||
# setup the shift-number bindings: Eg, for US keyboards (the default):
|
||||
# bind_tab1 = "!"
|
||||
# bind_tab2 = "@"
|
||||
# bind_tab3 = "#"
|
||||
# bind_tab4 = "$"
|
||||
# bind_tab5 = "%"
|
||||
# bind_tab6 = "^"
|
||||
# bind_tab7 = "&"
|
||||
# bind_tab8 = "*"
|
||||
# bind_tab9 = "("
|
||||
# bind_tab0 = ")"
|
||||
|
||||
# Whitespace is not allowed in any of the keybindings! Use 'Space' and 'Tab' to bind to those keys.
|
||||
# Multiple keys can be bound to one command, just use a TOML array.
|
||||
# To add the Alt modifier, the binding must start with Alt-, should be reasonably universal
|
||||
# Ctrl- won't work on all keys, see this for a list:
|
||||
# https://github.com/gdamore/tcell/blob/cb1e5d6fa606/key.go#L83
|
||||
|
||||
# An example of a TOML array for multiple keys being bound to one command is the default
|
||||
# binding for reload:
|
||||
# bind_reload = ["R","Ctrl-R"]
|
||||
# One thing to note here is that "R" is capitalization sensitive, so it means shift-r.
|
||||
# "Ctrl-R" means both ctrl-r and ctrl-shift-R (this is a quirk of what ctrl-r means on
|
||||
# an ANSI terminal)
|
||||
|
||||
# The default binding for opening the bottom bar for entering a URL or link number is:
|
||||
# bind_bottom = "Space"
|
||||
# This is how to get the Spacebar as a keybinding, if you try to use " ", it won't work.
|
||||
# And, finally, an example of a simple, unmodified character is:
|
||||
# bind_edit = "e"
|
||||
# This binds the "e" key to the command to edit the current URL.
|
||||
|
||||
# The bind_link[1-90] options are for the commands to go to the first 10 links on a page,
|
||||
# typically these are bound to the number keys:
|
||||
# bind_link1 = "1"
|
||||
# bind_link2 = "2"
|
||||
# bind_link3 = "3"
|
||||
# bind_link4 = "4"
|
||||
# bind_link5 = "5"
|
||||
# bind_link6 = "6"
|
||||
# bind_link7 = "7"
|
||||
# bind_link8 = "8"
|
||||
# bind_link9 = "9"
|
||||
# bind_link0 = "0"
|
||||
|
||||
# All keybindings:
|
||||
#
|
||||
# bind_bottom
|
||||
# bind_edit
|
||||
# bind_home
|
||||
# bind_bookmarks
|
||||
# bind_add_bookmark
|
||||
# bind_save
|
||||
# bind_reload
|
||||
# bind_back
|
||||
# bind_forward
|
||||
# bind_moveup
|
||||
# bind_movedown
|
||||
# bind_moveleft
|
||||
# bind_moveright
|
||||
# bind_pgup
|
||||
# bind_pgdn
|
||||
# bind_new_tab
|
||||
# bind_close_tab
|
||||
# bind_next_tab
|
||||
# bind_prev_tab
|
||||
# bind_quit
|
||||
# bind_help
|
||||
# bind_sub: for viewing the subscriptions page
|
||||
# bind_add_sub
|
||||
# bind_copy_page_url
|
||||
# bind_copy_target_url
|
||||
# bind_beginning: moving to beginning of page (top left)
|
||||
# bind_end: same but the for the end (bottom left)
|
||||
|
||||
[url-handlers]
|
||||
# Allows setting the commands to run for various URL schemes.
|
||||
# E.g. to open FTP URLs with FileZilla set the following key:
|
||||
# ftp = ['filezilla']
|
||||
# You can set any scheme to 'off' or '' to disable handling it, or
|
||||
# just leave the key unset.
|
||||
#
|
||||
# DO NOT use this for setting the HTTP command.
|
||||
# Use the http setting in the "a-general" section above.
|
||||
#
|
||||
# NOTE: These settings are overrided by the ones in the proxies section.
|
||||
#
|
||||
# The best way to define a command is using a string array.
|
||||
# Examples:
|
||||
# magnet = ['transmission']
|
||||
# foo = ['custom-browser', '--flag', '--option=2']
|
||||
# tel = ['/path/with spaces/in it/telephone']
|
||||
#
|
||||
# Note the use of single quotes, so that backslashes will not be escaped.
|
||||
# Using just a string will also work, but it is deprecated, and will degrade if
|
||||
# you use paths with spaces.
|
||||
|
||||
# This is a special key that defines the handler for all URL schemes for which
|
||||
# no handler is defined.
|
||||
# It uses the special value 'default', which will try and use the default
|
||||
# application on your computer for opening this kind of URI.
|
||||
other = 'default'
|
||||
|
||||
|
||||
# [[mediatype-handlers]] section
|
||||
# ---------------------------------
|
||||
#
|
||||
# Specify what applications will open certain media types.
|
||||
# By default your default application will be used to open the file when you select "Open".
|
||||
# You only need to configure this section if you want to override your default application,
|
||||
# or do special things like streaming.
|
||||
#
|
||||
# Note the use of single quotes for commands, so that backslashes will not be escaped.
|
||||
#
|
||||
#
|
||||
# To open jpeg files with the feh command:
|
||||
#
|
||||
# [[mediatype-handlers]]
|
||||
# cmd = ['feh']
|
||||
# types = ["image/jpeg"]
|
||||
#
|
||||
# Each command that you specify must come under its own [[mediatype-handlers]]. You may
|
||||
# specify as many [[mediatype-handlers]] as you want to setup multiple commands.
|
||||
#
|
||||
# If the subtype is omitted then the specified command will be used for the
|
||||
# entire type:
|
||||
#
|
||||
# [[mediatype-handlers]]
|
||||
# command = ['vlc', '--flag']
|
||||
# types = ["audio", "video"]
|
||||
#
|
||||
# A catch-all handler can by specified with "*".
|
||||
# Note that there are already catch-all handlers in place for all OSes,
|
||||
# that open the file using your default application. This is only if you
|
||||
# want to override that.
|
||||
#
|
||||
# [[mediatype-handlers]]
|
||||
# cmd = ['some-command']
|
||||
# types = [
|
||||
# "application/pdf",
|
||||
# "*",
|
||||
# ]
|
||||
#
|
||||
# You can also choose to stream the data instead of downloading it all before
|
||||
# opening it. This is especially useful for large video or audio files, as
|
||||
# well as radio streams, which will never complete. You can do this like so:
|
||||
#
|
||||
# [[mediatype-handlers]]
|
||||
# cmd = ['vlc', '-']
|
||||
# types = ["audio", "video"]
|
||||
# stream = true
|
||||
#
|
||||
# This uses vlc to stream all video and audio content.
|
||||
# By default stream is set to off for all handlers
|
||||
#
|
||||
#
|
||||
# If you want to always open a type in its viewer without the download or open
|
||||
# prompt appearing, you can add no_prompt = true
|
||||
#
|
||||
# [[mediatype-handlers]]
|
||||
# cmd = ['feh']
|
||||
# types = ["image"]
|
||||
# no_prompt = true
|
||||
#
|
||||
# Note: Multiple handlers cannot be defined for the same full media type, but
|
||||
# still there needs to be an order for which handlers are used. The following
|
||||
# order applies regardless of the order written in the config:
|
||||
#
|
||||
# 1. Full media type: "image/jpeg"
|
||||
# 2. Just type: "image"
|
||||
# 3. Catch-all: "*"
|
||||
|
||||
|
||||
[cache]
|
||||
# Options for page cache - which is only for text pages
|
||||
# Increase the cache size to speed up browsing at the expense of memory
|
||||
# Zero values mean there is no limit
|
||||
|
||||
max_size = 0 # Size in bytes
|
||||
max_pages = 30 # The maximum number of pages the cache will store
|
||||
|
||||
# How long a page will stay in cache, in seconds.
|
||||
timeout = 1800 # 30 mins
|
||||
|
||||
[proxies]
|
||||
# Allows setting a Gemini proxy for different schemes.
|
||||
# The settings are similar to the url-handlers section above.
|
||||
# E.g. to open a gopher page by connecting to a Gemini proxy server:
|
||||
# gopher = "example.com:123"
|
||||
#
|
||||
# Port 1965 is assumed if no port is specified.
|
||||
#
|
||||
# NOTE: These settings override any external handlers specified in
|
||||
# the url-handlers section.
|
||||
#
|
||||
# Note that HTTP and HTTPS are treated as separate protocols here.
|
||||
|
||||
|
||||
[subscriptions]
|
||||
# For tracking feeds and pages
|
||||
|
||||
# Whether a pop-up appears when viewing a potential feed
|
||||
popup = true
|
||||
|
||||
# How often to check for updates to subscriptions in the background, in seconds.
|
||||
# Set it to 0 to disable this feature. You can still update individual feeds
|
||||
# manually, or restart the browser.
|
||||
#
|
||||
# Note Amfora will check for updates on browser start no matter what this setting is.
|
||||
update_interval = 1800 # 30 mins
|
||||
|
||||
# How many subscriptions can be checked at the same time when updating.
|
||||
# If you have many subscriptions you may want to increase this for faster
|
||||
# update times. Any value below 1 will be corrected to 1.
|
||||
workers = 3
|
||||
|
||||
# The number of subscription updates displayed per page.
|
||||
entries_per_page = 20
|
||||
|
||||
|
||||
[theme]
|
||||
# This section is for changing the COLORS used in Amfora.
|
||||
# These colors only apply if 'color' is enabled above.
|
||||
# Colors can be set using a W3C color name, or a hex value such as "#ffffff".
|
||||
# Setting a background to "default" keeps the terminal default
|
||||
# If your terminal has transparency, set any background to "default" to keep it transparent
|
||||
# The key "bg" is already set to "default", but this can be used on other backgrounds,
|
||||
# like for modals.
|
||||
|
||||
# Note that not all colors will work on terminals that do not have truecolor support.
|
||||
# If you want to stick to the standard 16 or 256 colors, you can get
|
||||
# a list of those here: https://jonasjacek.github.io/colors/
|
||||
# DO NOT use the names from that site, just the hex codes.
|
||||
|
||||
# Definitions:
|
||||
# bg = background
|
||||
# fg = foreground
|
||||
# dl = download
|
||||
# btn = button
|
||||
# hdg = heading
|
||||
# bkmk = bookmark
|
||||
# modal = a popup window/box in the middle of the screen
|
||||
|
||||
# EXAMPLES:
|
||||
# hdg_1 = "green"
|
||||
# hdg_2 = "#5f0000"
|
||||
# bg = "default"
|
||||
|
||||
# Available keys to set:
|
||||
|
||||
# bg: background for pages, tab row, app in general
|
||||
# tab_num: The number/highlight of the tabs at the top
|
||||
# tab_divider: The color of the divider character between tab numbers: |
|
||||
# bottombar_label: The color of the prompt that appears when you press space
|
||||
# bottombar_text: The color of the text you type
|
||||
# bottombar_bg
|
||||
# scrollbar: The scrollbar that appears on the right for long pages
|
||||
|
||||
# hdg_1
|
||||
# hdg_2
|
||||
# hdg_3
|
||||
# amfora_link: A link that Amfora supports viewing. For now this is only gemini://
|
||||
# foreign_link: HTTP(S), Gopher, etc
|
||||
# link_number: The silver number that appears to the left of a link
|
||||
# regular_text: Normal gemini text, and plaintext documents
|
||||
# quote_text
|
||||
# preformatted_text
|
||||
# list_text
|
||||
|
||||
# btn_bg: The bg color for all modal buttons
|
||||
# btn_text: The text color for all modal buttons
|
||||
|
||||
# dl_choice_modal_bg
|
||||
# dl_choice_modal_text
|
||||
# dl_modal_bg
|
||||
# dl_modal_text
|
||||
# info_modal_bg
|
||||
# info_modal_text
|
||||
# error_modal_bg
|
||||
# error_modal_text
|
||||
# yesno_modal_bg
|
||||
# yesno_modal_text
|
||||
# tofu_modal_bg
|
||||
# tofu_modal_text
|
||||
# subscription_modal_bg
|
||||
# subscription_modal_text
|
||||
|
||||
# input_modal_bg
|
||||
# input_modal_text
|
||||
# input_modal_field_bg: The bg of the input field, where you type the text
|
||||
# input_modal_field_text: The color of the text you type
|
||||
|
||||
# bkmk_modal_bg
|
||||
# bkmk_modal_text
|
||||
# bkmk_modal_label
|
||||
# bkmk_modal_field_bg
|
||||
# bkmk_modal_field_text
|
|
@ -0,0 +1,20 @@
|
|||
_
|
||||
_ __ __ _(_)_ _
|
||||
| ' \/ _` | | ' \
|
||||
|_|_|_\__,_|_|_||_|
|
||||
|
||||
=> gemini://vitorg.vern.cc my capsule
|
||||
=> gemini://vern.cc ~vern capsule
|
||||
|
||||
=> gemini://geminispace.info search engine
|
||||
|
||||
=> about:bookmarks bookmarks
|
||||
=> about:subscriptions subs
|
||||
|
||||
_ _ _ _
|
||||
_ _ (_)__ ___ | (_)_ _ | |__ ___
|
||||
| ' \| / _/ -_) | | | ' \| / /(_-<
|
||||
|_||_|_\__\___| |_|_|_||_|_\_\/__/
|
||||
|
||||
=> gemini://tilde.pink/~emily emily's capsule
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
alias ls="exa -laH --group-directories-first"
|
||||
alias la="exa -aH --group-directories-first"
|
||||
alias l="exa -H --group-directories-first"
|
||||
|
||||
alias monerod="monerod --data-dir "$XDG_DATA_HOME"/bitmonero"
|
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# prompt
|
||||
# get current branch in git repo
|
||||
function parse_git_branch() {
|
||||
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
|
||||
if [ ! "${BRANCH}" == "" ]
|
||||
then
|
||||
STAT=`parse_git_dirty`
|
||||
echo "- [${BRANCH}${STAT}] "
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# get current status of git repo
|
||||
function parse_git_dirty {
|
||||
status=`git status 2>&1 | tee`
|
||||
dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"`
|
||||
untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"`
|
||||
ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"`
|
||||
newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"`
|
||||
renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"`
|
||||
deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"`
|
||||
bits=''
|
||||
if [ "${renamed}" == "0" ]; then
|
||||
bits=">${bits}"
|
||||
fi
|
||||
if [ "${ahead}" == "0" ]; then
|
||||
bits="*${bits}"
|
||||
fi
|
||||
if [ "${newfile}" == "0" ]; then
|
||||
bits="+${bits}"
|
||||
fi
|
||||
if [ "${untracked}" == "0" ]; then
|
||||
bits="?${bits}"
|
||||
fi
|
||||
if [ "${deleted}" == "0" ]; then
|
||||
bits="x${bits}"
|
||||
fi
|
||||
if [ "${dirty}" == "0" ]; then
|
||||
bits="!${bits}"
|
||||
fi
|
||||
if [ ! "${bits}" == "" ]; then
|
||||
echo " ${bits}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
export PS1="\[\e[34m\]\u\[\e[m\]\[\e[34m\]@\[\e[m\]\[\e[34m\]\h\[\e[m\] \[\e[31m\]\w\[\e[m\] \[\e[35m\]\`parse_git_branch\`\[\e[m\]\[\e[32m\]\\$\[\e[m\] "
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
shopt -s autocd
|
||||
shopt -s histappend
|
||||
|
||||
# pinentry and stuff
|
||||
export GPG_TTY=$(tty)
|
||||
|
||||
export EDITOR="nvim" VISUAL="nvim"
|
||||
|
||||
source "$HOME/.config/bash/aliases"
|
||||
source "$HOME/.config/bash/prompt"
|
|
@ -0,0 +1,10 @@
|
|||
[user]
|
||||
email = vitorg@tilde.team
|
||||
name = Vitor Gonçalves
|
||||
signingKey = 65DA8300A1A5E18AE6EB0DEBB90BF113DF56EB41
|
||||
[core]
|
||||
sshCommand = ssh -i ~/.ssh/id_codeberg
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[pull]
|
||||
rebase = false
|
|
@ -0,0 +1,49 @@
|
|||
" *init.vim*
|
||||
|
||||
" removes annoying swap, improves performance and asks for confirmation before write
|
||||
set noswapfile lazyredraw confirm
|
||||
|
||||
" indentation
|
||||
filetype plugin indent on
|
||||
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smartindent " tab setting
|
||||
set showmatch ignorecase smartcase
|
||||
|
||||
|
||||
set undofile " persist undo
|
||||
set clipboard=unnamedplus " X clipboard to nvim
|
||||
|
||||
" plugins
|
||||
call plug#begin()
|
||||
Plug 'sainnhe/gruvbox-material' " best theme
|
||||
call plug#end()
|
||||
|
||||
" styling
|
||||
syntax on
|
||||
set termguicolors
|
||||
|
||||
set number relativenumber numberwidth=2 cursorline
|
||||
set conceallevel=3
|
||||
|
||||
set background=dark
|
||||
let g:gruvbox_material_better_performance = 1
|
||||
let g:gruvbox_material_statusline_style = 'original'
|
||||
colo gruvbox-material
|
||||
|
||||
"" bindings
|
||||
" leader mapping
|
||||
nnoremap <SPACE> <Nop>
|
||||
let mapleader=" "
|
||||
let localleader=" "
|
||||
|
||||
" easy splits
|
||||
nnoremap <leader>h <C-w>h
|
||||
nnoremap <leader>j <C-w>j
|
||||
nnoremap <leader>k <C-w>k
|
||||
nnoremap <leader>l <C-w>l
|
||||
set splitright splitbelow
|
||||
|
||||
" easy write
|
||||
nmap <leader>w :w!<CR>
|
||||
nmap <leader>W :w!<CR>
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,175 @@
|
|||
from libqtile import bar, layout, widget
|
||||
from libqtile.config import Click, Drag, Group, Key, Match, Screen
|
||||
from libqtile.lazy import lazy
|
||||
|
||||
mod = "mod4"
|
||||
terminal = "alacritty"
|
||||
browser = "firefox"
|
||||
run_prompt = "dmenu_run"
|
||||
|
||||
|
||||
# colors
|
||||
accent = "#ea6962"
|
||||
accent2 = "#d8a657"
|
||||
bg_col = "#282828"
|
||||
fg_col = "#d4be98"
|
||||
|
||||
# custom functions
|
||||
def SplitString(string):
|
||||
return list(string.split(" "))
|
||||
|
||||
keys = [
|
||||
Key([mod], "j",
|
||||
lazy.layout.down(),
|
||||
desc="Move focus down"),
|
||||
Key([mod], "k",
|
||||
lazy.layout.up(),
|
||||
desc="Move focus up"),
|
||||
|
||||
Key([mod, "shift"], "j",
|
||||
lazy.layout.shuffle_down(),
|
||||
desc="Move window down"),
|
||||
Key([mod, "shift"], "k",
|
||||
lazy.layout.shuffle_up(),
|
||||
desc="Move window up"),
|
||||
|
||||
Key([mod], "h",
|
||||
lazy.layout.grow(),
|
||||
desc="Grow window to the left"),
|
||||
Key([mod], "l",
|
||||
lazy.layout.shrink(),
|
||||
desc="Grow window to the right"),
|
||||
Key([mod], "n",
|
||||
lazy.layout.normalize(),
|
||||
desc="Reset all window sizes"),
|
||||
|
||||
Key([mod], "Return",
|
||||
lazy.spawn(terminal),
|
||||
desc="Launch terminal"),
|
||||
Key([mod], "b",
|
||||
lazy.spawn(browser),
|
||||
desc="Launch browser"),
|
||||
Key([mod], "r",
|
||||
lazy.spawn(run_prompt),
|
||||
desc="Spawn a command using a prompt widget"),
|
||||
Key([mod], "p",
|
||||
lazy.spawn("screenshotit"),
|
||||
desc="Literally a screenshot utility, wow"),
|
||||
Key([mod, "shift"], "s",
|
||||
lazy.spawn("shorten-clipb"),
|
||||
desc="Shortens a url (via 0.vern.cc) that's on the clipboard"),
|
||||
|
||||
Key([mod], "space",
|
||||
lazy.next_layout(),
|
||||
desc="Toggle between layouts"),
|
||||
Key([mod], "w",
|
||||
lazy.window.kill(),
|
||||
desc="Kill focused window"),
|
||||
Key([mod, "shift"], "r",
|
||||
lazy.reload_config(),
|
||||
desc="Reload the config"),
|
||||
Key([mod, "shift"], "q",
|
||||
lazy.shutdown(),
|
||||
desc="Shutdown Qtile"),
|
||||
]
|
||||
|
||||
groups = [Group(i) for i in "123456789"]
|
||||
|
||||
for i in groups:
|
||||
keys.extend(
|
||||
[
|
||||
# mod1 + letter of group = switch to group
|
||||
Key(
|
||||
[mod],
|
||||
i.name,
|
||||
lazy.group[i.name].toscreen(),
|
||||
desc="Switch to group {}".format(i.name),
|
||||
),
|
||||
# mod1 + shift + letter of group = switch to & move focused window to group
|
||||
Key(
|
||||
[mod, "shift"],
|
||||
i.name,
|
||||
lazy.window.togroup(i.name, switch_group=True),
|
||||
desc="Switch to & move focused window to group {}".format(i.name),
|
||||
),
|
||||
# Or, use below if you prefer not to switch to that group.
|
||||
# # mod1 + shift + letter of group = move focused window to group
|
||||
# Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
|
||||
# desc="move focused window to group {}".format(i.name)),
|
||||
]
|
||||
)
|
||||
|
||||
layouts = [
|
||||
layout.MonadTall(border_focus = accent,
|
||||
border_unfocus = "#222222",
|
||||
border_width = 1,
|
||||
margin = 2),
|
||||
layout.Max(),
|
||||
]
|
||||
|
||||
widget_defaults = dict(
|
||||
font = "monospace",
|
||||
fontsize = 12,
|
||||
padding = 3,
|
||||
background = bg_col,
|
||||
foreground = fg_col,
|
||||
)
|
||||
|
||||
screens = [
|
||||
Screen(
|
||||
top=bar.Bar(
|
||||
[
|
||||
widget.CurrentLayoutIcon(scale=0.8, custom_icon_paths="~/.config/qtile/icons"),
|
||||
widget.GroupBox(rounded=False, highlight_method="block", active=fg_col, inactive=fg_col, urgent_border=accent2, this_current_screen_border=accent),
|
||||
#widget.WindowName(),
|
||||
widget.Spacer(length=bar.STRETCH),
|
||||
widget.Chord(
|
||||
chords_colors={
|
||||
"launch": ("#ff0000", "#ffffff"),
|
||||
},
|
||||
name_transform=lambda name: name.upper(),
|
||||
),
|
||||
# widget.StatusNotifier(),
|
||||
widget.Systray(),
|
||||
widget.Clock(format="%Y-%m-%d %a %I:%M %p"),
|
||||
],
|
||||
24,
|
||||
# border_width=[2, 0, 2, 0], # Draw top and bottom borders
|
||||
# border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
# Drag floating layouts.
|
||||
mouse = [
|
||||
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
|
||||
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
|
||||
Click([mod], "Button2", lazy.window.toggle_floating())
|
||||
]
|
||||
|
||||
dgroups_key_binder = None
|
||||
dgroups_app_rules = [] # type: list
|
||||
follow_mouse_focus = True
|
||||
bring_front_click = False
|
||||
cursor_warp = False
|
||||
floating_layout = layout.Floating(
|
||||
float_rules=[
|
||||
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||
*layout.Floating.default_float_rules,
|
||||
Match(wm_class="confirmreset"), # gitk
|
||||
Match(wm_class="makebranch"), # gitk
|
||||
Match(wm_class="maketag"), # gitk
|
||||
Match(wm_class="ssh-askpass"), # ssh-askpass
|
||||
Match(title="branchdialog"), # gitk
|
||||
Match(title="pinentry"), # GPG key password entry
|
||||
]
|
||||
)
|
||||
auto_fullscreen = True
|
||||
focus_on_window_activation = "smart"
|
||||
reconfigure_screens = True
|
||||
|
||||
auto_minimize = False
|
||||
|
||||
wl_input_rules = None
|
||||
|
||||
wmname = "LG3D"
|
|
@ -0,0 +1,2 @@
|
|||
setxkbmap br &
|
||||
qtile start
|
|
@ -0,0 +1,17 @@
|
|||
# Default settings for user directories
|
||||
#
|
||||
# The values are relative pathnames from the home directory and
|
||||
# will be translated on a per-path-element basis into the users locale
|
||||
DESKTOP=~/docs
|
||||
DOWNLOAD=~/dl
|
||||
TEMPLATES=~/docs
|
||||
PUBLICSHARE=~/docs
|
||||
DOCUMENTS=~/docs
|
||||
MUSIC=~/media/music
|
||||
PICTURES=~/media/img
|
||||
VIDEOS=~/media/video
|
||||
# Another alternative is:
|
||||
#MUSIC=Documents/Music
|
||||
#PICTURES=Documents/Pictures
|
||||
#VIDEOS=Documents/Videos
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
#!/bin/sh
|
||||
|
||||
# init variables
|
||||
version="v2022.11.03"
|
||||
ENDPOINT="https://0.vern.cc"
|
||||
flag_options=":hvcfe:s:"
|
||||
long_flag_options="help,version,color,file,extension:,server:"
|
||||
flag_version=0
|
||||
flag_help=0
|
||||
flag_file=0
|
||||
flag_colors=0
|
||||
flag_ext=0
|
||||
data=""
|
||||
EXT=""
|
||||
|
||||
# help message available via func
|
||||
show_help() {
|
||||
cat > /dev/stdout << END
|
||||
pb [options] filename
|
||||
or
|
||||
(command-with-stdout) | pb
|
||||
|
||||
Uploads a file or data to the tilde 0x0 paste bin
|
||||
|
||||
OPTIONAL FLAGS:
|
||||
-h | --help) Show this help
|
||||
-v | --version) Show current version number
|
||||
-f | --file) Explicitly interpret stdin as filename
|
||||
-c | --color) Pretty color output
|
||||
-s | --server server_address) Use alternative pastebin server address
|
||||
-e | --extension bin_extension) Specify file extension used in the upload
|
||||
END
|
||||
}
|
||||
|
||||
show_usage() {
|
||||
cat > /dev/stdout << END
|
||||
usage: pb [-hfvcux] [-s server_address] filename
|
||||
END
|
||||
}
|
||||
|
||||
# helper for program exit, supports error codes and messages
|
||||
die () {
|
||||
msg="$1"
|
||||
code="$2"
|
||||
# exit code defaults to 1
|
||||
if printf "%s" "${code}" | grep -q '^[0-9]+$'; then
|
||||
code=1
|
||||
fi
|
||||
# output message to stdout or stderr based on code
|
||||
if [ -n "${msg}" ]; then
|
||||
if [ "${code}" -eq 0 ]; then
|
||||
printf "%s\\n" "${msg}"
|
||||
else
|
||||
printf "%s%s%s\\n" "$ERROR" "${msg}" "$RESET" >&2
|
||||
fi
|
||||
fi
|
||||
exit "${code}"
|
||||
}
|
||||
|
||||
# attempt to parse options or die
|
||||
if ! PARSED_ARGUMENTS=$(getopt -a -n pb -o ${flag_options} --long ${long_flag_options} -- "$@"); then
|
||||
printf "pb: unknown option\\n"
|
||||
show_usage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# For debugging: echo "PARSED_ARGUMENTS is $PARSED_ARGUMENTS"
|
||||
eval set -- "$PARSED_ARGUMENTS"
|
||||
while :
|
||||
do
|
||||
case "$1" in
|
||||
-h | --help) flag_help=1 ; shift ;;
|
||||
-v | --version) flag_version=1 ; shift ;;
|
||||
-c | --color) flag_color=1 ; shift ;;
|
||||
-f | --file) flag_file=1 ; shift ;;
|
||||
-e | --extension) flag_ext=1; EXT="$2" ; shift 2 ;;
|
||||
-s | --server) ENDPOINT="$2" ; shift 2 ;;
|
||||
--) shift; break ;;
|
||||
*) echo "Unexpected option: $1 - this should not happen."
|
||||
show_usage ; die 3 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# display current version
|
||||
if [ ${flag_version} -gt 0 ]; then
|
||||
printf "%s\\n" "${version}"
|
||||
die "" 0
|
||||
fi
|
||||
|
||||
# display help
|
||||
if [ ${flag_help} -gt 0 ]; then
|
||||
show_help
|
||||
die "" 0
|
||||
fi
|
||||
|
||||
# is not interactive shell, use stdin
|
||||
if [ -t 0 ]; then
|
||||
flag_file=1
|
||||
else
|
||||
if [ ${flag_ext} -gt 0 ]; then
|
||||
# short-circuit stdin access to ensure binary data is transferred to curl
|
||||
curl -sF"file=@-;filename=null.${EXT}" "${ENDPOINT}" < /dev/stdin
|
||||
exit 0
|
||||
else
|
||||
data="$(cat < /dev/stdin )"
|
||||
fi
|
||||
fi
|
||||
|
||||
# if data variable is empty (not a pipe) use params as fallback
|
||||
if [ -z "$data" ]; then
|
||||
data="$*"
|
||||
fi
|
||||
|
||||
# Colors
|
||||
if [ ${flag_colors} -gt 0 ]; then
|
||||
SUCCESS=$(tput setaf 190)
|
||||
ERROR=$(tput setaf 196)
|
||||
RESET=$(tput sgr0)
|
||||
else
|
||||
SUCCESS=""
|
||||
ERROR=""
|
||||
RESET=""
|
||||
fi
|
||||
|
||||
if [ ${flag_file} -gt 0 ]; then
|
||||
# file mode
|
||||
if [ -z "${data}" ]; then
|
||||
# if no data
|
||||
# print error message
|
||||
printf "%sProvide data to upload%s\\n" "$ERROR" "$RESET"
|
||||
elif [ ! -f "${data}" ]; then
|
||||
# file not found with name provided
|
||||
# print error messagse
|
||||
printf "%s%s%s\\tFile not found.%s\\n" "$RESET" "${data}" "$ERROR" "$RESET"
|
||||
# attempt to split data string (multi-line?) and upload each string as file
|
||||
for f in ${data}; do
|
||||
# if there's nothing to parse, skip this loop
|
||||
if [ "$f" = "$data" ]; then
|
||||
break;
|
||||
fi
|
||||
# check if file exists
|
||||
if [ -f "${f}" ]; then
|
||||
if [ ${flag_ext} -gt 0 ]; then
|
||||
# send file to endpoint masked with new extension
|
||||
result=$(curl -sF"file=@${f};filename=null.${EXT}" "${ENDPOINT}")
|
||||
else
|
||||
# send file to endpoint
|
||||
result=$(curl -sF"file=@${f}" "${ENDPOINT}")
|
||||
fi
|
||||
printf "%s%s%s\\n" "$SUCCESS" "$result" "$RESET"
|
||||
else
|
||||
# print error message
|
||||
printf "%sFile not found.%s\\n" "$ERROR" "$RESET"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# data available in file
|
||||
# send file to endpoint
|
||||
result=$(curl -sF"file=@${data}" "${ENDPOINT}")
|
||||
printf "%s%s%s\\n" "$SUCCESS" "$result" "$RESET"
|
||||
fi
|
||||
else
|
||||
# non-file mode
|
||||
if [ -z "${data}" ]; then
|
||||
# if no data
|
||||
# print error message
|
||||
printf "%sNo data found for upload. Please try again.%s\\n" "$ERROR" "$RESET"
|
||||
else
|
||||
# data available
|
||||
# send data to endpoint
|
||||
result=$(printf "%s" "${data}" | curl -sF"file=@-;filename=null.txt" "${ENDPOINT}")
|
||||
printf "%s%s%s\\n" "$SUCCESS" "$result" "$RESET"
|
||||
fi
|
||||
fi
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
POSTDATE="$(date '+%Y-%m-%d %H:%M %:::z')\n\n"
|
||||
|
||||
$EDITOR /tmp/gemlog-post.txt && sed -i "2s\`^.*$\`\n## $POSTDATE$(cat /tmp/gemlog-post.txt)\n\n-----\n\`" "$HOME/docs/src/gmi/tinylog.gmi"
|
||||
cd "$HOME"/docs/src/gmi/; git diff
|
|
@ -0,0 +1,308 @@
|
|||
#!/bin/python
|
||||
import argparse
|
||||
import csv
|
||||
import logging
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
||||
import gnupg
|
||||
|
||||
logging.basicConfig(level=logging.INFO, format='%(message)s')
|
||||
|
||||
|
||||
def set_meta(entry, path, grouping_base):
|
||||
pure_path = pathlib.PurePath(path)
|
||||
group = pure_path.relative_to(grouping_base).parent
|
||||
if group.name == '':
|
||||
group = ''
|
||||
entry['group'] = group
|
||||
entry['title'] = pure_path.stem
|
||||
|
||||
|
||||
def set_data(entry, data, exclude, get_fields, get_lines):
|
||||
lines = data.splitlines()
|
||||
tail = lines[1:]
|
||||
entry['password'] = lines[0]
|
||||
|
||||
filtered_tail = []
|
||||
for line in tail:
|
||||
for exclude_pattern in exclude:
|
||||
if exclude_pattern.search(line):
|
||||
break
|
||||
else:
|
||||
filtered_tail.append(line)
|
||||
|
||||
matching_indices = set()
|
||||
fields = entry.setdefault('fields', {})
|
||||
|
||||
for i, line in enumerate(filtered_tail):
|
||||
for name, pattern in get_fields:
|
||||
if name in fields:
|
||||
# multiple patterns with same name, we've already found a match
|
||||
continue
|
||||
match = pattern.search(line)
|
||||
if not match:
|
||||
continue
|
||||
inverse_match = line[0:match.start()] + line[match.end():]
|
||||
value = inverse_match.strip()
|
||||
fields[name] = value
|
||||
matching_indices.add(i)
|
||||
break
|
||||
|
||||
matching_lines = {}
|
||||
for i, line in enumerate(filtered_tail):
|
||||
for name, pattern in get_lines:
|
||||
match = pattern.search(line)
|
||||
if not match:
|
||||
continue
|
||||
matches = matching_lines.setdefault(name, [])
|
||||
matches.append(line)
|
||||
matching_indices.add(i)
|
||||
break
|
||||
for name, matches in matching_lines.items():
|
||||
fields[name] = '\n'.join(matches)
|
||||
|
||||
final_tail = []
|
||||
for i, line in enumerate(filtered_tail):
|
||||
if i not in matching_indices:
|
||||
final_tail.append(line)
|
||||
|
||||
entry['notes'] = '\n'.join(final_tail).strip()
|
||||
|
||||
|
||||
def write(file, entries, get_fields, get_lines):
|
||||
get_field_names = set(x[0] for x in get_fields)
|
||||
get_line_names = set(x[0] for x in get_lines)
|
||||
field_names = get_field_names | get_line_names
|
||||
header = ["Group(/)", "Title", "Password", *field_names, "Notes"]
|
||||
csvw = csv.writer(file)
|
||||
logging.info("\nWriting data to %s\n", file.name)
|
||||
csvw.writerow(header)
|
||||
for entry in entries:
|
||||
fields = [entry['fields'].get(name) for name in field_names]
|
||||
columns = [
|
||||
entry['group'], entry['title'], entry['password'],
|
||||
*fields,
|
||||
entry['notes']
|
||||
]
|
||||
csvw.writerow(columns)
|
||||
|
||||
|
||||
def main(store_path, outfile, grouping_base, gpgbinary, use_agent, encodings,
|
||||
exclude, get_fields, get_lines):
|
||||
entries = []
|
||||
failures = []
|
||||
path = pathlib.Path(store_path)
|
||||
grouping_path = pathlib.Path(grouping_base)
|
||||
gpg = gnupg.GPG(gpgbinary=gpgbinary, use_agent=use_agent)
|
||||
files = path.glob('**/*.gpg')
|
||||
if not path.is_dir():
|
||||
if path.is_file():
|
||||
files = [path]
|
||||
else:
|
||||
err = "No such file or directory: {}".format(path)
|
||||
logging.error(err)
|
||||
sys.exit(1)
|
||||
for file in files:
|
||||
logging.info("Processing %s", file)
|
||||
with open(file, 'rb') as fp:
|
||||
decrypted = gpg.decrypt_file(fp)
|
||||
if not decrypted.ok:
|
||||
err = "Could not decrypt {}: {}".format(file, decrypted.status)
|
||||
logging.error(err)
|
||||
failures.append(err)
|
||||
continue
|
||||
for i, encoding in enumerate(encodings):
|
||||
try:
|
||||
# decrypted.data is bytes
|
||||
decrypted_data = decrypted.data.decode(encoding)
|
||||
except Exception as e:
|
||||
logging.warning(
|
||||
"Could not decode {} with encoding {}: {}"
|
||||
.format(file, encoding, e)
|
||||
)
|
||||
continue
|
||||
if i > 0:
|
||||
# don't log if the first encoding worked
|
||||
logging.warning("Decoded {} with encoding {}".format(file, encoding))
|
||||
break
|
||||
else:
|
||||
err = "Could not decode {}, see messages above for more info.".format(file)
|
||||
failures.append(err)
|
||||
continue
|
||||
entry = {}
|
||||
set_meta(entry, file, grouping_path)
|
||||
set_data(entry, decrypted_data, exclude, get_fields, get_lines)
|
||||
entries.append(entry)
|
||||
if failures:
|
||||
logging.warning("\nGot errors while processing files:")
|
||||
for err in failures:
|
||||
logging.warning(err)
|
||||
write(outfile, entries, get_fields, get_lines)
|
||||
|
||||
|
||||
def parse_args(args=None):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'store_path',
|
||||
metavar='STOREPATH',
|
||||
type=str,
|
||||
help="path to the password-store to export",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'outfile',
|
||||
metavar='OUTFILE',
|
||||
type=argparse.FileType('w'),
|
||||
help="file to write exported data to, use - for stdout",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-b', '--base',
|
||||
metavar='path',
|
||||
type=str,
|
||||
help="path to use as base for grouping passwords",
|
||||
dest='base_path'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-g', '--gpg',
|
||||
metavar='executable',
|
||||
type=str,
|
||||
default="gpg",
|
||||
help="path to the gpg binary you wish to use (default 'gpg')",
|
||||
dest='gpgbinary'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-a', '--use-agent',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="ask gpg to use its auth agent",
|
||||
dest='use_agent'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--encodings',
|
||||
metavar='encodings',
|
||||
type=str,
|
||||
default="utf-8",
|
||||
help=(
|
||||
"comma-separated text encodings to try, in order, when decoding"
|
||||
" gpg output (default 'utf-8')"
|
||||
),
|
||||
dest='encodings'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-e', '--exclude',
|
||||
metavar='pattern',
|
||||
action='append',
|
||||
type=str,
|
||||
default=[],
|
||||
help=(
|
||||
"regexp for lines which should not be exported, can be specified"
|
||||
" multiple times"
|
||||
),
|
||||
dest='exclude'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-f', '--get-field',
|
||||
metavar=('name', 'pattern'),
|
||||
action='append',
|
||||
nargs=2,
|
||||
type=str,
|
||||
default=[],
|
||||
help=(
|
||||
"a name and a regexp, the part of the line matching the regexp"
|
||||
" will be removed and the remaining line will be added to a field"
|
||||
" with the chosen name. only one match per password, matching"
|
||||
" stops after the first match"
|
||||
),
|
||||
dest='get_fields'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-l', '--get-line',
|
||||
metavar=('name', 'pattern'),
|
||||
action='append',
|
||||
nargs=2,
|
||||
type=str,
|
||||
default=[],
|
||||
help=(
|
||||
"a name and a regexp for which all lines that match are included"
|
||||
" in a field with the chosen name"
|
||||
),
|
||||
dest='get_lines'
|
||||
)
|
||||
|
||||
return parser.parse_args(args)
|
||||
|
||||
|
||||
def compile_regexp(pattern):
|
||||
try:
|
||||
regexp = re.compile(pattern, re.I)
|
||||
except re.error as e:
|
||||
logging.error(
|
||||
"Could not compile pattern '%s', %s at position %s",
|
||||
pattern.replace("'", "\\'"), e.msg, e.pos
|
||||
)
|
||||
return None
|
||||
return regexp
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parsed = parse_args()
|
||||
|
||||
failed = False
|
||||
exclude_patterns = []
|
||||
for pattern in parsed.exclude:
|
||||
regexp = compile_regexp(pattern)
|
||||
if not regexp:
|
||||
failed = True
|
||||
exclude_patterns.append(regexp)
|
||||
|
||||
get_fields = []
|
||||
for name, pattern in parsed.get_fields:
|
||||
regexp = compile_regexp(pattern)
|
||||
if not regexp:
|
||||
failed = True
|
||||
get_fields.append((name, regexp))
|
||||
|
||||
get_lines = []
|
||||
for name, pattern in parsed.get_lines:
|
||||
regexp = compile_regexp(pattern)
|
||||
if not regexp:
|
||||
failed = True
|
||||
get_lines.append((name, regexp))
|
||||
|
||||
if failed:
|
||||
sys.exit(1)
|
||||
|
||||
if parsed.base_path:
|
||||
grouping_base = parsed.base_path
|
||||
else:
|
||||
grouping_base = parsed.store_path
|
||||
|
||||
encodings = [e for e in parsed.encodings.split(',') if e]
|
||||
if not encodings:
|
||||
logging.error(
|
||||
"Did not understand '--encodings {}'".format(parsed.encoding)
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
kwargs = {
|
||||
'store_path': parsed.store_path,
|
||||
'outfile': parsed.outfile,
|
||||
'grouping_base': grouping_base,
|
||||
'gpgbinary': parsed.gpgbinary,
|
||||
'use_agent': parsed.use_agent,
|
||||
'encodings': encodings,
|
||||
'exclude': exclude_patterns,
|
||||
'get_fields': get_fields,
|
||||
'get_lines': get_lines
|
||||
}
|
||||
|
||||
main(**kwargs)
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from pip._internal.cli.main import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from pip._internal.cli.main import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import sys
|
||||
from pip._internal.cli.main import main
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(main())
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
case $1 in
|
||||
cf)
|
||||
filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
|
||||
maim -s > "$HOME/media/screenshots/$filename"
|
||||
xclip -sel clipb -t image/png "$HOME/media/screenshots/$filename"
|
||||
;;
|
||||
cl)
|
||||
filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
|
||||
maim -s > $HOME/media/screenshots/$filename
|
||||
curl -F"file=@$HOME/media/screenshots/$filename" -Fsecret= "https://0.vern.cc/" | xclip -sel clipb
|
||||
;;
|
||||
wf)
|
||||
filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
|
||||
maim -i $(xdotool getactivewindow) > "$HOME/media/screenshots/$filename"
|
||||
xclip -sel clipb -t image/png "$HOME/media/screenshots/$filename"
|
||||
;;
|
||||
wl)
|
||||
filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
|
||||
maim -i $(xdotool getactivewindow) > $HOME/media/screenshots/$filename
|
||||
curl -F"file=@$HOME/media/screenshots/$filename" -Fsecret= "https://0.vern.cc/" | xclip -sel clipb
|
||||
;;
|
||||
ff)
|
||||
filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
|
||||
maim > "$HOME/media/screenshots/$filename"
|
||||
xclip -sel clipb -t image/png "$HOME/media/screenshots/$filename"
|
||||
;;
|
||||
fl)
|
||||
filename="$(date '+%d_%m_%Y-%H_%M_%s').png"
|
||||
maim > $HOME/media/screenshots/$filename
|
||||
curl -F"file=@$HOME/media/screenshots/$filename" -Fsecret= "https://0.vern.cc/" | xclip -sel clipb
|
||||
;;
|
||||
*)
|
||||
echo "Usage info:"
|
||||
echo
|
||||
echo "s cf - Takes a screenshot from a region and then copies the file to the clipboard selection"
|
||||
echo "s cl - Takes a screenshot from a region and then uploads it to 0.vern.cc, and automatically copies the link"
|
||||
echo "s wf - Takes a screenshot from the active window and then copies the file to the clipboard selection"
|
||||
echo "s wl - Takes a screenshot from the active window and then uploads it to 0.vern.cc, and automatically copies the link"
|
||||
echo "s ff - Takes a screenshot of the full screen and then copies the file to the clipboard selection"
|
||||
echo "s fl - Takes a screenshot of the full screen and then uploads it to 0.vern.cc, and automatically copies the link"
|
||||
echo
|
||||
echo "Notice: all of these commands output it's screenshots to \`~/media/screenshots/\`."
|
||||
esac
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
printf "Fullscreen, copy file (ff)\nFullscreen, copy link (fl)\nWindow, copy file (wf)\nWindow, copy link (wl)\nRegion, copy file (rf)\nRegion, copy link (rl)" | dmenu -l 6 |\
|
||||
sed "s/Fullscreen/f/;s/Window/w/;s/Region/c/;s/copy file/f/;s/copy link/l/;s/, //" | xargs "s"
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
curl -F"shorten=$(xclip -o)" -Fsecret= https://0.vern.cc/ | xclip -sel clipb
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
WALLPAPER_DIR="$HOME/media/wallpapers"
|
||||
|
||||
case $1 in
|
||||
r)
|
||||
find $WALLPAPER_DIR -iname "*.jpg" | shuf -n 1 | xargs xwallpaper --stretch
|
||||
;;
|
||||
*)
|
||||
echo "Usage info:"
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
case $1 in
|
||||
install | i | add)
|
||||
sudo xbps-install ${@:2}
|
||||
;;
|
||||
remove | r | del | delete)
|
||||
sudo xbps-remove ${@:2}
|
||||
;;
|
||||
query | q | search | s)
|
||||
sudo xbps-query ${@:2}
|
||||
;;
|
||||
upgrade | u)
|
||||
sudo xbps-install -Su
|
||||
;;
|
||||
locate | l | find | f)
|
||||
xlocate ${@:2}
|
||||
;;
|
||||
*)
|
||||
echo "Usage info:"
|
||||
echo
|
||||
echo "xb i - Calls 'sudo xbps-install' with the following arguments"
|
||||
echo "xb q - Calls 'sudo xbps-query' with the following arguments"
|
||||
echo "xb r - Calls 'sudo xbps-remove' with the following arguments"
|
||||
echo "xb u - Upgrades the system packages with 'sudo xbps-install -Su'"
|
||||
echo "xb l - Pass following arguments to xlocate"
|
||||
echo "xb h - Displays help"
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,14 @@
|
|||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
export PATH="$PATH:$HOME/.local/bin:$HOME/.config/bash/:$XDG_CONFIG_HOME/emacs/bin"
|
||||
|
||||
# remove some junk from the homedir
|
||||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
|
||||
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
|
||||
export HISTFILE="$XDG_STATE_HOME/bash/history"
|
||||
|
||||
export GOPATH="$XDG_DATA_HOME/go"
|
||||
export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
|
Loading…
Reference in New Issue