diff options
296 files changed, 8045 insertions, 3414 deletions
diff --git a/.bash_profile b/.bash_profile index d627809..1568113 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -eu # shellcheck disable=SC2016 prefixPath() { @@ -6,84 +6,88 @@ prefixPath() { *":$1:"*) true ;; *) PATH="$1:$PATH" ;; esac - export PATH; + export PATH } -# set xauthority path -export XAUTHORITY=$HOME/.config/X11/Xauthority; +prefixPath "$HOME/.local/bin" +prefixPath "$HOME/.local/bin/wrappers" -# auto login -[ "$EUID" != 0 ] && [ -z "$DISPLAY" ] && [ "$(tty)" = '/dev/tty1' ] \ - && command -v nix && "$HOME"/.local/bin/scripts/nix-xorg-conf > "$HOME"/.config/X11/xorg.conf.d/00-modules.conf \ - && exec xinit "$HOME/.config/X11/xinitrc" -- :0 \ - -configdir "$HOME/.config/X11/xorg.conf.d" \ - -logfile "$HOME/.cache/xorg.log" vt1 -keeptty -auth "$XAUTHORITY"; +umask 0022 -# set prompt PS1_USER='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;34m\]\W\[\e[0m\] \[\e[0;34m\]\$\[\e[0m\] ' PS1_ROOT='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;31m\]\W\[\e[0m\] \[\e[0;31m\]\$\[\e[0m\] ' PS1_SSHD='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;32m\]\W\[\e[0m\] \[\e[0;32m\]\$\[\e[0m\] ' -# export prompt -[ "$EUID" != 0 ] && export PS1="$PS1_USER"; -[ "$EUID" = 0 ] && export PS1="$PS1_ROOT"; - -# ssh set prompt -[ -n "$SSH_CLIENT" ] && [ "$EUID" != 0 ] && export PS1="$PS1_SSHD"; +[ "$EUID" != 0 ] && export PS1="$PS1_USER" +[ "$EUID" = 0 ] && export PS1="$PS1_ROOT" -# path exports -prefixPath "$HOME/.local/bin"; -prefixPath "$HOME/.local/bin/scripts"; +[ -n "$SSH_CLIENT" ] && [ "$EUID" != 0 ] && export PS1="$PS1_SSHD" -# xdg exports export XDG_CACHE_HOME="$HOME/.cache" export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" +export XDG_STATE_HOME="$HOME/.local/state" -# general exports -export BROWSER=chromium; -export CARGO_HOME="$XDG_CACHE_HOME/cargo" +export BROWSER=browser export EDITOR=vim -export FZF_DIRECTORY_MARKS=$HOME/Documents/.fzf-marks -export FZF_FILE_MARKS=$HOME/Documents/.fzf-fmarks +export TERMINAL=urxvt + +export DESKTOP_SESSION=gnome +export XDG_CURRENT_DESKTOP=gnome + +export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" +export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache" +export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible" +export CARGO_HOME="$XDG_CACHE_HOME/cargo" +export DENO_DIR=vendor +export DENO_INSTALL_ROOT=bin +export DENO_NO_UPDATE_CHECK=1 +export DOWNLOAD_KEYSERVER="hkp://keyserver.ubuntu.com" +export ELECTRUMDIR="$XDG_DATA_HOME/electrum" +export FZF_DIRECTORY_MARKS=$XDG_CONFIG_HOME/fzf/marks/directories +export FZF_FILE_MARKS=$XDG_CONFIG_HOME/fzf/marks/files +export GNUPGHOME="$XDG_DATA_HOME/gnupg" export GOPATH="$XDG_DATA_HOME/go" +export GOPROXY=direct +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" +export GTK_OVERLAY_SCROLLING=0 export HISTCONTROL=ignoreboth:erasedups -export HISTFILESIZE= -export HISTSIZE= +export HISTFILE="$XDG_CACHE_HOME/bash.history" +export HISTFILEPERSIST="$XDG_DATA_HOME/bash/history" +export HISTFILESIZE=-1 +export HISTSIZE=-1 export HISTTIMEFORMAT="%d/%m/%y %T " export ICEAUTHORITY="$XDG_CACHE_HOME/ICEauthority" export INPUTRC="$XDG_CONFIG_HOME/inputrc" +export LEIN_HOME="$XDG_DATA_HOME/lein" export LESSHISTFILE="$XDG_CACHE_HOME/less.history" export MANPAGER="vim -M +MANPAGER -" export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer" export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npmrc" export PASSWORD_STORE_DIR="$XDG_CONFIG_HOME/pass" -export PROMPT_COMMAND='cd .; history -a; history -n;' +export PROMPT_COMMAND='cd .; history -a; history -n; (bashhistory &)' export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" +export RECOLL_CONFDIR="$XDG_CONFIG_HOME/recoll" export RUSTUP_HOME="$XDG_DATA_HOME/rustup" -export SUDO_ASKPASS="$HOME/.local/bin/rofi-askpass" -export TERMINAL=urxvt +export TEXINPUTS=$XDG_DATA_HOME/tex: +export URXVT_PERL_LIB="$XDG_CONFIG_HOME/urxvt/ext" export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat" -command -v groff > /dev/null 2>&1 && \ - GROFF_FONT_PATH="$HOME/.nix-profile/share/groff/$(groff -v | head -n1 | awk '{ print $4 }')/font" && \ - export GROFF_FONT_PATH - -# themes -export DESKTOP_SESSION=gnome -export XDG_CURRENT_DESKTOP=gnome -export GTK2_RC_FILES="$HOME/.gtkrc-2.0" -export QT_STYLE_OVERRIDE=adwaita - -# specific themes -[ "$(cat /etc/hostname)" = "tiger" ] && export QT_STYLE_OVERRIDE=adwaita-dark -[ "$(cat /etc/hostname)" = "talon" ] && export QT_STYLE_OVERRIDE=adwaita-dark +command -v rsvg-convert > /dev/null 2>&1 && \ + GDK_PIXBUF_MODULE_FILE=$(printf "%s" "$HOME"/.nix-profile/lib/gdk-pixbuf*/*/loaders.cache) && \ + export GDK_PIXBUF_MODULE_FILE -# fzf settings -export FZF_DEFAULT_OPTS="--color=fg:255,hl:203 \ +export FZF_DEFAULT_OPTS="\ + --no-separator \ + --inline-info \ + --color=fg:255,hl:203 \ --color=fg+:81,bg+:237,hl+:203 \ --color=info:188,prompt:69,pointer:199 \ --color=marker:109,spinner:236,header:255" -# source bashrc [ -z "$BASH_PROFILE" ] && . "$HOME/.bashrc" + +[ "$EUID" != 0 ] && [ -z "$DISPLAY" ] && [ "$(tty)" = '/dev/tty1' ] \ + && command -v nix && nix-xorg-conf > "$HOME"/.config/X11/xorg.conf.d/00-modules.conf \ + && { [ "$(systemctl --user is-enabled redshift)" = "enabled" ] && systemctl --user restart redshift & } \ + && exec sx @@ -1,54 +1,57 @@ -#!/bin/bash +#!/bin/bash -eu # source exports -export BASH_PROFILE=1 && . "$HOME/.bash_profile"; +export BASH_PROFILE=1 && . "$HOME/.bash_profile" # bail if not interactive -echo $- | grep -q "i" || return; +printf '%s' "$-" | grep -q "i" || return # cd using directory name -shopt -s autocd; +shopt -s autocd # append bash history entries -shopt -s histappend; +shopt -s histappend # bash history one command per line -shopt -s cmdhist; +shopt -s cmdhist + +# disable program completion +shopt -u progcomp # enable vi mode -set -o vi; +set -o vi # disable ctrl+s -stty stop ''; -stty start ''; -stty -ixon; -stty -ixoff; +stty stop '' +stty start '' +stty -ixon +stty -ixoff # fzf bindings -fzfcompletion=$(readlink "$(type -P fzf)" | cut -d '/' -f -4)/share/fzf/completion.bash; -fzfkeybindings=$(readlink "$(type -P fzf)" | cut -d '/' -f -4)/share/fzf/key-bindings.bash; -[ -f "$fzfcompletion" ] && . "$fzfcompletion"; -[ -f "$fzfkeybindings" ] && . "$fzfkeybindings"; +fzfcompletion="$HOME/.config/fzf/completion.bash" +fzfkeybindings="$HOME/.config/fzf/key-bindings.bash" +[ -f "$fzfcompletion" ] && . "$fzfcompletion" +[ -f "$fzfkeybindings" ] && . "$fzfkeybindings" # set virtual console colors if [ "$TERM" = "linux" ]; then - echo -en "\e]P0111111" #black [background] - echo -en "\e]P1D84F4F" #darkred - echo -en "\e]P2DEFF3E" #darkgreen - echo -en "\e]P3FFDF23" #brown - echo -en "\e]P479AEFF" #darkblue - echo -en "\e]P58894CF" #darkmagenta - echo -en "\e]P679AEFF" #darkcyan - echo -en "\e]P7dddddd" #lightgray - echo -en "\e]P8DDDDDD" #darkgray - echo -en "\e]P9E84F4F" #red - echo -en "\e]PABEFF3E" #green - echo -en "\e]PBFEA63C" #yellow - echo -en "\e]PC69AEFF" #blue - echo -en "\e]PD9894CF" #magenta - echo -en "\e]PE69AEFF" #cyan - echo -en "\e]PFffffff" #white [foreground] - clear #for background artifacting + echo -en "\e]P0111111" # black [background] + echo -en "\e]P1D84F4F" # darkred + echo -en "\e]P2DEFF3E" # darkgreen + echo -en "\e]P3FFDF23" # brown + echo -en "\e]P479AEFF" # darkblue + echo -en "\e]P58894CF" # darkmagenta + echo -en "\e]P679AEFF" # darkcyan + echo -en "\e]P7dddddd" # lightgray + echo -en "\e]P8DDDDDD" # darkgray + echo -en "\e]P9E84F4F" # red + echo -en "\e]PABEFF3E" # green + echo -en "\e]PBFEA63C" # yellow + echo -en "\e]PC69AEFF" # blue + echo -en "\e]PD9894CF" # magenta + echo -en "\e]PE69AEFF" # cyan + echo -en "\e]PFffffff" # white [foreground] + clear # for background artifacting fi # color man @@ -76,9 +79,8 @@ alias chmod='chmod --preserve-root' alias chgrp='chgrp --preserve-root' # general aliases -alias alsamixer='alsamixer -V all' +alias alsamixer='alsamixer --view all' alias archey3="archey3 --config=~/.config/archey3.cfg" -alias audacity='PULSE_LATENCY_MSEC=30 audacity' alias colortest='msgcat --color=test' alias dash='PS1="$ " dash' alias diceware='diceware -d " "' @@ -89,8 +91,8 @@ alias grep='grep --color=tty -d skip' alias locate='locate -ie' alias ls='ls -hN --color=always --group-directories-first' alias lsblk='lsblk -o NAME,MAJ:MIN,RM,SIZE,FSTYPE,RO,TYPE,MOUNTPOINT,MODEL' -alias lxc-attach='lxc-attach --clear-env -n' -alias lxc-ls='lxc-ls -f' +alias lxc-attach='lxc-attach --clear-env --name' +alias lxc-ls='lxc-ls --fancy' alias lynx='lynx -cfg ~/.config/lynx/lynx.cfg' alias mocp='mocp -M $XDG_CONFIG_HOME/moc' alias newsboat='newsboat -c $XDG_CONFIG_HOME/newsboat/cache.db -u $XDG_CONFIG_HOME/newsboat/urls -C $XDG_CONFIG_HOME/newsboat/config' @@ -101,30 +103,32 @@ alias rofi='rofi -cache-dir $XDG_DATA_HOME' alias sh='dash' alias tidy='tidy -config $HOME/.config/tidy.conf' alias units='units --history "$XDG_CACHE_HOME"/units_history' -alias wget='wget --hsts-file $HOME/.cache/wget.history' # nix helpers -nix-which() { readlink "$(type -P "$1")"; } +nix-which() { readlink --canonicalize "$(type -P "$1")"; } # lxc helpers -lxc-copy() { A=$1 && B=$2 && shift 2 && $(type -P lxc-copy) -an "$A" -N "$B" "$@"; } -lxc-restart() { $(type -P lxc-stop) -kn "$1"; $(type -P lxc-start) -n "$1"; } -lxc-start() { for container in "$@"; do $(type -P lxc-start) -n "$container"; done } -lxc-stop() { for container in "$@"; do $(type -P lxc-stop) -kn "$container"; done } -lxc-destroy() { for container in "$@"; do $(type -P lxc-destroy) -n "$container"; done } - -# source fzm -[ -f "$HOME/.config/fzf-marks/fzf-marks.plugin.bash" ] && . "$HOME/.config/fzf-marks/fzf-marks.plugin.bash" +lxc-copy() { A=$1 && B=$2 && shift 2 && $(type -P lxc-copy) --allowrunning --name "$A" -N "$B" "$@"; } +lxc-shell() { lxc-start "$1" > /dev/null 2>&1 && lxc-attach "$1" -- /bin/sh -c 'export HOME="/root" && . /etc/profile && /bin/sh'; } +lxc-restart() { $(type -P lxc-stop) --kill --name "$1"; $(type -P lxc-start) -n "$1"; } +lxc-start() { for container in "$@"; do $(type -P lxc-start) --name "$container"; done } +lxc-stop() { for container in "$@"; do $(type -P lxc-stop) --kill --name "$container"; done } +lxc-destroy() { for container in "$@"; do $(type -P lxc-destroy) --name "$container"; done } -# remove bash history duplicates -history-remove-duplicates() { awk '!visited[$0]++' "$HOME/.bash_history" | sponge "$HOME/.bash_history"; } +# source fzf markers +[ -f "$HOME/.config/fzf/marks.plugin.bash" ] && . "$HOME/.config/fzf/marks.plugin.bash" # extract docker container as rootfs -docker-rootfs() { id=$(docker run -d "$1" /bin/true) && docker export "$id" -o "$2.tar" && docker container rm "$id"; } +docker-rootfs() { id=$(docker run --detach "$1" /bin/true) \ + && docker export "$id" --output "rootfs.tar" \ + && docker container rm "$id" \ + && ls -l rootfs.tar; } -# https://til.simonwillison.net/bash/escaping-a-string -# press ctrl+d after writing string to standard input +# press ctrl+d after writing string to standard input (https://til.simonwillison.net/bash/escaping-a-string) shellquote() { printf '%q\n' "$(cat)"; } +# show window title of last command (https://stackoverflow.com/a/5080670) +trap 'echo -ne "\033]2;command: $PWD $(history 1 | sed "s/^[ ]*[0-9]*[ ]*//g")\007"' DEBUG + # swallow swallow() { "$@" & disown; exit; } diff --git a/.config/.guile b/.config/.guile new file mode 100644 index 0000000..9a74b00 --- /dev/null +++ b/.config/.guile @@ -0,0 +1,4 @@ +(use-modules + (ice-9 readline) + (oop goops)) +(activate-readline) diff --git a/.mozilla/firefox/installs.ini b/.config/.mozilla/firefox/installs.ini index 6a29302..6a29302 100644 --- a/.mozilla/firefox/installs.ini +++ b/.config/.mozilla/firefox/installs.ini diff --git a/.mozilla/firefox/profile.default/chrome/userChrome.css b/.config/.mozilla/firefox/profile.default/chrome/userChrome.css index c10d5a1..020512e 100644 --- a/.mozilla/firefox/profile.default/chrome/userChrome.css +++ b/.config/.mozilla/firefox/profile.default/chrome/userChrome.css @@ -23,31 +23,32 @@ /* * Reduce expanding urlbar. - * Source: https://raw.githubusercontent.com/WesleyBranton/userChrome.css-Customizations/master/css/remove_megabar.css + * Source: https://github.com/WesleyBranton/Remove-Firefox-Megabar#readme */ + +/* Disable expanding urlbar (compact). */ @-moz-document url(chrome://browser/content/browser.xhtml) { #urlbar[breakout][breakout-extend] > #urlbar-input-container, #urlbar-input-container { - height: var(--urlbar-height) !important; - padding-block: 0px !important; - padding-inline: 0px !important; - transition: none !important; - border-radius: var(--toolbarbutton-border-radius) !important; + height: 26px !important; + padding-block: 0px !important; + padding-inline: 0px !important; + transition: none !important; + border-radius: var(--toolbarbutton-border-radius) !important; } #urlbar[breakout][breakout-extend] { - top: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2) !important; - left: 0 !important; - width: 100% !important; + top: calc((var(--urlbar-toolbar-height) - var(--urlbar-height)) / 2) !important; + left: 0 !important; + width: 100% !important; } #urlbar[breakout][breakout-extend] > #urlbar-input-container { - border: 1px solid var(--toolbar-field-focus-border-color) !important; + border: 1px solid var(--toolbar-field-focus-border-color) !important; } #urlbar[breakout][breakout-extend][open] > #urlbar-input-container { - border-bottom: 1px solid transparent !important; - border-radius: var(--toolbarbutton-border-radius) var(--toolbarbutton-border-radius) 0 0 !important; + border-bottom: 1px solid transparent !important; + border-radius: var(--toolbarbutton-border-radius) var(--toolbarbutton-border-radius) 0 0 !important; } } - diff --git a/.mozilla/firefox/profile.default/user.js b/.config/.mozilla/firefox/profile.default/user.js index 07cb8f7..704cf17 100644 --- a/.mozilla/firefox/profile.default/user.js +++ b/.config/.mozilla/firefox/profile.default/user.js @@ -9,21 +9,30 @@ user_pref("app.update.auto", false); user_pref("beacon.enabled", false); user_pref("breakpad.reportURL", ""); -user_pref("browser.aboutConfig.showWarning", false); -user_pref("browser.cache.disk.enable", false); +user_pref("browser.aboutConfig.showWarning", false); // Disable about:config warning +user_pref("browser.discovery.enabled", false); // Disable extension recommendations +user_pref("browser.fixup.alternate.enabled", false); // Disable URL fixing +user_pref("browser.formfill.enable", false); // Disable form history +user_pref("browser.pocket.enabled", false); // Disable pocket +user_pref("browser.privatebrowsing.forceMediaMemoryCache", true); // Memory only private browsing media cache +user_pref("browser.startup.homepage", "about:blank"); // Set home page to about:blank + +user_pref("browser.cache.disk.enable", false); // Disable disk cache user_pref("browser.cache.disk_cache_ssl", false); -user_pref("browser.cache.memory.capacity", 30); +user_pref("browser.cache.memory.capacity", 25600); user_pref("browser.cache.offline.enable", false); +user_pref("browser.download.alwaysOpenPanel", false); // Disable opening panel on download +user_pref("browser.download.always_ask_before_handling_new_types", true); // Always ask for new mime types +user_pref("browser.download.animateNotifications", false); // Disable download animations +user_pref("browser.download.manager.addToRecentDocs", false); // Disable adding download to recent list +user_pref("browser.download.useDownloadDir", false); // Always ask where to save download + user_pref("browser.crashReports.unsubmittedCheck.autoSubmit", false); user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); user_pref("browser.crashReports.unsubmittedCheck.enabled", false); -user_pref("browser.discovery.enabled", false); -user_pref("browser.download.animateNotifications", false); -user_pref("browser.fixup.alternate.enabled", false); - user_pref("browser.newtab.preload", false); user_pref("browser.newtabpage.enabled", false); user_pref("browser.newtabpage.enhanced", false); @@ -41,9 +50,6 @@ user_pref("browser.newtabpage.activity-stream.section.highlights.includeVisited" user_pref("browser.newtabpage.activity-stream.section.highlights.includeBookmarks", false); user_pref("browser.newtabpage.activity-stream.section.highlights.includeDownloads", false); -user_pref("browser.pocket.enabled", false); -user_pref("browser.startup.homepage", "about:blank"); - user_pref("browser.safebrowsing.appRepURL", ""); user_pref("browser.safebrowsing.blockedURIs.enabled", false); user_pref("browser.safebrowsing.downloads.enabled", false); @@ -65,20 +71,25 @@ user_pref("browser.selfsupport.url", ""); user_pref("browser.disableResetPrompt", true); user_pref("browser.shell.checkDefaultBrowser", false); user_pref("browser.send_pings.require_same_host", true); -user_pref("browser.startup.homepage_override.mstone", "ignore"); +user_pref("browser.startup.homepage_override.mstone", "ignore"); // Disable welcome screen +user_pref("browser.messaging-system.whatsNewPanel.enabled", false); // Disable what's new panel user_pref("browser.sessionstore.privacy_level", 2); user_pref("browser.sessionhistory.max_entries", 20); user_pref("browser.tabs.crashReporting.sendReport", false); -user_pref("browser.urlbar.trimURLs", false); user_pref("browser.urlbar.maxRichResults", 0); -user_pref("browser.urlbar.suggest.history", false); +user_pref("browser.urlbar.searchSuggestionsChoice", false); +user_pref("browser.urlbar.showSearchTerms.enabled", false); // Always show URL +user_pref("browser.urlbar.speculativeConnect.enabled", false); user_pref("browser.urlbar.suggest.bookmark", false); +user_pref("browser.urlbar.suggest.engines", false); +user_pref("browser.urlbar.suggest.history", false); user_pref("browser.urlbar.suggest.openpage", false); user_pref("browser.urlbar.suggest.searches", false); -user_pref("browser.urlbar.searchSuggestionsChoice", false); -user_pref("browser.urlbar.speculativeConnect.enabled", false); +user_pref("browser.urlbar.suggest.topsites", false); +user_pref("browser.urlbar.showSearchSuggestionsFirst", false); user_pref("browser.urlbar.timesBeforeHidingSuggestionsHint", 0); +user_pref("browser.urlbar.trimURLs", false); user_pref("datareporting.healthreport.service.enabled", false); user_pref("datareporting.healthreport.uploadEnabled", false); @@ -103,10 +114,12 @@ user_pref("dom.battery.enabled", false); user_pref("dom.event.clipboardevents.enabled", false); user_pref("dom.event.contextmenu.enabled", false); user_pref("dom.maxHardwareConcurrency", 2); +user_pref("dom.popup_allowed_events", ""); user_pref("dom.webnotifications.enabled", false); user_pref("extensions.getAddons.cache.enabled", false); -user_pref("extensions.getAddons.showPane", false); +user_pref("extensions.getAddons.showPane", false); // Disable recommendations pane +user_pref("extensions.htmlaboutaddons.recommendations.enabled", false); // Disable addons recommendations user_pref("extensions.pocket.enabled", false); user_pref("extensions.screenshots.upload-disabled", true); user_pref("extensions.shield-recipe-client.api_url", ""); @@ -121,7 +134,7 @@ user_pref("experiments.activeExperiment", false); user_pref("geo.enabled", false); user_pref("gfx.webrender.all", true); user_pref("javascript.options.mem.max", 51200); -user_pref("layout.css.visited_links_enabled", false); +user_pref("layout.css.visited_links_enabled", false); // Disable visited links user_pref("media.autoplay.default", 1); user_pref("media.ffvpx.enabled", false); @@ -130,7 +143,9 @@ user_pref("media.ffmpeg.vaapi.enabled", true); user_pref("media.ffmpeg.dmabuf-textures.enabled", true); user_pref("network.IDN_show_punycode", true); +user_pref("network.allow-experiments", false); user_pref("network.captive-portal-service.enabled", false); +user_pref("network.connectivity-service.enabled", false); // Disable network connectivity check user_pref("network.cookie.cookieBehavior", 1); user_pref("network.cookie.lifetimePolicy", 2); user_pref("network.cookie.thirdparty.sessionOnly", true); @@ -138,15 +153,14 @@ user_pref("network.dns.disableIPv6", true); user_pref("network.dns.disablePrefetch", true); user_pref("network.dns.disablePrefetchFromHTTPS", true); user_pref("network.dnsCacheEntries", 0); -user_pref("network.trr.mode", 5); -user_pref("network.prefetch-next", false); -user_pref("network.allow-experiments", false); -user_pref("network.predictor.enabled", false); -user_pref("network.predictor.cleaned-up", true); -user_pref("network.proxy.socks_remote_dns", true); user_pref("network.http.referer.spoofSource", true); -user_pref("network.predictor.enable-prefetch", false); user_pref("network.http.speculative-parallel-limit", 0); +user_pref("network.predictor.cleaned-up", true); +user_pref("network.predictor.enable-prefetch", false); +user_pref("network.predictor.enabled", false); +user_pref("network.prefetch-next", false); +user_pref("network.proxy.socks_remote_dns", true); // Use proxy for DNS +user_pref("network.trr.mode", 5); user_pref("security.OCSP.enabled", 0); user_pref("security.ssl.disable_session_identifiers", true); @@ -169,15 +183,25 @@ user_pref("toolkit.telemetry.updatePing.enabled", false); user_pref("signon.autofillForms", false); user_pref("signon.generation.enabled", false); +user_pref("signon.firefoxRelay.feature", "disabled"); // Disable relay email masks + +user_pref("extensions.formautofill.addresses.enabled", false); +user_pref("extensions.formautofill.creditCards.enabled", false); -user_pref("privacy.donottrackheader.value", 1); user_pref("privacy.donottrackheader.enabled", true); -user_pref("privacy.trackingprotection.enabled", true); -user_pref("privacy.trackingprotection.pbmode.enabled", true); +user_pref("privacy.donottrackheader.value", 1); user_pref("privacy.trackingprotection.cryptomining.enabled", true); +user_pref("privacy.trackingprotection.enabled", true); user_pref("privacy.trackingprotection.fingerprinting.enabled", true); +user_pref("privacy.trackingprotection.pbmode.enabled", true); user_pref("privacy.usercontext.about_newtab_segregation.enabled", true); +user_pref("privacy.clearOnShutdown.cache", true); // Clear cache on shutdown +user_pref("privacy.clearOnShutdown.cookies", true); // Clear cookies on shutdown +user_pref("privacy.clearOnShutdown.formdata", true); // Clear form data on shutdown +user_pref("privacy.clearOnShutdown.offlineApps", true); // Clear offline website data on shutdown +user_pref("privacy.clearOnShutdown.sessions", true); // Clear active logins on shutdown + user_pref("webgl.disable-extensions", true); user_pref("webgl.disabled", true); user_pref("webgl.renderer-string-override", " "); diff --git a/.mozilla/firefox/profiles.ini b/.config/.mozilla/firefox/profiles.ini index 6d12032..6d12032 100644 --- a/.mozilla/firefox/profiles.ini +++ b/.config/.mozilla/firefox/profiles.ini diff --git a/.config/.themes b/.config/.themes new file mode 120000 index 0000000..62fc878 --- /dev/null +++ b/.config/.themes @@ -0,0 +1 @@ +../.local/share/themes
\ No newline at end of file diff --git a/.config/VSCodium/User/settings.json b/.config/VSCodium/User/settings.json new file mode 100644 index 0000000..7040482 --- /dev/null +++ b/.config/VSCodium/User/settings.json @@ -0,0 +1,8 @@ +{ + "workbench.startupEditor": "none", + "update.mode": "none", + "window.menuBarVisibility": "toggle", + "update.showReleaseNotes": false, + "extensions.autoCheckUpdates": false, + "extensions.autoUpdate": false +}
\ No newline at end of file diff --git a/.config/X11/Xresources b/.config/X11/Xresources index 375087d..e951b1e 100644 --- a/.config/X11/Xresources +++ b/.config/X11/Xresources @@ -2,114 +2,116 @@ ! URxvt Settings ! ----------------- -URxvt.perl-ext-common: default,matcher,font-size,vtwheel,keyboard-select +URxvt.cursorBlink: 1 +URxvt.cursorUnderline: 0 +URxvt.geometry: 80x18 +URxvt.internalBorder: 10 +URxvt.keysym.C-0: perl:font-size:reset +URxvt.keysym.C-Down: perl:font-size:decrease +URxvt.keysym.C-Up: perl:font-size:increase +URxvt.keysym.M-Escape: perl:keyboard-select:activate +URxvt.matcher.button: 1 +URxvt.perl-ext-common: default,matcher,font-size,vtwheel,url-select,keyboard-select +URxvt.scrollBar: false +URxvt.scrollTtyKeypress: true +URxvt.scrollTtyOutput: false +URxvt.scrollWithBuffer: true +URxvt.shading: 20 +URxvt.transparent: false +URxvt.url-launcher: /usr/bin/env xdg-open +URxvt.url-select.launcher: /usr/bin/env xdg-open + +URxvt.boldFont: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 +URxvt.boldItalicFont: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 +URxvt.font: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 +URxvt.italicFont: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 -URxvt.url-launcher: /usr/bin/env firefox -URxvt.url-select.launcher: /usr/bin/env firefox -URxvt.keysym.M-Escape: perl:keyboard-select:activate - -URxvt.matcher.button: 1 -URxvt.internalBorder: 10 -URxvt.geometry: 74x18 - -URxvt.cursorUnderline: 0 -URxvt.cursorBlink: 1 -URxvt.cursorColor: #69AEFF - -URxvt*font: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 -URxvt.boldFont: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 -URxvt.italicFont: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 -URxvt.boldItalicFont: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 - -URxvt.keysym.C-0: perl:font-size:reset -URxvt.keysym.C-Up: perl:font-size:increase -URxvt.keysym.C-Down: perl:font-size:decrease - -URxvt.scrollBar: false -URxvt.scrollTtyOutput: false -URxvt.scrollWithBuffer: true -URxvt.scrollTtyKeypress: true - -URxvt.transparent: false -URxvt.shading: 20 +! ----------------- +! UXTerm Settings +! ----------------- -URxvt.foreground: #FFFFFF -URxvt.background: #2C303C -URxvt.colorUL: #66A9B9 +UXTerm.termName: xterm-256color +UXTerm.ttyModes: erase ^? +UXTerm.vt100.backarrowKey: false +UXTerm.vt100.cursorBlink: true +UXTerm.vt100.faceName: xft:monospace:size=10,xft:DejaVuSansMono Nerd Font Mono:size=10 +UXTerm.vt100.fastScroll: true +UXTerm.vt100.geometry: 80x18 +UXTerm.vt100.internalBorder: 10 +UXTerm.vt100.jumpScroll: true +UXTerm.vt100.locale: false +UXTerm.vt100.metaSendsEscape: true +UXTerm.vt100.multiScroll: true +UXTerm.vt100.saveLines: 4096 +UXTerm.vt100.utf8: true ! ----------------- ! Terminal Colors ! ----------------- +*colorUL: #8fc1ff +*cursorColor: #69aeff + +*foreground: #ffffff +*background: #2c303c + !black -*color0: #2C303C -*color8: #666666 +*color0: #2c303c +*color8: #999999 !red -*color1: #E84F4F -*color9: #FF3838 +*color1: #ed7373 +*color9: #ff6666 !green -*color2: #BEFF3E -*color10: #CFFF72 +*color2: #beff3e +*color10: #cfff72 !yellow -*color3: #FEA63C -*color11: #FFDF23 +*color3: #feac48 +*color11: #ffdf23 !blue -*color4: #69AEFF -*color12: #5AA5FF +*color4: #80c6ff +*color12: #5aa5ff !magenta -*color5: #B7416E -*color13: #E16A98 +*color5: #b7416e +*color13: #e16a98 !cyan -*color6: #69AEFF -*color14: #8B8B8B +*color6: #69aeff +*color14: #9fc1dd !white -*color7: #FFFFFF -*color15: #FFFFFF +*color7: #eeeeee +*color15: #ffffff ! ----------------- ! Font Settings ! ----------------- -Xft.autohint: 0 +Xft.autohint: 0 Xft.antialias: 1 -Xft.hinting: 1 +Xft.hinting: 1 +Xft.dpi: 96 +Xft.rgba: rgb Xft.hintstyle: hintslight -Xft.dpi: 96 -Xft.rgba: rgb Xft.lcdfilter: lcddefault ! ----------------- -! ROFI Settings -! ----------------- - -rofi.bw: 0 -rofi.color-enabled: true -rofi.hide-scrollbar: true -rofi.separator-style: none -rofi.disable-history: false -rofi.fake-transparency: false - -rofi.color-window: argb:cc222222, #FAC863, #FAC863 -rofi.color-normal: argb:00000000, #FFFFFF, argb:00000000, #FAC863, #1B2B34 -rofi.color-active: argb:00000000, #FFFFFF, argb:00000000, #6699CC, #1B2B34 -rofi.color-urgent: argb:00000000, #F99157, argb:00000000, #F99157, #1B2B34 - -! ----------------- ! DMENU Settings ! ----------------- -dmenu.background: #000000 -dmenu.foreground: #ffffff -dmenu.selforeground: #000000 -dmenu.selbackground: #1b99ec -dmenu.font: xft:Sans:size=9:style=bold +dmenu.font: xft:Sans:size=10:style=bold +dmenu.foreground: #80c6ff +dmenu.selforeground: #75c277 +dmenu.selhiforeground: #ffffff +dmenu.normhiforeground: #75c277 +dmenu.background: #111111 +dmenu.selbackground: #111111 +dmenu.selhibackground: #111111 +dmenu.normhibackground: #111111 ! ----------------- ! X Settings diff --git a/.config/X11/xbindkeysrc b/.config/X11/xbindkeysrc new file mode 100644 index 0000000..a8605fe --- /dev/null +++ b/.config/X11/xbindkeysrc @@ -0,0 +1,107 @@ +# quake terminal +"dropdown-terminal" + Mod4 + q + +# program launcher +"dmenu_run_history" + Mod4 + r + +# privilege launcher +"dmenu_run_history privilege" + Mod4 + e + +# terminal launcher +"dmenu_run_history terminal" + Mod4 + w + +# zoom application +"sh -c 'notify-send Zoom && boomer'" + Mod4 + x + +# close active window +"wmctrl -c :ACTIVE:" + Mod4 + Shift + c + +# toggle ontop active window +"wmctrl -r :ACTIVE: -b toggle,above" + Mod4 + t + +# show bookmarks +"bookmarks show $HOME/Shares/Projects/bookmarks/archives/bookmarks-old.html" + Mod4 + g + +# clipboard toggle +"clipboard" + Mod4 + z + +# text plumber +"plumber-dmenu" + Mod4 + i + +# pass menu +"pass-menu" + Mod4 + d + +# file search +"file-search" + Mod4 + p + +# window switcher +"window-switcher" + Alt + Tab + +# window overview +"window-overview" + Mod4 + Tab + +# file search +"internet-search" + Mod4 + a + +# volume up +"volume-control up" + XF86AudioRaiseVolume + +# volume down +"volume-control down" + XF86AudioLowerVolume + +# volume mute +"volume-control mute" + XF86AudioMute + +# lock screen +"lockscreen" + XF86ScreenSaver + +# snipping tool +"snipping-tool" + Print + +# switch monitor +"switch-monitor" + XF86Display + +# screen record +"peek" + Alt + Print + +# flameshot screenshots +"flameshot gui" + Control + Print + +# shortcut key check +"urxvt -hold -e xbindkeys --multikey -f $HOME/.config/xbindkeysrc" + Shift + Mod4 + b + +# terminal +"urxvt" + Mod4 + Return + +# terminal tabbed +"urxvt -pe tabbed" + Control + Mod4 + Return + +# terminal multiplexer +"urxvt -e tmux attach" + Alt + Mod4 + Return diff --git a/.config/X11/xinitrc b/.config/X11/xinitrc index 302b56e..18e09b9 100644..100755 --- a/.config/X11/xinitrc +++ b/.config/X11/xinitrc @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/sh -eu -userresources=$HOME/.config/X11/Xresources -usermodmap=$HOME/.config/X11/Xmodmap +Xmodmap=$HOME/.config/X11/Xmodmap +Xresources=$HOME/.config/X11/Xresources +Xauthority=$HOME/.config/X11/Xauthority # merge in defaults and keymaps -[ -f "$userresources" ] && xrdb -merge "$userresources"; -[ -f "$usermodmap" ] && xmodmap "$usermodmap"; +[ -f "$Xmodmap" ] && xmodmap "$Xmodmap"; +[ -f "$Xresources" ] && xrdb -merge "$Xresources"; # screen timeouts xset s 0 0 & @@ -17,11 +18,8 @@ xsetroot -cursor_name left_ptr; # set keypress repeat xset r rate 200 60; -# generate xauth -xauth generate :0 . trusted; - # import systemctl environment systemctl --user import-environment; -# Run awesome -exec awesome --no-argb; +# run desktop +dbus-launch xfce4-session || exec awesome --no-argb; diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..524965e --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,5 @@ +--- +window: + padding: + x: 15 + y: 15 diff --git a/.config/aspell/aspell.conf b/.config/aspell/aspell.conf new file mode 100644 index 0000000..47eb382 --- /dev/null +++ b/.config/aspell/aspell.conf @@ -0,0 +1 @@ +data-dir /home/thedro/.nix-profile/lib/aspell diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index b970f7b..85221b5 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -1,244 +1,176 @@ --- Standard awesome library -local gears = require("gears") -local awful = require("awful") -require("awful.autofocus") --- Widget and layout library -local wibox = require("wibox") --- Theme handling library -local beautiful = require("beautiful") --- Notification library -local naughty = require("naughty") -local menubar = require("menubar") --- Disable window edge snapping -awful.mouse.snap.edge_enabled = false +local gears = require("gears") -- Gears module. +local awful = require("awful") -- Awful module. +local wibox = require("wibox") -- Wibox module. +local beautiful = require("beautiful") -- Theme module. +local naughty = require("naughty") -- Notification module. +local menubar = require("menubar") -- Menu bar module. + +require("awful.autofocus") -- Enable autofocus. +awful.mouse.snap.edge_enabled = false -- Disable window edge snapping. +awesome.font = ("FontAwesome 9") -- Set font. + -- Naughty notification presets -naughty.config.defaults.icon_size = 32 -naughty.config.defaults.border_width = 2 +naughty.config.defaults.font = 'Monospace Bold 9' +naughty.config.defaults.icon_size = 32 +naughty.config.defaults.fg = '#ffffff' +naughty.config.defaults.bg = '#222222' +naughty.config.presets.critical.fg = '#000000' +naughty.config.presets.critical.bg = '#FF0000' naughty.config.defaults.border_color = '#000000' -naughty.config.defaults.fg = '#ffffff' -naughty.config.defaults.bg = '#222222' -naughty.config.presets.critical.fg = '#000000' -naughty.config.presets.critical.bg = '#FF0000' -naughty.config.defaults.font = 'Monospace Bold 9' --- Vicious library -local vicious = require("vicious") --- Lain library -local lain = require("lain") --- Set font -awesome.font = ("FontAwesome 9") +naughty.config.defaults.border_width = 2 + -- Startup --- os.execute("sleep 1 && i3lock-fancy -t '' -- scrot &") +-- awful.spawn.with_shell("sleep 1 && i3lock-fancy -t ''") --- {{{ Error handling --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) +-- Error handling if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) + naughty.notify({ + preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors + }) end -- Handle runtime errors after startup do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = tostring(err) }) - in_error = false - end) + local in_error = false + awesome.connect_signal("debug::error", function (err) + if in_error then return end + in_error = true + + naughty.notify({ + preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) + }) + in_error = false + end) end --- }}} --- {{{ Variable definitions +-- Variable definitions modkey = "Mod4" -terminal = "urxvt" -editor = os.getenv("EDITOR") or "nano" +terminal = os.getenv("TERMINAL") or "urxvt" +editor = os.getenv("EDITOR") or "vim" editor_cmd = terminal .. " -e " .. editor beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua") +-- Layouts awful.layout.layouts = { - awful.layout.suit.floating, - awful.layout.suit.tile, - awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, - awful.layout.suit.tile.top, - awful.layout.suit.fair, - awful.layout.suit.fair.horizontal, - awful.layout.suit.spiral, - awful.layout.suit.spiral.dwindle, - -- awful.layout.suit.max, - -- awful.layout.suit.max.fullscreen, - -- awful.layout.suit.magnifier, - awful.layout.suit.corner.nw, - awful.layout.suit.corner.ne, - awful.layout.suit.corner.sw, - awful.layout.suit.corner.se, + awful.layout.suit.floating, + awful.layout.suit.tile, + awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile.top, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.magnifier, + awful.layout.suit.corner.nw, + awful.layout.suit.corner.ne, + awful.layout.suit.corner.sw, + awful.layout.suit.corner.se, } --- }}} --- {{{ Helper functions +-- Helper functions local function client_menu_toggle_fn() - local instance = nil - - return function () - if instance and instance.wibox.visible then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ theme = { width = 250 } }) - end + local instance = nil + return function () + if instance and instance.wibox.visible then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ theme = { width = 250 } }) end + end end --- }}} - --- {{{ Menu - --- Menubar configuration -menubar.utils.terminal = terminal -- Set the terminal for applications that require it --- }}} - --- Keyboard map indicator and switcher -mykeyboardlayout = awful.widget.keyboardlayout() - --- {{{ Wibar - --- Create bat widget -batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, " $1$2%", 1, "C23B") - --- Create cpu widget -cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, ' $1% ⇆ $2%' , 2) - --- Create memory widget -memwidget = wibox.widget.textbox() -vicious.register(memwidget, vicious.widgets.mem, ' $4 mB', 5) - --- Create swap widget -swapwidget = wibox.widget.textbox() -vicious.register(swapwidget, vicious.widgets.mem, ' $8 mB', 5) - --- Create network wifi widget -netwidgetwifi = wibox.widget.textbox() -vicious.register(netwidgetwifi, vicious.widgets.net, ' ${wifi down_kb} kB ${wifi up_kb} kB', 3) --- Create network net widget -netwidgetnet = wibox.widget.textbox() -vicious.register(netwidgetnet, vicious.widgets.net, ' ${net down_kb} kB ${net up_kb} kB', 2) - --- Create separator widget -separator = wibox.widget.textbox() -separator:set_text(" ") - --- Create a textdate widget -mytextdate = awful.widget.textclock(" %a %b %d ", 1) - --- Create a textclock widget -mytextclock = wibox.widget.textclock(" %I:%M %p", 1) +-- Widgets configuration +menubar.utils.terminal = terminal -- Set the terminal for applications that require it. + +widget_memory = awful.widget.watch('sh -c "printf \' \' && free --giga -h | awk \'FNR == 2 { print $7 }\'"', 3) -- Create memory widget. +widget_swap = awful.widget.watch('sh -c "printf \' \' && free --giga -h | awk \'FNR == 3 { print $4 }\'"', 4) -- Create swap widget. +widget_battery = awful.widget.watch('sh -c "printf \' \' && acpi --battery 2>&1 | awk -F, \'{ print $2 }\'"', 5) -- Create battery widget. +widget_date = awful.widget.watch('sh -c "printf \' \' && date \'+%H:%M %a %b %d\'"', 1) -- Create date widget. +widget_loadaverage = awful.widget.watch('sh -c "printf \' \' && cat /proc/loadavg | awk -v OFS=\' \' \'{ print $1, $2, $3 }\'"', 5) -- Create load average widget. +widget_temperature = awful.widget.watch('sh -c "printf \' \' && sensors | awk \'/Core 0:/ { print $3 }\' | head -n1"', 5) -- Create temperature widget. +widget_traffic_down = awful.widget.watch( + 'sh -c "printf \' \'' .. + ' && vnstat -tr 2 -i $(ip addr | awk \'/state UP/ { print $2; exit }\' | sed \'s/.$//\') | awk \'/rx/ { print $2, $3 }\'"', 5) -- Create download traffic widget. +widget_traffic_up = awful.widget.watch( + 'sh -c "printf \' \'' .. + ' && vnstat -tr 2 -i $(ip addr | awk \'/state UP/ { print $2; exit }\' | sed \'s/.$//\') | awk \'/tx/ { print $2, $3 }\'"', 5) -- Create upload traffic widget. +widget_separator = wibox.widget.textbox() widget_separator:set_text(" ") -- Create separator widget. + +-- Tooltips +local function tooltip(widget, execute) + local tooltip = awful.tooltip({ margins_leftright = 15 }) tooltip:add_to_object(widget) + widget:connect_signal("mouse::enter", function() + awful.spawn.easy_async_with_shell(execute, function(stdout, stderr, reason, exit_code) tooltip.text = stdout end) + end) +end --- Attach Lain Calendar Widget -lain.widget.cal({ - attach_to = { mytextdate, mytextclock }, - notification_preset = { font = "Monospace Bold 10", fg = "#FFFFFF", bg = "#222222" }, - cal = "/usr/bin/cal --color=always" -}) +-- tooltip(widget_loadaverage, 'uptime') +-- tooltip(widget_temperature, 'sensors | grep -v \'+0.0°C\'') +-- tooltip(widget_battery, 'acpi -abi 2>&1') +-- tooltip(widget_date, 'cal --color=never') +-- tooltip(widget_memory, 'free --giga -h -t') --- Create a wibox for each screen and add it -mywibox = {} +-- Create wibox +mywibox = {} mypromptbox = {} mylayoutbox = {} -mytaglist = {} -mytaglist.buttons = awful.util.table.join( - awful.button({ }, 1, function(t) t:view_only() end), - awful.button({ modkey }, 1, function(t) - if client.focus then - client.focus:move_to_tag(t) - end - end), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, function(t) - if client.focus then - client.focus:toggle_tag(t) - end - end) - ) +mytaglist = {} +mytaglist.buttons = awful.util.table.join(awful.button({}, 1, function(t) t:view_only() end)) + +-- Set wallpaper function. local function set_wallpaper(s) - -- Wallpaper - if beautiful.wallpaper then - local wallpaper = beautiful.wallpaper - -- If wallpaper is a function, call it with the screen - if type(wallpaper) == "function" then - wallpaper = wallpaper(s) - end - gears.wallpaper.maximized(wallpaper, s, true) + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) end + gears.wallpaper.maximized(wallpaper, s, true) + end end --- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) -screen.connect_signal("property::geometry", set_wallpaper) +screen.connect_signal("property::geometry", set_wallpaper) -- Reset wallpaper on screen geometry changes. awful.screen.connect_for_each_screen(function(s) - -- Wallpaper - set_wallpaper(s) - - -- Each screen has its own tag table. - awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }, s, awful.layout.layouts[1]) - - -- Create a promptbox for each screen - mypromptbox[s] = awful.widget.prompt() - -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- We need one layoutbox per screen. - mylayoutbox[s] = awful.widget.layoutbox(s) - -- mylayoutbox[s]:buttons(gears.table.join( - -- awful.button({ }, 1, function () awful.layout.inc( 1) end), - -- awful.button({ }, 3, function () awful.layout.inc(-1) end), - -- awful.button({ }, 4, function () awful.layout.inc( 1) end), - -- awful.button({ }, 5, function () awful.layout.inc(-1) end))) - -- Create a taglist widget - mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) - - -- Create a tasklist widget - -- mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - - -- Create the wibox - mywibox[s] = awful.wibar({ position = "top", ontop = true, height = "18", screen = s }) - - -- Quake style drop down terminal - s.quake = lain.util.quake({ app = "urxvt -pe tabbed", width = 0.75, height = 0.33, horiz = "center", vert = "bottom", border=2 }) - - -- Widgets that are aligned to the left + + set_wallpaper(s) -- Set wallpaper. + awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }, s, awful.layout.layouts[1]) -- Create tag table for each screen. + mylayoutbox[s] = awful.widget.layoutbox(s) -- Create layout box. + mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) -- Create a taglist widget. + mywibox[s] = awful.wibar({ position = "top", ontop = true, height = "18", screen = s }) -- Create the wibox. + + -- Left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(mytaglist[s]) - left_layout:add(separator) + left_layout:add(widget_separator) left_layout:add(mylayoutbox[s]) - left_layout:add(separator) - -- left_layout:add(mypromptbox[s]) - -- left_layout:add(separator) - left_layout:add(netwidgetwifi) - left_layout:add(separator) - left_layout:add(netwidgetnet) - left_layout:add(separator) - left_layout:add(cpuwidget) - - -- Widgets that are aligned to the right + left_layout:add(widget_separator) + left_layout:add(widget_traffic_down) + left_layout:add(widget_separator) + left_layout:add(widget_traffic_up) + left_layout:add(widget_separator) + left_layout:add(widget_loadaverage) + left_layout:add(widget_separator) + left_layout:add(widget_temperature) + + -- Right local right_layout = wibox.layout.fixed.horizontal() - -- if s == 1 then right_layout:add(wibox.widget.systray()) end - right_layout:add(separator) - right_layout:add(memwidget) - right_layout:add(separator) - right_layout:add(swapwidget) - right_layout:add(separator) - right_layout:add(batwidget) - right_layout:add(separator) - right_layout:add(mytextclock) - right_layout:add(separator) - right_layout:add(mytextdate) + right_layout:add(widget_separator) + right_layout:add(widget_memory) + right_layout:add(widget_separator) + right_layout:add(widget_swap) + right_layout:add(widget_separator) + right_layout:add(widget_battery) + right_layout:add(widget_separator) + right_layout:add(widget_date) + right_layout:add(widget_separator) -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() @@ -246,178 +178,115 @@ awful.screen.connect_for_each_screen(function(s) layout:set_right(right_layout) mywibox[s]:set_widget(layout) end) --- }}} --- {{{ Key bindings +-- Global Key bindings globalkeys = gears.table.join( - - -- General bindings - awful.key({ modkey, "Shift" }, "q", awesome.restart), -- Restart - awful.key({ modkey, }, "[", awful.tag.viewprev), -- Show previous tag - awful.key({ modkey, }, "]", awful.tag.viewnext), -- Show next tag - awful.key({ modkey, }, "Escape", awful.tag.history.restore), -- Show last visited tag - - -- Layout manipulation - awful.key({ modkey, }, "u", awful.client.urgent.jumpto), -- Jump to urgent client - awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end), -- Show previous window - awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end), -- Show next window - awful.key({ modkey, }, "q", function () awful.screen.focused().quake:toggle() end), -- Toggle quake terminal - awful.key({ modkey, "Shift" }, "k", function () awful.screen.focus_relative(-1) end), -- Focus previous screen - awful.key({ modkey, "Shift" }, "j", function () awful.screen.focus_relative( 1) end), -- Focus next screen - - -- Standard program - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), -- Increase tiling window size left - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), -- Increase tiling window size right - awful.key({ modkey, "Shift" }, "[", function () awful.layout.inc(-1) end), -- Switch layout previous - awful.key({ modkey, "Shift" }, "]", function () awful.layout.inc( 1) end), -- Switch layout next - - -- Show hide wibar - awful.key({ modkey, }, "b", function () mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible end), - - -- Restore minimized group - awful.key({ modkey, "Control" }, "n", - function () - local c = awful.client.restore() - if c then - client.focus = c - c:raise() - end - end) - - -- awful.key({ modkey }, "x", function () - -- awful.prompt.run({ prompt = "Run Lua code: " }, - -- mypromptbox[mouse.screen].widget, - -- awful.util.eval, nil, - -- awful.util.getdir("cache") .. "/history_eval") - -- end) + awful.key({ modkey, }, "Escape", awful.tag.history.restore), -- Show last visited tag + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), -- Jump to urgent client + + awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end), -- Show next window + awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end), -- Show previous window + awful.key({ modkey, }, "h", awful.tag.viewprev), -- Show previous tag + awful.key({ modkey, }, "l", awful.tag.viewnext), -- Show next tag + + awful.key({ modkey, "Shift" }, "j", function () awful.screen.focus_relative( 1) end), -- Focus next screen + awful.key({ modkey, "Shift" }, "k", function () awful.screen.focus_relative(-1) end), -- Focus previous screen + awful.key({ modkey, "Shift" }, "h", function () awful.layout.inc(-1) end), -- Switch layout previous + awful.key({ modkey, "Shift" }, "l", function () awful.layout.inc( 1) end), -- Switch layout next + + awful.key({ modkey, "Mod1" }, "h", function () awful.tag.incmwfact(-0.05) end), -- Increase tiling window size left + awful.key({ modkey, "Mod1" }, "l", function () awful.tag.incmwfact( 0.05) end), -- Increase tiling window size right + awful.key({ modkey, }, "b", function () mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible end), -- Show hide wibar + awful.key({ modkey, "Control" }, "n", function () local c = awful.client.restore() if c then client.focus = c c:raise() end end) -- Restore minimized group ) +-- Client Key bindings clientkeys = gears.table.join( - awful.key({ modkey, "Control" }, "m", lain.util.magnify_client), -- Lain magnify - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), -- Move to master - awful.key({ modkey, }, "o", function (c) c:move_to_screen() end), -- Move to screen - awful.key({ modkey, }, "m", function (c) c.maximized = not c.maximized c:raise() end), -- Maximize window - awful.key({ modkey, }, "s", awful.client.floating.toggle) -- Toggle floating mode + awful.key({ modkey, }, "s", awful.client.floating.toggle), -- Toggle floating mode + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), -- Move to master + awful.key({ modkey, }, "o", function (c) c:move_to_screen() end), -- Move to screen + awful.key({ modkey, }, "m", function (c) c.maximized = not c.maximized c:raise() end), -- Maximize window + + awful.key({ modkey, "Control" }, "k", function(c) c.y = c.y - 1 end), -- Move focused window up one pixel. + awful.key({ modkey, "Control" }, "j", function(c) c.y = c.y + 1 end), -- Move focused window down one pixel. + awful.key({ modkey, "Control" }, "h", function(c) c.x = c.x - 1 end), -- Move focused window left one pixel. + awful.key({ modkey, "Control" }, "l", function(c) c.x = c.x + 1 end), -- Move focused window right one pixel. + + awful.key({ modkey, "#49" }, "k", function(c) c.y = c.y - 10 end), -- Move focused window up fast. + awful.key({ modkey, "#49" }, "j", function(c) c.y = c.y + 10 end), -- Move focused window down fast. + awful.key({ modkey, "#49" }, "h", function(c) c.x = c.x - 10 end), -- Move focused window left fast. + awful.key({ modkey, "#49" }, "l", function(c) c.x = c.x + 10 end) -- Move focused window right fast. ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it work on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. +-- Bind all key numbers to tags for i = 1, 9 do - globalkeys = gears.table.join(globalkeys, - -- View tag only. - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - tag:view_only() - end - end, - {description = "view tag #"..i, group = "tag"}), - -- Toggle tag display. - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - awful.tag.viewtoggle(tag) - end - end, - {description = "toggle tag #" .. i, group = "tag"}), - -- Move client to tag. - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:move_to_tag(tag) - end - end - end, - {description = "move focused client to tag #"..i, group = "tag"}), - -- Toggle tag on focused client. - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:toggle_tag(tag) - end - end - end, - {description = "toggle focused client on tag #" .. i, group = "tag"}) - ) + globalkeys = gears.table.join(globalkeys, + awful.key({ modkey }, "#" .. i + 9, function () local screen = awful.screen.focused() local tag = screen.tags[i] if tag then tag:view_only() end end), -- View tag only. + awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = awful.screen.focused() local tag = screen.tags[i] if tag then awful.tag.viewtoggle(tag) end end), -- Toggle tag display. + awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus then local tag = client.focus.screen.tags[i] if tag then client.focus:move_to_tag(tag) end end end), -- Move client to tag. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus then local tag = client.focus.screen.tags[i] if tag then client.focus:toggle_tag(tag) end end end) -- Toggle tag on focused client. + ) end +-- Mouse movement clientbuttons = gears.table.join( - awful.button({ }, 1, function (c) client.focus = c; c:raise() end), - awful.button({ modkey }, 1, awful.mouse.client.move), - awful.button({ modkey }, 3, awful.mouse.client.resize)) + awful.button({ }, 1, function (c) client.focus = c; c:raise() end), + awful.button({ modkey }, 1, awful.mouse.client.move), + awful.button({ modkey }, 3, awful.mouse.client.resize) +) -- Set keys root.keys(globalkeys) --- }}} --- {{{ Rules --- Rules to apply to new clients (through the "manage" signal). +-- Rules awful.rules.rules = { - -- All clients will match this rule. - { rule = { }, - properties = { border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - raise = true, - keys = clientkeys, - size_hints_honor = false, - buttons = clientbuttons, - screen = awful.screen.preferred, - placement = awful.placement.no_overlap+awful.placement.no_offscreen - } + { + rule = { }, + properties = { + border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + size_hints_honor = false, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap+awful.placement.no_offscreen + } + }, + { + rule_any = + { + name = { "dropdown-terminal", }, }, - - -- Floating clients. - { rule_any = { - instance = { "copyq", }, - }, properties = { floating = true }} + properties = { floating = true } -- Floating clients. + } } --- }}} --- {{{ Signals --- Signal function to execute when a new client appears. +-- Signals (Signal function to execute when a new client appears) client.connect_signal("manage", function (c) - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- if not awesome.startup then awful.client.setslave(c) end - - if awesome.startup and - not c.size_hints.user_position - and not c.size_hints.program_position then - -- Prevent clients from being unreachable after screen count changes. - awful.placement.no_offscreen(c) - end + if awesome.startup and + not c.size_hints.user_position + and not c.size_hints.program_position then + awful.placement.no_offscreen(c) -- Prevent clients from being unreachable after screen count changes. + end end) -- Enable sloppy focus, so that focus follows mouse. client.connect_signal("mouse::enter", function(c) - if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier - and awful.client.focus.filter(c) then - client.focus = c - end + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end end) -- Disable startup notification globally local oldspawn = awful.util.spawn -awful.util.spawn = function (s) - oldspawn(s, false) -end +awful.util.spawn = function (s) oldspawn(s, false) end -- Hide window border for maximized clients -client.connect_signal("property::maximized", function(c) - c.border_width = c.maximized and 0 or beautiful.border_width -end) +client.connect_signal("property::maximized", function(c) c.border_width = c.maximized and 0 or beautiful.border_width end) -- Focus and unfocus borders client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) --- }}} diff --git a/.config/awesome/themes/default/theme.lua b/.config/awesome/themes/default/theme.lua index a2d85ea..e0ba37b 100644 --- a/.config/awesome/themes/default/theme.lua +++ b/.config/awesome/themes/default/theme.lua @@ -1,89 +1,80 @@ --- {{{ Main +-- Main local theme = {} -theme.wallpaper = "~/.config/awesome/themes/default/wallpaper" --- }}} --- {{{ Styles -theme.font = "FontAwesome Bold 9" --- }}} +-- Theme +theme.wallpaper = "~/.config/awesome/themes/default/wallpaper" +theme.font = "FontAwesome Bold 9" +theme.fg_normal = "#FFFFFF" +theme.fg_focus = "#000000" +theme.fg_urgent = "#FF0000" +theme.fg_minimize = "#ffffff" +theme.bg_normal = "#2C303C" +theme.bg_focus = "#00AFF0" +theme.bg_urgent = "#000000" +theme.bg_minimize = "#444444" +theme.bg_systray = theme.bg_normal --- {{{ Colors -theme.fg_normal = "#FFFFFF" -theme.fg_focus = "#000000" -theme.fg_urgent = "#FF0000" -theme.fg_minimize = "#ffffff" - -theme.bg_normal = "#2C303C" -theme.bg_focus = "#00AFF0" -theme.bg_urgent = "#000000" -theme.bg_minimize = "#444444" -theme.bg_systray = theme.bg_normal --- }}} - --- {{{ Borders +-- Borders theme.useless_gap = 5 theme.border_width = 2 theme.border_normal = "#5B92FA" theme.border_focus = "#FF0000" theme.border_marked = "#CC9393" --- }}} --- {{{ Menu -theme.menu_height = 15 -theme.menu_width = 100 +-- Tooltip +theme.tooltip_border_color = "#000000" +theme.tooltip_bg = "#111111" +theme.tooltip_fg = "#ffffff" +theme.tooltip_font = 'Monospace Bold 9' +theme.tooltip_border_width = 2 + +-- Menu +theme.menu_height = 15 +theme.menu_width = 100 theme.menu_border_width = 0 --- }}} --- {{{ Taglist -theme.taglist_squares_sel = "~/.config/awesome/themes/default/taglist/squarefz.png" +-- Taglist +theme.taglist_squares_sel = "~/.config/awesome/themes/default/taglist/squarefz.png" theme.taglist_squares_unsel = "~/.config/awesome/themes/default/taglist/squarefz.png" --- }}} --- {{{ Layout -theme.layout_fairh = "~/.config/awesome/themes/default/layouts/fairhw.png" -theme.layout_fairv = "~/.config/awesome/themes/default/layouts/fairvw.png" -theme.layout_floating = "~/.config/awesome/themes/default/layouts/floatingw.png" -theme.layout_magnifier = "~/.config/awesome/themes/default/layouts/magnifierw.png" -theme.layout_max = "~/.config/awesome/themes/default/layouts/maxw.png" +-- Layout +theme.layout_max = "~/.config/awesome/themes/default/layouts/maxw.png" +theme.layout_tile = "~/.config/awesome/themes/default/layouts/tilew.png" +theme.layout_fairh = "~/.config/awesome/themes/default/layouts/fairhw.png" +theme.layout_fairv = "~/.config/awesome/themes/default/layouts/fairvw.png" +theme.layout_spiral = "~/.config/awesome/themes/default/layouts/spiralw.png" +theme.layout_tiletop = "~/.config/awesome/themes/default/layouts/tiletopw.png" +theme.layout_dwindle = "~/.config/awesome/themes/default/layouts/dwindlew.png" +theme.layout_floating = "~/.config/awesome/themes/default/layouts/floatingw.png" +theme.layout_tileleft = "~/.config/awesome/themes/default/layouts/tileleftw.png" +theme.layout_cornernw = "~/.config/awesome/themes/default/layouts/cornernww.png" +theme.layout_cornerne = "~/.config/awesome/themes/default/layouts/cornernew.png" +theme.layout_cornersw = "~/.config/awesome/themes/default/layouts/cornersww.png" +theme.layout_cornerse = "~/.config/awesome/themes/default/layouts/cornersew.png" +theme.layout_magnifier = "~/.config/awesome/themes/default/layouts/magnifierw.png" theme.layout_fullscreen = "~/.config/awesome/themes/default/layouts/fullscreenw.png" theme.layout_tilebottom = "~/.config/awesome/themes/default/layouts/tilebottomw.png" -theme.layout_tileleft = "~/.config/awesome/themes/default/layouts/tileleftw.png" -theme.layout_tile = "~/.config/awesome/themes/default/layouts/tilew.png" -theme.layout_tiletop = "~/.config/awesome/themes/default/layouts/tiletopw.png" -theme.layout_spiral = "~/.config/awesome/themes/default/layouts/spiralw.png" -theme.layout_dwindle = "~/.config/awesome/themes/default/layouts/dwindlew.png" -theme.layout_cornernw = "~/.config/awesome/themes/default/layouts/cornernww.png" -theme.layout_cornerne = "~/.config/awesome/themes/default/layouts/cornernew.png" -theme.layout_cornersw = "~/.config/awesome/themes/default/layouts/cornersww.png" -theme.layout_cornerse = "~/.config/awesome/themes/default/layouts/cornersew.png" --- }}} --- {{{ Titlebar -theme.titlebar_close_button_focus = "/usr/share/awesome/themes/zenburn/titlebar/close_focus.png" -theme.titlebar_close_button_normal = "/usr/share/awesome/themes/zenburn/titlebar/close_normal.png" - -theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/ontop_focus_active.png" -theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/ontop_normal_inactive.png" - -theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/sticky_focus_active.png" -theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/sticky_normal_inactive.png" - -theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/floating_focus_active.png" -theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/floating_normal_inactive.png" - -theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/maximized_focus_active.png" -theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/maximized_normal_active.png" +-- Titlebar +theme.titlebar_close_button_focus = "/usr/share/awesome/themes/zenburn/titlebar/close_focus.png" +theme.titlebar_close_button_normal = "/usr/share/awesome/themes/zenburn/titlebar/close_normal.png" +theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/ontop_normal_inactive.png" +theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/sticky_normal_inactive.png" +theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/floating_normal_inactive.png" +theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/zenburn/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/zenburn/titlebar/maximized_normal_active.png" theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/zenburn/titlebar/maximized_focus_inactive.png" theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/zenburn/titlebar/maximized_normal_inactive.png" --- }}} +-- End theme.icon_theme = nil return theme - --- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/.config/brittany/config.yaml b/.config/brittany/config.yaml new file mode 100644 index 0000000..b59e86a --- /dev/null +++ b/.config/brittany/config.yaml @@ -0,0 +1,49 @@ +--- +conf_disable_formatting: false +conf_debug: + dconf_roundtrip_exactprint_only: false + dconf_dump_bridoc_simpl_par: false + dconf_dump_ast_unknown: false + dconf_dump_bridoc_simpl_floating: false + dconf_dump_config: false + dconf_dump_bridoc_raw: false + dconf_dump_bridoc_final: false + dconf_dump_bridoc_simpl_alt: false + dconf_dump_bridoc_simpl_indent: false + dconf_dump_annotations: false + dconf_dump_bridoc_simpl_columns: false + dconf_dump_ast_full: false +conf_forward: + options_ghc: [] +conf_errorHandling: + econf_ExactPrintFallback: ExactPrintFallbackModeInline + econf_Werror: false + econf_omit_output_valid_check: false + econf_produceOutputOnErrors: false +conf_preprocessor: + ppconf_CPPMode: CPPModeAbort + ppconf_hackAroundIncludes: false +conf_obfuscate: false +conf_roundtrip_exactprint_only: false +conf_version: 1 +conf_layout: + lconfig_reformatModulePreamble: true + lconfig_altChooser: + tag: AltChooserBoundedSearch + contents: 3 + lconfig_allowSingleLineExportList: false + lconfig_importColumn: 50 + lconfig_hangingTypeSignature: false + lconfig_importAsColumn: 50 + lconfig_alignmentLimit: 30 + lconfig_allowHangingQuasiQuotes: true + lconfig_indentListSpecial: true + lconfig_indentAmount: 2 + lconfig_alignmentBreakOnMultiline: true + lconfig_experimentalSemicolonNewlines: false + lconfig_cols: 80 + lconfig_indentPolicy: IndentPolicyFree + lconfig_indentWhereSpecial: true + lconfig_columnAlignMode: + tag: ColumnAlignModeMajority + contents: 0.7 diff --git a/.config/chromexup/config.ini b/.config/chromexup/config.ini index bcab72b..16032cb 100644 --- a/.config/chromexup/config.ini +++ b/.config/chromexup/config.ini @@ -1,13 +1,10 @@ [main] -branding = chromium -remove_orphans = True +branding = chromium +remove_orphans = True parallel_downloads = 4 [extensions] -BlankNewTabPage = jaadjnlkjnhohljficgoddcjmndjfdmi -CSSFeatureToggles = aeinmfddnniiloadoappmdnffcbffnjg -JSONFormatter = bcjindcccaagfpapjjmafapmmgkkhgoa -JavaScriptToggle = cdcgbgnfhhdmdkallfmlachogpghifgf -KeepassBrowser = oboonakemofpalcgghocfoadofidjkkk -OldReddit = dneaehbmnbhcippjikoajpoabadpodje -uBlockOrigin = cjpalhdlnbpafiamejdnhcphjbkeiagm +BlankNewTabPage = jaadjnlkjnhohljficgoddcjmndjfdmi +JavaScriptToggle = cdcgbgnfhhdmdkallfmlachogpghifgf +NoHistory = ljamgkbcojbnmcaonjokopmcblmmpfch +uBlockOrigin = cjpalhdlnbpafiamejdnhcphjbkeiagm diff --git a/.config/chromium-flags.conf b/.config/chromium-flags.conf deleted file mode 100644 index a452c52..0000000 --- a/.config/chromium-flags.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Chromium Flags ---disk-cache-dir=/dev/null ---disable-smooth-scrolling ---disable-sync-preferences ---disable-gpu-compositing ---enable-native-gpu-memory-buffers ---process-per-site -#--incognito -#--proxy-server="socks5://localhost:2871" diff --git a/.config/copyq/copyq-dark.conf b/.config/copyq/copyq-dark.conf deleted file mode 100644 index 36380e1..0000000 --- a/.config/copyq/copyq-dark.conf +++ /dev/null @@ -1,201 +0,0 @@ -[General] -plugin_priority=itemimage, itemencrypted, itemfakevim, itemnotes, itemsync, itemtext, itemtags, itempinned, itemweb - -[Options] -action_has_input=false -action_has_output=false -action_output_tab= -action_separator=\\n -activate_closes=true -activate_focuses=true -activate_pastes=false -always_on_top=false -autocompletion=true -autostart=false -check_clipboard=true -check_selection=true -clipboard_notification_lines=0 -clipboard_tab=&clipboard -close_on_unfocus=false -command_history_size=100 -confirm_exit=true -copy_clipboard=false -copy_selection=false -disable_tray=true -edit_ctrl_return=true -editor=geany %1 -expire_tab=0 -filter_history= -hide_main_window=true -hide_main_window_in_task_bar=false -hide_tabs=false -hide_toolbar=true -hide_toolbar_labels=true -item_popup_interval=0 -language=en -max_process_manager_rows=1000 -maxitems=10000 -move=true -notification_horizontal_offset=10 -notification_maximum_height=100 -notification_maximum_width=300 -notification_position=3 -notification_vertical_offset=10 -number_search=false -open_windows_on_current_screen=false -run_selection=false -save_filter_history=false -show_advanced_command_settings=false -show_simple_items=false -show_tab_item_count=true -tab_tree=true -tabs=&clipboard, &saved, imported -text_wrap=true -transparency=0 -transparency_focused=0 -tray_commands=false -tray_images=false -tray_item_paste=false -tray_items=0 -tray_tab= -tray_tab_is_current=false -vi=true - -[Plugins] -itemdata\enabled=true -itemencrypted\enabled=true -itemencrypted\encrypt_tabs= -itemfakevim\enabled=true -itemfakevim\really_enable=false -itemfakevim\source_file= -itemimage\enabled=true -itemimage\image_editor= -itemimage\max_image_height=240 -itemimage\max_image_width=320 -itemimage\svg_editor= -itemnotes\enabled=true -itempinned\enabled=true -itemsync\enabled=true -itemtags\enabled=true -itemtags\tags=@Invalid() -itemtext\enabled=true -itemtext\max_height=0 -itemtext\max_lines=0 -itemtext\use_rich_text=false -itemweb\enabled=true -itemweb\max_height=0 - -[Shortcuts] -about=shift+f1 -action=F5 -change_tab_icon=ctrl+shift+t -commands=f6 -copy_selected_items=ctrl+c -delete_item=del -edit=f2 -edit_notes=shift+f2 -editor=ctrl+e -exit=ctrl+q -export=ctrl+s -export_tab=Ctrl+S -find_items=ctrl+g -format-next=ctrl+right -format-previous=ctrl+left -help=f1 -import=ctrl+i -import_tab=Ctrl+I -item-menu=shift+f10 -move_down=ctrl+down -move_to_bottom=ctrl+end -move_to_clipboard= -move_to_top=ctrl+home -move_up=ctrl+up -new=ctrl+n -new_tab=ctrl+t -next_tab=right -next_to_clipboard=Ctrl+Shift+N -paste_selected_items=ctrl+v -preferences=ctrl+p -previous_tab=left -previous_to_clipboard=Ctrl+Shift+P -process_manager=ctrl+shift+z -remove_tab=ctrl+w -rename_tab=ctrl+f2 -reverse_selected_items=ctrl+shift+r -show-log=f12 -show_clipboard_content=ctrl+shift+c -show_item_content=f4 -show_item_preview=f7 -sort_selected_items=ctrl+shift+s -system-run=f5 -toggle_clipboard_storing=ctrl+shift+x - -[Tabs] -1\icon= -1\max_item_count=0 -1\name=&clipboard -1\store_items=true -2\icon= -2\max_item_count=0 -2\name=&saved -2\store_items=true -3\icon= -3\max_item_count=0 -3\name=imported -3\store_items=true -size=3 - -[Theme] -alt_bg=#2e3436 -alt_item_css= -bg=#242424 -css= -cur_item_css="\n ;border: 0.1em solid ${sel_bg}" -edit_bg=#2e3436 -edit_fg=#fdfdfd -edit_font= -fg=#fdfdfd -find_bg=#ff0 -find_fg=#000000 -find_font= -font= -font_antialiasing=true -item_css= -item_spacing= -menu_bar_css="\n ;background: ${bg}\n ;color: ${fg}" -menu_bar_disabled_css="\n ;color: ${bg - #666}" -menu_bar_selected_css="\n ;background: ${sel_bg}\n ;color: ${sel_fg}" -menu_css="\n ;border-top: 0.08em solid ${bg + #333}\n ;border-left: 0.08em solid ${bg + #333}\n ;border-bottom: 0.08em solid ${bg - #333}\n ;border-right: 0.08em solid ${bg - #333}" -notes_bg=#000000 -notes_css= -notes_fg=#ffffff -notes_font= -notification_bg=#333 -notification_fg=#ddd -notification_font= -num_fg=#909090 -num_font= -search_bar="\n ;background: ${edit_bg}\n ;color: ${edit_fg}\n ;border: 1px solid ${alt_bg}\n ;margin: 2px" -search_bar_focused="\n ;border: 1px solid ${sel_bg}" -sel_bg=#204a87 -sel_fg=#ffffff -sel_item_css= -show_number=true -show_scrollbars=true -style_main_window=false -tab_bar_css="\n ;background: ${bg - #222}" -tab_bar_item_counter="\n ;color: ${fg - #044 + #400}\n ;font-size: 6pt" -tab_bar_scroll_buttons_css="\n ;background: ${bg - #222}\n ;color: ${fg}\n ;border: 0" -tab_bar_sel_item_counter="\n ;color: ${sel_bg - #044 + #400}" -tab_bar_tab_selected_css="\n ;padding: 0.5em\n ;background: ${bg}\n ;border: 0.05em solid ${bg}\n ;color: ${fg}" -tab_bar_tab_unselected_css="\n ;border: 0.05em solid ${bg}\n ;padding: 0.5em\n ;background: ${bg - #222}\n ;color: ${fg - #333}" -tab_tree_css="\n ;color: ${fg}\n ;background-color: ${bg}" -tab_tree_item_counter="\n ;color: ${fg - #044 + #400}\n ;font-size: 6pt" -tab_tree_item_css=padding:2px -tab_tree_sel_item_counter="\n ;color: ${sel_fg - #044 + #400}" -tab_tree_sel_item_css="\n ;color: ${sel_fg}\n ;background-color: ${sel_bg}" -tool_bar_css="\n ;color: ${fg}\n ;background-color: ${bg}\n ;border: 0" -tool_button_css="\n ;background-color: transparent" -tool_button_pressed_css="\n ;background: ${sel_bg}" -tool_button_selected_css="\n ;background: ${sel_bg}\n ;color: ${sel_fg}" -use_system_icons=false diff --git a/.config/copyq/copyq.conf b/.config/copyq/copyq.conf deleted file mode 100644 index e5745e0..0000000 --- a/.config/copyq/copyq.conf +++ /dev/null @@ -1,201 +0,0 @@ -[General] -plugin_priority=itemimage, itemencrypted, itemfakevim, itemnotes, itemsync, itemtext, itemtags, itempinned, itemweb - -[Options] -action_has_input=false -action_has_output=false -action_output_tab= -action_separator=\\n -activate_closes=true -activate_focuses=true -activate_pastes=false -always_on_top=false -autocompletion=true -autostart=false -check_clipboard=true -check_selection=false -clipboard_notification_lines=0 -clipboard_tab=&clipboard -close_on_unfocus=false -command_history_size=100 -confirm_exit=true -copy_clipboard=false -copy_selection=false -disable_tray=true -edit_ctrl_return=true -editor=gvim %1 -expire_tab=0 -filter_history= -hide_main_window=true -hide_main_window_in_task_bar=false -hide_tabs=false -hide_toolbar=true -hide_toolbar_labels=true -item_popup_interval=0 -language=en -max_process_manager_rows=1000 -maxitems=10000 -move=true -notification_horizontal_offset=10 -notification_maximum_height=100 -notification_maximum_width=300 -notification_position=3 -notification_vertical_offset=10 -number_search=false -open_windows_on_current_screen=false -run_selection=true -save_filter_history=false -show_advanced_command_settings=false -show_simple_items=false -show_tab_item_count=true -tab_tree=true -tabs=&clipboard, &saved, imported -text_wrap=true -transparency=0 -transparency_focused=0 -tray_commands=false -tray_images=false -tray_item_paste=false -tray_items=0 -tray_tab= -tray_tab_is_current=false -vi=true - -[Plugins] -itemdata\enabled=true -itemencrypted\enabled=true -itemencrypted\encrypt_tabs= -itemfakevim\enabled=true -itemfakevim\really_enable=false -itemfakevim\source_file= -itemimage\enabled=true -itemimage\image_editor= -itemimage\max_image_height=240 -itemimage\max_image_width=320 -itemimage\svg_editor= -itemnotes\enabled=true -itempinned\enabled=true -itemsync\enabled=true -itemtags\enabled=true -itemtags\tags=@Invalid() -itemtext\enabled=true -itemtext\max_height=0 -itemtext\max_lines=0 -itemtext\use_rich_text=false -itemweb\enabled=true -itemweb\max_height=0 - -[Shortcuts] -about=shift+f1 -action=F5 -change_tab_icon=ctrl+shift+t -commands=f6 -copy_selected_items=ctrl+c -delete_item=del -edit=f2 -edit_notes=shift+f2 -editor=ctrl+e -exit=ctrl+q -export=ctrl+s -export_tab=Ctrl+S -find_items=ctrl+g -format-next=ctrl+right -format-previous=ctrl+left -help=f1 -import=ctrl+i -import_tab=Ctrl+I -item-menu=shift+f10 -move_down=ctrl+down -move_to_bottom=ctrl+end -move_to_clipboard= -move_to_top=ctrl+home -move_up=ctrl+up -new=ctrl+n -new_tab=ctrl+t -next_tab=right -next_to_clipboard=Ctrl+Shift+N -paste_selected_items=ctrl+v -preferences=ctrl+p -previous_tab=left -previous_to_clipboard=Ctrl+Shift+P -process_manager=ctrl+shift+z -remove_tab=ctrl+w -rename_tab=ctrl+f2 -reverse_selected_items=ctrl+shift+r -show-log=f12 -show_clipboard_content=ctrl+shift+c -show_item_content=f4 -show_item_preview=f7 -sort_selected_items=ctrl+shift+s -system-run=f5 -toggle_clipboard_storing=ctrl+shift+x - -[Tabs] -1\icon= -1\max_item_count=0 -1\name=imported -1\store_items=true -2\icon= -2\max_item_count=0 -2\name=&saved -2\store_items=true -3\icon= -3\max_item_count=0 -3\name=&clipboard -3\store_items=true -size=3 - -[Theme] -alt_bg=#f3f3f3 -alt_item_css= -bg=#fdfdfd -css= -cur_item_css="\n ;border: 0.1em solid ${sel_bg}" -edit_bg=#fdfdfd -edit_fg=#242424 -edit_font= -fg=#242424 -find_bg=#ff0 -find_fg=#000 -find_font= -font= -font_antialiasing=true -item_css= -item_spacing= -menu_bar_css="\n ;background: ${bg}\n ;color: ${fg}" -menu_bar_disabled_css="\n ;color: ${bg - #666}" -menu_bar_selected_css="\n ;background: ${sel_bg}\n ;color: ${sel_fg}" -menu_css="\n ;border-top: 0.08em solid ${bg + #333}\n ;border-left: 0.08em solid ${bg + #333}\n ;border-bottom: 0.08em solid ${bg - #333}\n ;border-right: 0.08em solid ${bg - #333}" -notes_bg=#ffffdc -notes_css= -notes_fg=#000000 -notes_font= -notification_bg=#333 -notification_fg=#ddd -notification_font= -num_fg=#909090 -num_font= -search_bar="\n ;background: ${edit_bg}\n ;color: ${edit_fg}\n ;border: 1px solid ${alt_bg}\n ;margin: 2px" -search_bar_focused="\n ;border: 1px solid ${sel_bg}" -sel_bg=#729fcf -sel_fg=#000000 -sel_item_css= -show_number=true -show_scrollbars=true -style_main_window=false -tab_bar_css="\n ;background: ${bg - #222}" -tab_bar_item_counter="\n ;color: ${fg - #044 + #400}\n ;font-size: 6pt" -tab_bar_scroll_buttons_css="\n ;background: ${bg - #222}\n ;color: ${fg}\n ;border: 0" -tab_bar_sel_item_counter="\n ;color: ${sel_bg - #044 + #400}" -tab_bar_tab_selected_css="\n ;padding: 0.5em\n ;background: ${bg}\n ;border: 0.05em solid ${bg}\n ;color: ${fg}" -tab_bar_tab_unselected_css="\n ;border: 0.05em solid ${bg}\n ;padding: 0.5em\n ;background: ${bg - #222}\n ;color: ${fg - #333}" -tab_tree_css="\n ;color: ${fg}\n ;background-color: ${bg}" -tab_tree_item_counter="\n ;color: ${fg - #044 + #400}\n ;font-size: 6pt" -tab_tree_item_css=padding:2px -tab_tree_sel_item_counter="\n ;color: ${sel_fg - #044 + #400}" -tab_tree_sel_item_css="\n ;color: ${sel_fg}\n ;background-color: ${sel_bg}" -tool_bar_css="\n ;color: ${fg}\n ;background-color: ${bg}\n ;border: 0" -tool_button_css="\n ;background-color: transparent" -tool_button_pressed_css="\n ;background: ${sel_bg}" -tool_button_selected_css="\n ;background: ${sel_bg}\n ;color: ${sel_fg}" -use_system_icons=false diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..614c0b8 --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,50 @@ +[global] + font = Sans 8 + markup = full + format = "<b>%s</b>\n%b" + alignment = left + bounce_freq = 0 + follow = mouse + frame_color = "#000000" + frame_width = 3 + geometry = "250x5-5+35" + history_length = 20 + horizontal_padding = 8 + icon_position = off + idle_threshold = 120 + ignore_newline = no + indicate_hidden = yes + line_height = 0 + monitor = 0 + padding = 8 + separator_color = frame + separator_height = 2 + show_age_threshold = 60 + show_indicators = yes + shrink = yes + sort = yes + startup_notification = false + sticky_history = yes + transparency = 0 + word_wrap = yes + +[shortcuts] + close = ctrl+space + close_all = ctrl+shift+space + history = ctrl+grave + context = ctrl+shift+period + +[urgency_low] + background = "#000000" + foreground = "#ffffff" + timeout = 3 + +[urgency_normal] + background = "#000000" + foreground = "#ffffff" + timeout = 5 + +[urgency_critical] + background = "#FF0000" + foreground = "#000000" + timeout = 0 diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 775253a..eb468ec 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1,34 +1,32 @@ (custom-set-variables - '(package-selected-packages (quote (evil))) - '(tool-bar-mode nil) - ;; set slime history file location - '(slime-repl-history-file "~/.cache/slime-history.eld")) + '(package-selected-packages '(slime smex evil)) + '(slime-repl-history-file "~/.cache/slime-history.eld")) ; Set slime history file location. (custom-set-faces '(region ((t (:background "color-238"))))) -;; disable startup screen -(setq inhibit-startup-screen t) +(setq inhibit-startup-screen t) ; Disable startup screen. +(setq-default indent-tabs-mode nil) ; Use spaces for indentation. +(setq inferior-lisp-program "sbcl") ; Enable slime. +(setq-default mode-line-format nil) ; Remove status line. -;; disable menu bar -(menu-bar-mode -1) +(menu-bar-mode -1) ; Disable menu bar. +(tool-bar-mode -1) ; Disable tool bar. +(tooltip-mode -1) ; Disable tool tips. +(scroll-bar-mode -1) ; Disable scroll bar. +(set-fringe-mode 10) ; Create space. +(ido-mode t) ; Enable file search interactive mode C-x C-f. -;; use spaces for indentation -(setq-default indent-tabs-mode nil) +(setq backup-directory-alist + '(("." . "~/.config/emacs/backups"))) -;; set up package.el to work with melpa -(require 'package) +(require 'package) ; Set up package.el to work with melpa. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) +(unless package-archive-contents (package-refresh-contents)) +(package-install-selected-packages) -;; enable slime -(setq inferior-lisp-program "sbcl") -(unless (package-installed-p 'slime) - (package-install 'slime)) - -;; enable evil -(unless (package-installed-p 'evil) - (package-install 'evil)) -(require 'evil) -(evil-mode 1) +(global-set-key (kbd "M-x") 'smex) ; Enable smex interactive M-x. +(global-set-key (kbd "M-X") 'smex-major-mode-commands) +(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) ; Native M-x binding. diff --git a/.config/eslintrc.yml b/.config/eslint/config.yaml index 7dc8a5d..a030580 100644 --- a/.config/eslintrc.yml +++ b/.config/eslint/config.yaml @@ -1,8 +1,9 @@ +--- env: browser: true commonjs: true es6: true -extends: 'eslint:recommended' +extends: eslint:recommended globals: Atomics: readonly SharedArrayBuffer: readonly diff --git a/.config/fzf/completion.bash b/.config/fzf/completion.bash new file mode 100644 index 0000000..21aa450 --- /dev/null +++ b/.config/fzf/completion.bash @@ -0,0 +1,381 @@ +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ completion.bash +# +# - $FZF_TMUX (default: 0) +# - $FZF_TMUX_OPTS (default: empty) +# - $FZF_COMPLETION_TRIGGER (default: '**') +# - $FZF_COMPLETION_OPTS (default: empty) + +if [[ $- =~ i ]]; then + +# To use custom commands instead of find, override _fzf_compgen_{path,dir} +if ! declare -f _fzf_compgen_path > /dev/null; then + _fzf_compgen_path() { + echo "$1" + command find -L "$1" \ + -name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \ + -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@' + } +fi + +if ! declare -f _fzf_compgen_dir > /dev/null; then + _fzf_compgen_dir() { + command find -L "$1" \ + -name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \ + -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@' + } +fi + +########################################################### + +# To redraw line after fzf closes (printf '\e[5n') +bind '"\e[0n": redraw-current-line' 2> /dev/null + +__fzf_comprun() { + if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then + _fzf_comprun "$@" + elif [[ -n "$TMUX_PANE" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "$FZF_TMUX_OPTS" ]]; }; then + shift + fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@" + else + shift + fzf "$@" + fi +} + +__fzf_orig_completion() { + local l comp f cmd + while read -r l; do + if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then + comp="${BASH_REMATCH[1]}" + f="${BASH_REMATCH[2]}" + cmd="${BASH_REMATCH[3]}" + [[ "$f" = _fzf_* ]] && continue + printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}" + if [[ "$l" = *" -o nospace "* ]] && [[ ! "$__fzf_nospace_commands" = *" $cmd "* ]]; then + __fzf_nospace_commands="$__fzf_nospace_commands $cmd " + fi + fi + done +} + +_fzf_opts_completion() { + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts=" + -x --extended + -e --exact + --algo + -i +i + -n --nth + --with-nth + -d --delimiter + +s --no-sort + --tac + --tiebreak + -m --multi + --no-mouse + --bind + --cycle + --no-hscroll + --jump-labels + --height + --literal + --reverse + --margin + --inline-info + --prompt + --pointer + --marker + --header + --header-lines + --ansi + --tabstop + --color + --no-bold + --history + --history-size + --preview + --preview-window + -q --query + -1 --select-1 + -0 --exit-0 + -f --filter + --print-query + --expect + --sync" + + case "${prev}" in + --tiebreak) + COMPREPLY=( $(compgen -W "length begin end index" -- "$cur") ) + return 0 + ;; + --color) + COMPREPLY=( $(compgen -W "dark light 16 bw" -- "$cur") ) + return 0 + ;; + --history) + COMPREPLY=() + return 0 + ;; + esac + + if [[ "$cur" =~ ^-|\+ ]]; then + COMPREPLY=( $(compgen -W "${opts}" -- "$cur") ) + return 0 + fi + + return 0 +} + +_fzf_handle_dynamic_completion() { + local cmd orig_var orig ret orig_cmd orig_complete + cmd="$1" + shift + orig_cmd="$1" + orig_var="_fzf_orig_completion_$cmd" + orig="${!orig_var##*#}" + if [[ -n "$orig" ]] && type "$orig" > /dev/null 2>&1; then + $orig "$@" + elif [[ -n "$_fzf_completion_loader" ]]; then + orig_complete=$(complete -p "$orig_cmd" 2> /dev/null) + _completion_loader "$@" + ret=$? + # _completion_loader may not have updated completion for the command + if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then + __fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null) + if [[ "$__fzf_nospace_commands" = *" $orig_cmd "* ]]; then + eval "${orig_complete/ -F / -o nospace -F }" + else + eval "$orig_complete" + fi + fi + return $ret + fi +} + +__fzf_generic_path_completion() { + local cur base dir leftover matches trigger cmd + cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}" + COMPREPLY=() + trigger=${FZF_COMPLETION_TRIGGER-'**'} + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ "$cur" == *"$trigger" ]]; then + base=${cur:0:${#cur}-${#trigger}} + eval "base=$base" + + [[ $base = *"/"* ]] && dir="$base" + while true; do + if [[ -z "$dir" ]] || [[ -d "$dir" ]]; then + leftover=${base/#"$dir"} + leftover=${leftover/#\/} + [[ -z "$dir" ]] && dir='.' + [[ "$dir" != "/" ]] && dir="${dir/%\//}" + matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS $2" __fzf_comprun "$4" -q "$leftover" | while read -r item; do + printf "%q$3 " "$item" + done) + matches=${matches% } + [[ -z "$3" ]] && [[ "$__fzf_nospace_commands" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches " + if [[ -n "$matches" ]]; then + COMPREPLY=( "$matches" ) + else + COMPREPLY=( "$cur" ) + fi + printf '\e[5n' + return 0 + fi + dir=$(dirname "$dir") + [[ "$dir" =~ /$ ]] || dir="$dir"/ + done + else + shift + shift + shift + _fzf_handle_dynamic_completion "$cmd" "$@" + fi +} + +_fzf_complete() { + # Split arguments around -- + local args rest str_arg i sep + args=("$@") + sep= + for i in "${!args[@]}"; do + if [[ "${args[$i]}" = -- ]]; then + sep=$i + break + fi + done + if [[ -n "$sep" ]]; then + str_arg= + rest=("${args[@]:$((sep + 1)):${#args[@]}}") + args=("${args[@]:0:$sep}") + else + str_arg=$1 + args=() + shift + rest=("$@") + fi + + local cur selected trigger cmd post + post="$(caller 0 | awk '{print $2}')_post" + type -t "$post" > /dev/null 2>&1 || post=cat + + cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}" + trigger=${FZF_COMPLETION_TRIGGER-'**'} + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ "$cur" == *"$trigger" ]]; then + cur=${cur:0:${#cur}-${#trigger}} + + selected=$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS $str_arg" __fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | tr '\n' ' ') + selected=${selected% } # Strip trailing space not to repeat "-o nospace" + if [[ -n "$selected" ]]; then + COMPREPLY=("$selected") + else + COMPREPLY=("$cur") + fi + printf '\e[5n' + return 0 + else + _fzf_handle_dynamic_completion "$cmd" "${rest[@]}" + fi +} + +_fzf_path_completion() { + __fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@" +} + +# Deprecated. No file only completion. +_fzf_file_completion() { + _fzf_path_completion "$@" +} + +_fzf_dir_completion() { + __fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@" +} + +_fzf_complete_kill() { + local trigger=${FZF_COMPLETION_TRIGGER-'**'} + local cur="${COMP_WORDS[COMP_CWORD]}" + if [[ -z "$cur" ]]; then + COMP_WORDS[$COMP_CWORD]=$trigger + elif [[ "$cur" != *"$trigger" ]]; then + return 1 + fi + + _fzf_proc_completion "$@" +} + +_fzf_proc_completion() { + _fzf_complete -m --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <( + command ps -ef | sed 1d + ) +} + +_fzf_proc_completion_post() { + awk '{print $2}' +} + +_fzf_host_completion() { + _fzf_complete +m -- "$@" < <( + command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?]') \ + <(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \ + <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') | + awk '{if (length($2) > 0) {print $2}}' | sort -u + ) +} + +_fzf_var_completion() { + _fzf_complete -m -- "$@" < <( + declare -xp | sed 's/=.*//' | sed 's/.* //' + ) +} + +_fzf_alias_completion() { + _fzf_complete -m -- "$@" < <( + alias | sed 's/=.*//' | sed 's/.* //' + ) +} + +# fzf options +complete -o default -F _fzf_opts_completion fzf + +d_cmds="${FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir}" +a_cmds=" + awk cat diff diff3 + emacs emacsclient ex file ftp g++ gcc gvim head hg java + javac ld less more mvim nvim patch perl python ruby + sed sftp sort source tail tee uniq vi view vim wc xdg-open + basename bunzip2 bzip2 chmod chown curl cp dirname du + find git grep gunzip gzip hg jar + ln ls mv open rm rsync scp + svn tar unzip zip" + +# Preserve existing completion +__fzf_orig_completion < <(complete -p $d_cmds $a_cmds 2> /dev/null) + +if type _completion_loader > /dev/null 2>&1; then + _fzf_completion_loader=1 +fi + +__fzf_defc() { + local cmd func opts orig_var orig def + cmd="$1" + func="$2" + opts="$3" + orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" + orig="${!orig_var}" + if [[ -n "$orig" ]]; then + printf -v def "$orig" "$func" + eval "$def" + else + complete -F "$func" $opts "$cmd" + fi +} + +# Anything +for cmd in $a_cmds; do + __fzf_defc "$cmd" _fzf_path_completion "-o default -o bashdefault" +done + +# Directory +for cmd in $d_cmds; do + __fzf_defc "$cmd" _fzf_dir_completion "-o nospace -o dirnames" +done + +# Kill completion (supports empty completion trigger) +complete -F _fzf_complete_kill -o default -o bashdefault kill + +unset cmd d_cmds a_cmds + +_fzf_setup_completion() { + local kind fn cmd + kind=$1 + fn=_fzf_${1}_completion + if [[ $# -lt 2 ]] || ! type -t "$fn" > /dev/null; then + echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..." + return 1 + fi + shift + __fzf_orig_completion < <(complete -p "$@" 2> /dev/null) + for cmd in "$@"; do + case "$kind" in + dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;; + var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;; + alias) __fzf_defc "$cmd" "$fn" "-a" ;; + *) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;; + esac + done +} + +# Environment variables / Aliases / Hosts +_fzf_setup_completion 'var' export unset +_fzf_setup_completion 'alias' unalias +_fzf_setup_completion 'host' ssh telnet + +fi diff --git a/.config/fzf/key-bindings.bash b/.config/fzf/key-bindings.bash new file mode 100644 index 0000000..d2da0be --- /dev/null +++ b/.config/fzf/key-bindings.bash @@ -0,0 +1,95 @@ +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ key-bindings.bash +# +# - $FZF_TMUX_OPTS +# - $FZF_CTRL_T_COMMAND +# - $FZF_CTRL_T_OPTS +# - $FZF_CTRL_R_OPTS +# - $FZF_ALT_C_COMMAND +# - $FZF_ALT_C_OPTS + +# Key bindings +# ------------ +__fzf_select__() { + local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type f -print \ + -o -type d -print \ + -o -type l -print 2> /dev/null | cut -b3-"}" + eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read -r item; do + printf '%q ' "$item" + done + echo +} + +if [[ $- =~ i ]]; then + +__fzfcmd() { + [[ -n "$TMUX_PANE" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "$FZF_TMUX_OPTS" ]]; } && + echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" +} + +fzf-file-widget() { + local selected="$(__fzf_select__)" + READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}" + READLINE_POINT=$(( READLINE_POINT + ${#selected} )) +} + +__fzf_cd__() { + local cmd dir + cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type d -print 2> /dev/null | cut -b3-"}" + dir=$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m) && printf 'cd -- %q' "$dir" +} + +__fzf_history__() { + local output + output=$( + cat $HISTFILEPERSIST | + FZF_DEFAULT_OPTS="--reverse --height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m --prompt '* ~ > '" $(__fzfcmd) --query "$READLINE_LINE" + ) || return + READLINE_LINE=${output#*$'\t'} + if [[ -z "$READLINE_POINT" ]]; then + echo "$READLINE_LINE" + else + READLINE_POINT=0x7fffffff + fi +} + +# Required to refresh the prompt after fzf +bind -m emacs-standard '"\er": redraw-current-line' + +bind -m vi-command '"\C-z": emacs-editing-mode' +bind -m vi-insert '"\C-z": emacs-editing-mode' +bind -m emacs-standard '"\C-z": vi-editing-mode' + +if (( BASH_VERSINFO[0] < 4 )); then + # CTRL-T - Paste the selected file path into the command line + bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select__`\e\C-e\er\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"' + bind -m vi-command '"\C-t": "\C-z\C-t\C-z"' + bind -m vi-insert '"\C-t": "\C-z\C-t\C-z"' + + # CTRL-R - Paste the selected command from history into the command line + bind -m emacs-standard '"\C-r": "\C-e \C-u\C-y\ey\C-u"$(__fzf_history__)"\e\C-e\er"' + bind -m vi-command '"\C-r": "\C-z\C-r\C-z"' + bind -m vi-insert '"\C-r": "\C-z\C-r\C-z"' +else + # CTRL-T - Paste the selected file path into the command line + bind -m emacs-standard -x '"\C-t": fzf-file-widget' + bind -m vi-command -x '"\C-t": fzf-file-widget' + bind -m vi-insert -x '"\C-t": fzf-file-widget' + + # CTRL-R - Paste the selected command from history into the command line + bind -m emacs-standard -x '"\C-r": __fzf_history__' + bind -m vi-command -x '"\C-r": __fzf_history__' + bind -m vi-insert -x '"\C-r": __fzf_history__' +fi + +# ALT-C - cd into the selected directory +bind -m emacs-standard '"\ec": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"' +bind -m vi-command '"\ec": "\C-z\ec\C-z"' +bind -m vi-insert '"\ec": "\C-z\ec\C-z"' + +fi diff --git a/.config/fzf-marks/fzf-marks.plugin.bash b/.config/fzf/marks.plugin.bash index 9c80f94..f6eb82f 100644 --- a/.config/fzf-marks/fzf-marks.plugin.bash +++ b/.config/fzf/marks.plugin.bash @@ -1,3 +1,5 @@ +#!/bin/bash + # MIT License # Copyright (c) 2018 Urbain Vaes @@ -25,18 +27,11 @@ FZF_MARKS_FILE=$FZF_DIRECTORY_MARKS command -v fzf >/dev/null 2>&1 || return -function is_interactive_shell() { - # https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html +is_interactive_shell() { # https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html [[ "$-" =~ "i" ]] } -if [[ -z "${FZF_MARKS_FILE}" ]] ; then - FZF_MARKS_FILE="${HOME}/.fzf-marks" -fi - -if [[ ! -f "${FZF_MARKS_FILE}" ]]; then - touch "${FZF_MARKS_FILE}" -fi +[ ! -f "${FZF_MARKS_FILE}" ] && mkdir -p "$(dirname "${FZF_MARKS_FILE}")" && touch "${FZF_MARKS_FILE}" if [[ -z "${FZF_MARKS_COMMAND}" ]] ; then diff --git a/.config/git/config b/.config/git/config index fa790b3..cdc1251 100644 --- a/.config/git/config +++ b/.config/git/config @@ -1,10 +1,25 @@ [user] name = tdro - email = tdro@users.noreply.github.com + email = tdro@noreply.example.com + [push] default = simple + [color] ui = auto + [core] editor = vim excludesfile = ~/.config/git/ignore + +[init] + defaultBranch = master + +[alias] + ignored = !git ls-files -v | grep '^h' + +[diff] + algorithm = patience + +[commit] + verbose = true diff --git a/.config/latexindent/settings.yaml b/.config/latexindent/settings.yaml new file mode 100644 index 0000000..7eafd4c --- /dev/null +++ b/.config/latexindent/settings.yaml @@ -0,0 +1,30 @@ +--- +# Default: https://raw.githubusercontent.com/cmhughes/latexindent.pl/main/defaultSettings.yaml +onlyOneBackUp: 1 +backupExtension: .backup.tex + +modifyLineBreaks: + preserveBlankLines: 1 + condenseMultipleBlankLinesInto: 1 + oneSentencePerLine: + manipulateSentences: 0 + textWrapSentences: 1 + textWrapOptions: + all: 1 + columns: 80 + perCodeBlockBasis: 1 + +verbatimEnvironments: + pre: 1 + filecontents*: 1 + +noAdditionalIndentGlobal: + filecontents: 1 + +logFilePreferences: + endLogFileWith: '--------------' + showAmalgamatedSettings: 0 + showDecorationFinishCodeBlockTrace: 0 + showDecorationStartCodeBlockTrace: 0 + showEveryYamlRead: 0 + showGitHubInfoFooter: 0 diff --git a/.config/libvirt/libvirt.conf b/.config/libvirt/libvirt.conf new file mode 100644 index 0000000..deb583b --- /dev/null +++ b/.config/libvirt/libvirt.conf @@ -0,0 +1 @@ +uri_default = "qemu:///system" diff --git a/.config/lxc/builds/almalinux8.dockerfile b/.config/lxc/builds/almalinux8.dockerfile new file mode 100644 index 0000000..4b2532b --- /dev/null +++ b/.config/lxc/builds/almalinux8.dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/almalinux:8.5-20220306@sha256:cd49d7250ed7bb194d502d8a3e50bd775055ca275d1d9c2785aea72b890afe6a + +RUN dnf install --assumeyes --setopt=install_weak_deps=False epel-release \ + && dnf --assumeyes update + +RUN dnf install --assumeyes --setopt=install_weak_deps=False \ + openssh-server dhcp-client xauth vim htop + +RUN systemctl enable sshd + +RUN curl --silent https://raw.githubusercontent.com/dylanaraps/neofetch/ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f/neofetch \ + --output /usr/bin/neofetch && chmod +x /usr/bin/neofetch + +RUN printf 'neofetch\n' >> /etc/profile +RUN printf 'export TERM=linux\n' >> /etc/profile +RUN printf 'dhclient\n' >> /etc/rc.d/rc.local && chmod +x /etc/rc.d/rc.local + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(alma) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(alma) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf 'id --user 1000 > /dev/null 2>&1 || { adduser user --uid 1000 --groups wheel --create-home --user-group --password "$(uuidgen)" && printf ". /etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/alpine3.15.dockerfile b/.config/lxc/builds/alpine3.15.dockerfile new file mode 100644 index 0000000..bcdf390 --- /dev/null +++ b/.config/lxc/builds/alpine3.15.dockerfile @@ -0,0 +1,20 @@ +FROM docker.io/library/alpine:3.15@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3 + +RUN apk update + +RUN apk add openrc neofetch xauth openssh vim htop + +RUN rc-update add networking +RUN rc-update add sshd + +RUN printf 'auto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet dhcp\n' > /etc/network/interfaces + +RUN printf 'export TERM=xterm-256color\n' >> /etc/profile +RUN printf 'id -u user > /dev/null 2>&1 || { adduser -u 1000 -g user user -D; }\n' >> /etc/profile + +RUN printf '. /etc/profile && neofetch\n' > /etc/profile.d/neofetch + +RUN printf "export ENV='/etc/profile.d/neofetch'\n" >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(alpine) \[\\e[0;31m\]\w\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(alpine) \[\\e[0;32m\]\w\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile diff --git a/.config/lxc/builds/archlinux.dockerfile b/.config/lxc/builds/archlinux.dockerfile new file mode 100644 index 0000000..4441ee6 --- /dev/null +++ b/.config/lxc/builds/archlinux.dockerfile @@ -0,0 +1,69 @@ +FROM docker.io/library/archlinux:base-devel-20230115.0.118859@sha256:d363f036cbbe40976a3b5883712fa56637a7245c24eca278d9afe71d64a93aea + +RUN pacman --noconfirm -Syu wget + +RUN printf '\ +[options] \n\ +ParallelDownloads = 5 \n\ +Architecture = auto \n\ +HoldPkg = pacman glibc \n\ +XferCommand = /usr/bin/wget --quiet --passive-ftp --show-progress --tries=1 --waitretry=1 --read-timeout=1 --continue --output-document %%o %%u \n\ + \n\ +Color \n\ +VerbosePkgLists \n\ +LocalFileSigLevel = Optional \n\ +SigLevel = Required DatabaseOptional \n\ + \n\ +[core] \n\ +Include = /etc/pacman.d/mirrorlist \n\ + \n\ +[extra] \n\ +Include = /etc/pacman.d/mirrorlist \n\ + \n\ +[community] \n\ +Include = /etc/pacman.d/mirrorlist \n\ + \n\ +[options] \n\ +NoExtract = usr/share/help/* !usr/share/help/en* \n\ +NoExtract = usr/share/gtk-doc/html/* usr/share/doc/* \n\ +NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/* \n\ +NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.* \n\ +NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso* \n\ +NoExtract = !usr/share/*locales/trans* \n\ +NoExtract = usr/share/man/* usr/share/info/* \n\ +NoExtract = usr/share/vim/vim*/lang/* \n\ +' > /etc/pacman.conf + +RUN pacman --noconfirm -Syu neofetch vim htop dhcpcd git go + +RUN cd /tmp \ + && curl --remote-name https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz \ + && tar --extract --file yay.tar.gz \ + && chmod o+w yay + +RUN su -s /bin/sh -c 'cd /tmp/yay && export GOCACHE=/tmp/yay && makepkg --syncdeps --noconfirm --skippgpcheck' - nobody \ + && pacman --noconfirm -U /tmp/yay/*.zst + +RUN pacman --noconfirm -Rns go gcc sudo + +RUN rm --recursive --force /tmp/yay /tmp/yay.tar.gz /var/cache/pacman/pkg + +RUN systemctl enable dhcpcd +RUN systemctl mask \ + sys-kernel-config.mount \ + sys-kernel-debug.mount \ + systemd-journald-audit.socket \ + systemd-firstboot.service \ + tmp.mount + +RUN printf 'permit :wheel\npermit nopass keepenv root\n' > /etc/doas.conf && chmod 400 /etc/doas.conf + +RUN printf 'export TERM=linux\n' >> /etc/profile +RUN printf 'neofetch\n' >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(arch) \[\\e[0;31m\]\w\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(arch) \[\\e[0;32m\]\w\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile + +RUN printf 'id --user 1000 > /dev/null 2>&1 || { useradd --uid 1000 --groups wheel --create-home --comment user user && printf ". ./etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/debian-bullseye11.dockerfile b/.config/lxc/builds/debian-bullseye11.dockerfile new file mode 100644 index 0000000..ea106fb --- /dev/null +++ b/.config/lxc/builds/debian-bullseye11.dockerfile @@ -0,0 +1,19 @@ +FROM docker.io/library/debian:bullseye-slim@sha256:7c78fedca85eec82669ff06969250175edac0750cb883628dfe7be18cb906928 + +RUN apt update + +RUN apt install --no-install-recommends --assume-yes \ + init uuid-runtime neofetch vim-tiny iproute2 dhcpcd5 xauth htop + +RUN systemctl mask sys-kernel-config.mount sys-kernel-debug.mount systemd-journald-audit.socket + +RUN ln --symbolic --force bash /bin/sh + +RUN printf 'export TERM=linux\n' >> /etc/profile +RUN printf 'neofetch\n' >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(debian) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(debian) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf 'id --user 1000 > /dev/null 2>&1 || { adduser user --uid 1000 --gecos user --disabled-password && printf ". ./etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/fedora35.dockerfile b/.config/lxc/builds/fedora35.dockerfile new file mode 100644 index 0000000..2b732c9 --- /dev/null +++ b/.config/lxc/builds/fedora35.dockerfile @@ -0,0 +1,21 @@ +FROM docker.io/library/fedora@sha256:762d7c5766839057fd9f96a0f2cedf143e2b818feb7767dc1bb70c00c4c3890a + +RUN dnf --assumeyes update + +RUN dnf install --assumeyes --setopt=install_weak_deps=False \ + openssh-server iproute neofetch dhcp-client xauth htop + +RUN systemctl enable sshd +RUN systemctl mask sys-kernel-config.mount sys-kernel-debug.mount systemd-journald-audit.socket + +RUN mkdir --parents /etc/rc.d +RUN printf '#!/bin/sh -eu\ndhclient\n' > /etc/rc.d/rc.local && chmod +x /etc/rc.d/rc.local + +RUN printf 'neofetch\n' >> /etc/profile +RUN printf 'export TERM=linux\n' >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(fedora) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(fedora) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf 'id --user 1000 > /dev/null 2>&1 || { adduser user --uid 1000 --groups wheel --create-home --user-group --password "$(uuidgen)" && printf ". ./etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/oracle8.dockerfile b/.config/lxc/builds/oracle8.dockerfile new file mode 100644 index 0000000..2a440e0 --- /dev/null +++ b/.config/lxc/builds/oracle8.dockerfile @@ -0,0 +1,19 @@ +FROM docker.io/library/oraclelinux:8-slim@sha256:9c3ca322d552af7f20c3b80eea42e854487bcc5983b0ad66928c00e16c49d5e8 + +RUN microdnf install epel-release && microdnf --assumeyes update + +RUN microdnf install --assumeyes openssh-server network-scripts dhcp-client neofetch htop + +RUN systemctl enable sshd + +RUN systemctl mask sys-kernel-config.mount sys-kernel-debug.mount rdisc.service + +RUN printf 'neofetch\n' >> /etc/profile +RUN printf 'export TERM=linux\n' >> /etc/profile +RUN printf 'dhclient\n' >> /etc/rc.d/rc.local && chmod +x /etc/rc.d/rc.local + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(oracle) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(oracle) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf 'id --user 1000 > /dev/null 2>&1 || { adduser user --uid 1000 --groups wheel --create-home --user-group --password "$(uuidgen)" && printf ". /etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/rockylinux8.dockerfile b/.config/lxc/builds/rockylinux8.dockerfile new file mode 100644 index 0000000..a220fbf --- /dev/null +++ b/.config/lxc/builds/rockylinux8.dockerfile @@ -0,0 +1,24 @@ +FROM docker.io/library/rockylinux:8.5@sha256:8a94380717b7e6b21c56f8333e0e8242e89a020c0c861d6346f59f179f096240 + +RUN dnf install --assumeyes --setopt=install_weak_deps=False epel-release \ + && dnf --assumeyes update + +RUN dnf install --assumeyes --setopt=install_weak_deps=False \ + openssh-server network-scripts dhcp-client xauth vim htop + +RUN systemctl enable network sshd + +RUN sed --in-place 's/ens3/eth0/' /etc/sysconfig/network-scripts/ifcfg-ens3 + +RUN systemctl mask sys-kernel-config.mount sys-kernel-debug.mount + +RUN curl --silent https://raw.githubusercontent.com/dylanaraps/neofetch/ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f/neofetch \ + --output /usr/bin/neofetch && chmod +x /usr/bin/neofetch +RUN printf 'neofetch\n' >> /etc/profile +RUN printf 'export TERM=linux\n' >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(rocky) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(rocky) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf 'id --user 1000 > /dev/null 2>&1 || { adduser user --uid 1000 --groups wheel --create-home --user-group --password "$(uuidgen)" && printf ". /etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/ubuntu-lunar23.04.dockerfile b/.config/lxc/builds/ubuntu-lunar23.04.dockerfile new file mode 100644 index 0000000..c86f47b --- /dev/null +++ b/.config/lxc/builds/ubuntu-lunar23.04.dockerfile @@ -0,0 +1,21 @@ +FROM docker.io/library/ubuntu:lunar@sha256:a40051efc6b591d38faffb11fdcef157103b9a4143edbc959c47e4b8c7d2e9eb + +RUN apt update + +RUN apt install --no-install-recommends --assume-yes \ + init uuid-runtime neofetch vim-tiny iproute2 xauth htop + +RUN systemctl mask sys-kernel-debug.mount +RUN systemctl enable systemd-networkd + +RUN ln --symbolic --force bash /bin/sh + +RUN printf '[Match]\nName=eth0\n\n[Network]\nDHCP=yes' > /etc/systemd/network/20-wired.network +RUN printf 'export TERM=linux\n' >> /etc/profile +RUN printf 'neofetch\n' >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(ubuntu) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(ubuntu) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf 'id --user 1000 > /dev/null 2>&1 || { adduser user --uid 1000 --gecos user --disabled-password && printf ". ./etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root diff --git a/.config/lxc/builds/void.dockerfile b/.config/lxc/builds/void.dockerfile new file mode 100644 index 0000000..155df96 --- /dev/null +++ b/.config/lxc/builds/void.dockerfile @@ -0,0 +1,25 @@ +FROM docker.io/voidlinux/voidlinux:latest@sha256:26ba972f0c06beadcec4796ec3037e0bec32af4d255edb68a528bd98304c74f4 + +RUN xbps-install -Syu xbps +RUN xbps-install -Syu +RUN xbps-install -y openssh dhcpcd iputils iproute2 socklog-void neofetch htop + +RUN mkdir --parents /run/runit/runsvdir + +RUN ln --symbolic --force bash /bin/sh +RUN ln --symbolic /etc/runit/runsvdir/current /run/runit/runsvdir/current +RUN ln --symbolic /etc/sv/sshd /var/service/ +RUN ln --symbolic /etc/sv/dhcpcd-eth0 /var/service/ +RUN ln --symbolic /etc/sv/socklog-unix /var/service/ + +RUN printf 'neofetch\n' >> /etc/profile +RUN printf 'export TERM=linux\n' >> /etc/profile + +RUN printf '{ [ "$(whoami)" = "root" ] && export PS1='\''(void) \[\\e[0;31m\]\W\[\\e[0m\] \[\\e[0;31m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile +RUN printf '{ [ "$(whoami)" = "user" ] && export PS1='\''(void) \[\\e[0;32m\]\W\[\\e[0m\] \[\\e[0;32m\]\$\[\\e[0m\] '\''; } || true\n' >> /etc/profile + +RUN printf 'id --user 1000 > /dev/null 2>&1 || { useradd --uid 1000 --groups wheel --create-home --comment user user && printf ". ./etc/profile\n" >> /home/user/.bashrc; }\n' >> /etc/profile + +RUN usermod --password "$(uuidgen)" root + + diff --git a/.config/lxc/default.conf b/.config/lxc/default.conf new file mode 100644 index 0000000..9bc4192 --- /dev/null +++ b/.config/lxc/default.conf @@ -0,0 +1,21 @@ +# Distribution configuration +lxc.include = /etc/lxc/common.conf +lxc.include = /etc/lxc/userns.conf + +# Unprivileged user group mappings +lxc.idmap = u 0 200000 65536 +lxc.idmap = g 0 200000 65536 + +# Network configuration +lxc.net.0.type = veth +lxc.net.0.link = lxcbr0 +lxc.net.0.flags = up +lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx + +# Xorg configuration +lxc.environment = DISPLAY=:1.0 +lxc.environment = XAUTHORITY=/home/user/.config/X11/Xauthority +lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir +lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir +lxc.mount.entry = /dev/shm dev/shm none bind,optional,create=dir +lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,optional,create=dir,ro diff --git a/.config/mimeapps.list b/.config/mimeapps.list index f6664a9..4f52c6f 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,76 +1,293 @@ [Added Associations] application/epub+zip=pdf.desktop; -application/octet-stream=editor.desktop; +application/gzip=archive.desktop; +application/java-archive=archive.desktop; +application/octet-stream=binary.desktop; application/pdf=pdf.desktop; -application/vnd.openxmlformats-officedocument.presentationml.presentation=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.presentationml.slide=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.presentationml.slideshow=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.presentationml.template=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.spreadsheetml.template=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice.desktop; -application/vnd.openxmlformats-officedocument.wordprocessingml.template=libreoffice.desktop; -application/x-awk=editor.desktop; +application/vnd.android.package-archive=archive.desktop; +application/vnd.oasis.opendocument.text=office.desktop; +application/vnd.openxmlformats-officedocument.presentationml.presentation=office.desktop; +application/vnd.openxmlformats-officedocument.presentationml.slide=office.desktop; +application/vnd.openxmlformats-officedocument.presentationml.slideshow=office.desktop; +application/vnd.openxmlformats-officedocument.presentationml.template=office.desktop; +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=office.desktop; +application/vnd.openxmlformats-officedocument.spreadsheetml.template=office.desktop; +application/vnd.openxmlformats-officedocument.wordprocessingml.document=office.desktop; +application/vnd.openxmlformats-officedocument.wordprocessingml.template=office.desktop; +application/x-7z=archive.desktop; +application/x-7z-compressed=archive.desktop; +application/x-ace=archive.desktop; +application/x-ace-compressed=archive.desktop; +application/x-archive=archive.desktop; +application/x-arj=archive.desktop; +application/x-astrotite-afa=archive.desktop; +application/x-awk=text.desktop; +application/x-b1=archive.desktop; application/x-bittorrent=torrent.desktop; -application/x-desktop=editor.desktop; -application/x-shellscript=editor.desktop; +application/x-blender=blender.desktop; +application/x-bzip2=archive.desktop; +application/x-cd-image=archive.desktop; +application/x-cfs=archive.desktop; +application/x-cfs-compressed=archive.desktop; +application/x-compress=archive.desktop; +application/x-cpio=archive.desktop; +application/x-cpio-compressed=archive.desktop; +application/x-dar=archive.desktop; +application/x-desktop=text.desktop; +application/x-dgc=archive.desktop; +application/x-dgc-compressed=archive.desktop; +application/x-freearc=archive.desktop; +application/x-gca=archive.desktop; +application/x-gca-compressed=archive.desktop; +application/x-gtar=archive.desktop; +application/x-gtar-compressed=archive.desktop; +application/x-lzh=archive.desktop; +application/x-lzh-compressed=archive.desktop; +application/x-lzip=archive.desktop; +application/x-lzma=archive.desktop; +application/x-lzop=archive.desktop; +application/x-lzx=archive.desktop; +application/x-rar=archive.desktop; +application/x-rar-compressed=archive.desktop; +application/x-sbx=archive.desktop; +application/x-shar=archive.desktop; +application/x-shellscript=text.desktop; +application/x-snappy-framed=archive.desktop; +application/x-stuffit=archive.desktop; +application/x-stuffitx=archive.desktop; +application/x-tar=archive.desktop; +application/x-xar=archive.desktop; +application/x-xz=archive.desktop; +application/x-zoo=archive.desktop; +application/x-zstd-compressed-tar=archive.desktop; +application/zip=archive.desktop; +application/zstd=archive.desktop; +audio/1d-interleaved-parityfec=audio.desktop; audio/32kadpcm=audio.desktop; +audio/3gpp=audio.desktop; +audio/3gpp2=audio.desktop; audio/AMR=audio.desktop; audio/AMR-WB=audio.desktop; audio/ATRAC-ADVANCED-LOSSLESS=audio.desktop; audio/ATRAC-X=audio.desktop; audio/ATRAC3=audio.desktop; +audio/BV16=audio.desktop; +audio/BV32=audio.desktop; +audio/CN=audio.desktop; +audio/DAT12=audio.desktop; +audio/DV=audio.desktop; +audio/DVI4=audio.desktop; audio/EVRC=audio.desktop; +audio/EVRC-QCP=audio.desktop; +audio/EVRC0=audio.desktop; +audio/EVRC1=audio.desktop; audio/EVRCB=audio.desktop; +audio/EVRCB0=audio.desktop; +audio/EVRCB1=audio.desktop; audio/EVRCNW=audio.desktop; audio/EVRCWB=audio.desktop; +audio/EVRCWB0=audio.desktop; +audio/EVRCWB1=audio.desktop; +audio/G719=audio.desktop; +audio/G722=audio.desktop; +audio/G7221=audio.desktop; +audio/G723=audio.desktop; +audio/G726-16=audio.desktop; +audio/G726-24=audio.desktop; +audio/G726-32=audio.desktop; +audio/G726-40=audio.desktop; +audio/G728=audio.desktop; +audio/G729=audio.desktop; +audio/G7291=audio.desktop; +audio/G729D=audio.desktop; +audio/G729E=audio.desktop; +audio/GSM=audio.desktop; +audio/GSM-EFR=audio.desktop; +audio/GSM-HR-08=audio.desktop; audio/L16=audio.desktop; +audio/L20=audio.desktop; +audio/L24=audio.desktop; +audio/L8=audio.desktop; +audio/LPC=audio.desktop; +audio/MP4A-LATM=audio.desktop; +audio/MPA=audio.desktop; +audio/PCMA=audio.desktop; +audio/PCMA-WB=audio.desktop; +audio/PCMU=audio.desktop; +audio/PCMU-WB=audio.desktop; +audio/QCELP=audio.desktop; +audio/RED=audio.desktop; audio/SMV=audio.desktop; +audio/SMV-QCP=audio.desktop; +audio/SMV0=audio.desktop; +audio/UEMCLIP=audio.desktop; +audio/VDVI=audio.desktop; +audio/VMR-WB=audio.desktop; audio/ac3=audio.desktop; +audio/adpcm=audio.desktop; +audio/amr=audio.desktop; +audio/amr-wb=audio.desktop; +audio/amr-wb+=audio.desktop; +audio/annodex=audio.desktop; audio/asc=audio.desktop; audio/basic=audio.desktop; +audio/bv16=audio.desktop; +audio/bv32=audio.desktop; +audio/clearmode=audio.desktop; +audio/cn=audio.desktop; +audio/csound=audio.desktop; +audio/dat12=audio.desktop; audio/dls=audio.desktop; +audio/dsr-es201108=audio.desktop; +audio/dsr-es202050=audio.desktop; +audio/dsr-es202211=audio.desktop; +audio/dsr-es202212=audio.desktop; +audio/dvi4=audio.desktop; +audio/eac3=audio.desktop; +audio/evrc=audio.desktop; +audio/evrc-qcp=audio.desktop; +audio/evrc0=audio.desktop; +audio/evrc1=audio.desktop; +audio/evrcb=audio.desktop; +audio/evrcb0=audio.desktop; +audio/evrcb1=audio.desktop; +audio/evrcwb=audio.desktop; +audio/evrcwb0=audio.desktop; +audio/evrcwb1=audio.desktop; +audio/example=audio.desktop; +audio/flac=audio.desktop; +audio/fwdred=audio.desktop; +audio/g.722.1=audio.desktop; +audio/g719=audio.desktop; +audio/g722=audio.desktop; +audio/g7221=audio.desktop; +audio/g723=audio.desktop; +audio/g726-16=audio.desktop; +audio/g726-24=audio.desktop; +audio/g726-32=audio.desktop; +audio/g726-40=audio.desktop; +audio/g728=audio.desktop; +audio/g729=audio.desktop; +audio/g7291=audio.desktop; +audio/g729d=audio.desktop; +audio/g729e=audio.desktop; +audio/gsm=audio.desktop; +audio/gsm-efr=audio.desktop; audio/iLBC=audio.desktop; +audio/ilbc=audio.desktop; +audio/ip-mr_v2.5=audio.desktop; +audio/l16=audio.desktop; +audio/l20=audio.desktop; +audio/l24=audio.desktop; +audio/l8=audio.desktop; +audio/lpc=audio.desktop; audio/midi=audio.desktop; audio/mobile-xmf=audio.desktop; audio/mp4=audio.desktop; +audio/mp4a-latm=audio.desktop; +audio/mpa=audio.desktop; +audio/mpa-robust=audio.desktop; audio/mpeg=audio.desktop; +audio/mpeg4-generic=audio.desktop; +audio/mpegurl=audio.desktop; audio/ogg=audio.desktop; +audio/parityfec=audio.desktop; +audio/pcma=audio.desktop; +audio/pcma-wb=audio.desktop; +audio/pcmu=audio.desktop; +audio/pcmu-wb=audio.desktop; audio/prs.sid=audio.desktop; audio/qcelp=audio.desktop; +audio/raptorfec=audio.desktop; +audio/red=audio.desktop; +audio/rtp-enc-aescm128=audio.desktop; +audio/rtp-midi=audio.desktop; +audio/rtx=audio.desktop; +audio/s3m=audio.desktop; +audio/silk=audio.desktop; +audio/smv=audio.desktop; +audio/smv-qcp=audio.desktop; +audio/smv0=audio.desktop; +audio/sp-midi=audio.desktop; +audio/speex=audio.desktop; +audio/t140c=audio.desktop; +audio/t38=audio.desktop; +audio/telephone-event=audio.desktop; +audio/tone=audio.desktop; +audio/ulpfec=audio.desktop; +audio/vdvi=audio.desktop; +audio/vmr-wb=audio.desktop; +audio/vnd.3gpp.iufp=audio.desktop; +audio/vnd.4SB=audio.desktop; +audio/vnd.4sb=audio.desktop; +audio/vnd.CELP=audio.desktop; audio/vnd.audikoz=audio.desktop; +audio/vnd.audiokoz=audio.desktop; +audio/vnd.celp=audio.desktop; +audio/vnd.cisco.nse=audio.desktop; +audio/vnd.cmles.radio-events=audio.desktop; +audio/vnd.cns.anp1=audio.desktop; +audio/vnd.cns.inf1=audio.desktop; audio/vnd.dece.audio=audio.desktop; audio/vnd.digital-winds=audio.desktop; +audio/vnd.dlna.adts=audio.desktop; +audio/vnd.dolby.heaac.1=audio.desktop; +audio/vnd.dolby.heaac.2=audio.desktop; audio/vnd.dolby.mlp=audio.desktop; +audio/vnd.dolby.mps=audio.desktop; +audio/vnd.dolby.pl2=audio.desktop; +audio/vnd.dolby.pl2x=audio.desktop; +audio/vnd.dolby.pl2z=audio.desktop; +audio/vnd.dolby.pulse.1=audio.desktop; +audio/vnd.dra=audio.desktop; audio/vnd.dts=audio.desktop; audio/vnd.dts.hd=audio.desktop; +audio/vnd.dvb.file=audio.desktop; audio/vnd.everad.plj=audio.desktop; +audio/vnd.hns.audio=audio.desktop; audio/vnd.lucent.voice=audio.desktop; audio/vnd.ms-playready.media.pya=audio.desktop; +audio/vnd.nokia.mobile-xmf=audio.desktop; audio/vnd.nortel.vbk=audio.desktop; audio/vnd.nuera.ecelp4800=audio.desktop; audio/vnd.nuera.ecelp7470=audio.desktop; audio/vnd.nuera.ecelp9600=audio.desktop; +audio/vnd.octel.sbc=audio.desktop; +audio/vnd.qcelp=audio.desktop; +audio/vnd.rhetorex.32kadpcm=audio.desktop; audio/vnd.rip=audio.desktop; audio/vnd.sealedmedia.softseal.mpeg=audio.desktop; +audio/vnd.vmx.cvsd=audio.desktop; +audio/vorbis=audio.desktop; +audio/vorbis-config=audio.desktop; +audio/webm=audio.desktop; +audio/x-aac=audio.desktop; audio/x-aiff=audio.desktop; audio/x-annodex=audio.desktop; +audio/x-caf=audio.desktop; audio/x-flac=audio.desktop; +audio/x-gsm=audio.desktop; audio/x-matroska=audio.desktop; audio/x-mod=audio.desktop; audio/x-mpegurl=audio.desktop; audio/x-ms-wax=audio.desktop; audio/x-ms-wma=audio.desktop; audio/x-pn-realaudio=audio.desktop; +audio/x-pn-realaudio-plugin=audio.desktop; audio/x-realaudio=audio.desktop; audio/x-s3m=audio.desktop; +audio/x-scpls=audio.desktop; +audio/x-sd2=audio.desktop; audio/x-stm=audio.desktop; audio/x-wav=audio.desktop; +audio/xm=audio.desktop; image/bmp=image.desktop; image/cgm=image.desktop; image/dicom-rle=image.desktop; image/emf=image.desktop; +image/example=image.desktop; image/fits=image.desktop; +image/g3fax=image.desktop; image/gif=image.desktop; image/ief=image.desktop; image/jls=image.desktop; @@ -79,17 +296,23 @@ image/jpeg=image.desktop; image/jpm=image.desktop; image/jpx=image.desktop; image/ktx=image.desktop; +image/naplps=image.desktop; +image/pcx=image.desktop; image/png=image.desktop; image/prs.btif=image.desktop; image/prs.pti=image.desktop; +image/pwg-raster=image.desktop; +image/sgi=image.desktop; image/svg+xml=image.desktop; image/t38=image.desktop; image/tiff=image.desktop; image/tiff-fx=image.desktop; image/vnd.adobe.photoshop=image.desktop; image/vnd.airzip.accelerator.azv=image.desktop; +image/vnd.cns.inf2=image.desktop; image/vnd.dece.graphic=image.desktop; image/vnd.djvu=image.desktop; +image/vnd.dvb.subtitle=image.desktop; image/vnd.dwg=image.desktop; image/vnd.dxf=image.desktop; image/vnd.fastbidsheet=image.desktop; @@ -99,12 +322,16 @@ image/vnd.fujixerox.edmics-mmr=image.desktop; image/vnd.fujixerox.edmics-rlc=image.desktop; image/vnd.globalgraphics.pgb=image.desktop; image/vnd.microsoft.icon=image.desktop; +image/vnd.mix=image.desktop; image/vnd.mozilla.apng=image.desktop; image/vnd.ms-modi=image.desktop; +image/vnd.ms-photo=image.desktop; +image/vnd.net-fpx=image.desktop; image/vnd.radiance=image.desktop; image/vnd.sealed.png=image.desktop; image/vnd.sealedmedia.softseal.gif=image.desktop; image/vnd.sealedmedia.softseal.jpg=image.desktop; +image/vnd.svf=image.desktop; image/vnd.tencent.tap=image.desktop; image/vnd.valve.source.texture=image.desktop; image/vnd.wap.wbmp=image.desktop; @@ -112,113 +339,304 @@ image/vnd.xiff=image.desktop; image/vnd.zbrush.pcx=image.desktop; image/webp=image.desktop; image/wmf=image.desktop; +image/x-3ds=image.desktop; +image/x-canon-cr2=image.desktop; +image/x-canon-crw=image.desktop; image/x-cmu-raster=image.desktop; +image/x-cmx=image.desktop; +image/x-coreldraw=image.desktop; +image/x-coreldrawpattern=image.desktop; +image/x-coreldrawtemplate=image.desktop; +image/x-corelphotopaint=image.desktop; +image/x-epson-erf=image.desktop; +image/x-freehand=image.desktop; +image/x-icon=image.desktop; +image/x-jg=image.desktop; +image/x-jng=image.desktop; +image/x-mrsid-image=image.desktop; +image/x-ms-bmp=image.desktop; +image/x-nikon-nef=image.desktop; +image/x-olympus-orf=image.desktop; +image/x-pcx=image.desktop; +image/x-photoshop=image.desktop; +image/x-pict=image.desktop; image/x-portable-anymap=image.desktop; image/x-portable-bitmap=image.desktop; image/x-portable-graymap=image.desktop; image/x-portable-pixmap=image.desktop; image/x-rgb=image.desktop; image/x-targa=image.desktop; +image/x-tga=image.desktop; image/x-xbitmap=image.desktop; image/x-xpixmap=image.desktop; image/x-xwindowdump=image.desktop; -inode/directory=file-manager.desktop; -message/rfc822=email.desktop; -text/cache-manifest=editor.desktop; -text/calendar=editor.desktop; -text/css=editor.desktop; -text/csv=editor.desktop; -text/csv-schema=editor.desktop; -text/dns=editor.desktop; -text/html=editor.desktop; -text/html-sandboxed=editor.desktop; -text/jcr-cnd=editor.desktop; -text/markdown=editor.desktop; -text/mizar=editor.desktop; -text/n3=editor.desktop; -text/plain=editor.desktop; -text/provenance-notation=editor.desktop; -text/prs.fallenstein.rst=editor.desktop; -text/prs.lines.tag=editor.desktop; -text/richtext=editor.desktop; -text/rust=editor.desktop; -text/sgml=editor.desktop; -text/tab-separated-values=editor.desktop; -text/troff=editor.desktop; -text/turtle=editor.desktop; -text/uri-list=editor.desktop; -text/vcard=editor.desktop; -text/vnd.DMClientScript=editor.desktop; -text/vnd.a=editor.desktop; -text/vnd.abc=editor.desktop; -text/vnd.ascii-art=editor.desktop; -text/vnd.debian.copyright=editor.desktop; -text/vnd.dvb.subtitle=editor.desktop; -text/vnd.esmertec.theme-descriptor=editor.desktop; -text/vnd.fly=editor.desktop; -text/vnd.fmi.flexstor=editor.desktop; -text/vnd.graphviz=editor.desktop; -text/vnd.in3d.3dml=editor.desktop; -text/vnd.in3d.spot=editor.desktop; -text/vnd.ms-mediapackage=editor.desktop; -text/vnd.net2phone.commcenter.command=editor.desktop; -text/vnd.si.uricatalogue=editor.desktop; -text/vnd.sun.j2me.app-descriptor=editor.desktop; -text/vnd.trolltech.linguist=editor.desktop; -text/vnd.wap.si=editor.desktop; -text/vnd.wap.sl=editor.desktop; -text/vnd.wap.wml=editor.desktop; -text/vnd.wap.wmlscript=editor.desktop; -text/x-lua=editor.desktop; -text/x-pod=editor.desktop; -text/x-ruby=editor.desktop; -text/x-setext=editor.desktop; -text/x-systemd-unit=editor.desktop; -text/xml=editor.desktop; -text/xml-external-parsed-entity=editor.desktop; +inode/blockdevice=inode.desktop; +inode/chardevice=inode.desktop; +inode/directory=inode.desktop; +inode/directory-locked=inode.desktop; +inode/fifo=inode.desktop; +inode/socket=inode.desktop; +message/CPIM=message.desktop; +message/cpim=message.desktop; +message/delivery-status=message.desktop; +message/disposition-notification=message.desktop; +message/example=message.desktop; +message/external-body=message.desktop; +message/feedback-report=message.desktop; +message/global=message.desktop; +message/global-delivery-status=message.desktop; +message/global-disposition-notification=message.desktop; +message/global-headers=message.desktop; +message/http=message.desktop; +message/imdn+xml=message.desktop; +message/news=message.desktop; +message/partial=message.desktop; +message/rfc822=message.desktop; +message/s-http=message.desktop; +message/sip=message.desktop; +message/sipfrag=message.desktop; +message/tracking-status=message.desktop; +message/vnd.si.simp=message.desktop; +text/cache-manifest=text.desktop; +text/calendar=text.desktop; +text/comma-separated-values=text.desktop; +text/css=text.desktop; +text/csv=text.desktop; +text/csv-schema=text.desktop; +text/directory=text.desktop; +text/dns=text.desktop; +text/ecmascript=text.desktop; +text/english=text.desktop; +text/enriched=text.desktop; +text/example=text.desktop; +text/h323=text.desktop; +text/html=text.desktop; +text/html-sandboxed=text.desktop; +text/iuls=text.desktop; +text/javascript=text.desktop; +text/jcr-cnd=text.desktop; +text/markdown=text.desktop; +text/mathml=text.desktop; +text/mizar=text.desktop; +text/n3=text.desktop; +text/parityfec=text.desktop; +text/plain=text.desktop; +text/provenance-notation=text.desktop; +text/prs.fallenstein.rst=text.desktop; +text/prs.lines.tag=text.desktop; +text/red=text.desktop; +text/rfc822-headers=text.desktop; +text/richtext=text.desktop; +text/rtf=text.desktop; +text/rtp-enc-aescm128=text.desktop; +text/rtx=text.desktop; +text/rust=text.desktop; +text/scriptlet=text.desktop; +text/sgml=text.desktop; +text/t140=text.desktop; +text/tab-separated-values=text.desktop; +text/texmacs=text.desktop; +text/troff=text.desktop; +text/turtle=text.desktop; +text/ulpfec=text.desktop; +text/uri-list=text.desktop; +text/vcard=text.desktop; +text/vnd.DMClientScript=text.desktop; +text/vnd.IPTC.NITF=text.desktop; +text/vnd.IPTC.NewsML=text.desktop; +text/vnd.a=text.desktop; +text/vnd.abc=text.desktop; +text/vnd.ascii-art=text.desktop; +text/vnd.curl=text.desktop; +text/vnd.curl.dcurl=text.desktop; +text/vnd.curl.mcurl=text.desktop; +text/vnd.curl.scurl=text.desktop; +text/vnd.debian.copyright=text.desktop; +text/vnd.dmclientscript=text.desktop; +text/vnd.dvb.subtitle=text.desktop; +text/vnd.esmertec.theme-descriptor=text.desktop; +text/vnd.flatland.3dml=text.desktop; +text/vnd.fly=text.desktop; +text/vnd.fmi.flexstor=text.desktop; +text/vnd.graphviz=text.desktop; +text/vnd.in3d.3dml=text.desktop; +text/vnd.in3d.spot=text.desktop; +text/vnd.iptc.newsml=text.desktop; +text/vnd.iptc.nitf=text.desktop; +text/vnd.latex-z=text.desktop; +text/vnd.motorola.reflex=text.desktop; +text/vnd.ms-mediapackage=text.desktop; +text/vnd.net2phone.commcenter.command=text.desktop; +text/vnd.si.uricatalogue=text.desktop; +text/vnd.sun.j2me.app-descriptor=text.desktop; +text/vnd.trolltech.linguist=text.desktop; +text/vnd.wap.si=text.desktop; +text/vnd.wap.sl=text.desktop; +text/vnd.wap.wml=text.desktop; +text/vnd.wap.wmlscript=text.desktop; +text/x-asm=text.desktop; +text/x-bibtex=text.desktop; +text/x-boo=text.desktop; +text/x-c=text.desktop; +text/x-c++hdr=text.desktop; +text/x-c++src=text.desktop; +text/x-chdr=text.desktop; +text/x-component=text.desktop; +text/x-crontab=text.desktop; +text/x-csh=text.desktop; +text/x-csrc=text.desktop; +text/x-diff=text.desktop; +text/x-dsrc=text.desktop; +text/x-fortran=text.desktop; +text/x-haskell=text.desktop; +text/x-java=text.desktop; +text/x-java-source=text.desktop; +text/x-lilypond=text.desktop; +text/x-literate-haskell=text.desktop; +text/x-lua=text.desktop; +text/x-makefile=text.desktop; +text/x-moc=text.desktop; +text/x-nfo=text.desktop; +text/x-opml=text.desktop; +text/x-pascal=text.desktop; +text/x-pcs-gcd=text.desktop; +text/x-perl=text.desktop; +text/x-pod=text.desktop; +text/x-psp=text.desktop; +text/x-python=text.desktop; +text/x-ruby=text.desktop; +text/x-scala=text.desktop; +text/x-server-parsed-html=text.desktop; +text/x-setext=text.desktop; +text/x-sfv=text.desktop; +text/x-sh=text.desktop; +text/x-systemd-unit=text.desktop; +text/x-tcl=text.desktop; +text/x-tex=text.desktop; +text/x-uuencode=text.desktop; +text/x-vcalendar=text.desktop; +text/x-vcard=text.desktop; +text/xml=text.desktop; +text/xml-external-parsed-entity=text.desktop; +video/1d-interleaved-parityfec=video.desktop; video/3gpp=video.desktop; +video/3gpp-tt=video.desktop; video/3gpp2=video.desktop; +video/BMPEG=video.desktop; +video/BT656=video.desktop; +video/CelB=video.desktop; +video/DV=video.desktop; +video/H261=video.desktop; +video/H263=video.desktop; +video/H263-1998=video.desktop; +video/H263-2000=video.desktop; +video/H264=video.desktop; +video/H264-RCDO=video.desktop; +video/H264-SVC=video.desktop; +video/JPEG=video.desktop; +video/MJ2=video.desktop; +video/MP1S=video.desktop; +video/MP2P=video.desktop; +video/MP2T=video.desktop; +video/MP4V-ES=video.desktop; +video/MPV=video.desktop; +video/SMPTE292M=video.desktop; +video/annodex=video.desktop; +video/bmpeg=video.desktop; +video/bt656=video.desktop; +video/celb=video.desktop; +video/dl=video.desktop; +video/dv=video.desktop; +video/example=video.desktop; +video/fli=video.desktop; +video/gl=video.desktop; +video/h261=video.desktop; +video/h263=video.desktop; +video/h263-1998=video.desktop; +video/h263-2000=video.desktop; +video/h264=video.desktop; video/iso.segment=video.desktop; +video/jpeg=video.desktop; +video/jpeg2000=video.desktop; +video/jpm=video.desktop; video/mj2=video.desktop; +video/mp1s=video.desktop; +video/mp2p=video.desktop; +video/mp2t=video.desktop; video/mp4=video.desktop; +video/mp4v-es=video.desktop; video/mpeg=video.desktop; +video/mpeg4-generic=video.desktop; +video/mpv=video.desktop; +video/nv=video.desktop; video/ogg=video.desktop; +video/parityfec=video.desktop; +video/pointer=video.desktop; video/quicktime=video.desktop; +video/raptorfec=video.desktop; +video/raw=video.desktop; +video/rtp-enc-aescm128=video.desktop; +video/rtx=video.desktop; +video/smpte292m=video.desktop; +video/ulpfec=video.desktop; +video/vc1=video.desktop; +video/vnd.CCTV=video.desktop; +video/vnd.cctv=video.desktop; video/vnd.dece.hd=video.desktop; video/vnd.dece.mobile=video.desktop; video/vnd.dece.mp4=video.desktop; video/vnd.dece.pd=video.desktop; video/vnd.dece.sd=video.desktop; video/vnd.dece.video=video.desktop; +video/vnd.directv.mpeg=video.desktop; +video/vnd.directv.mpeg-tts=video.desktop; +video/vnd.dlna.mpeg-tts=video.desktop; video/vnd.dvb.file=video.desktop; video/vnd.fvt=video.desktop; +video/vnd.hns.video=video.desktop; +video/vnd.iptvforum.1dparityfec-1010=video.desktop; +video/vnd.iptvforum.1dparityfec-2005=video.desktop; +video/vnd.iptvforum.2dparityfec-1010=video.desktop; +video/vnd.iptvforum.2dparityfec-2005=video.desktop; +video/vnd.iptvforum.ttsavc=video.desktop; +video/vnd.iptvforum.ttsmpeg2=video.desktop; +video/vnd.motorola.video=video.desktop; +video/vnd.motorola.videop=video.desktop; video/vnd.mpegurl=video.desktop; video/vnd.ms-playready.media.pyv=video.desktop; +video/vnd.mts=video.desktop; video/vnd.nokia.interleaved-multimedia=video.desktop; +video/vnd.nokia.videovoip=video.desktop; +video/vnd.objectvideo=video.desktop; video/vnd.radgamettools.bink=video.desktop; video/vnd.radgamettools.smacker=video.desktop; video/vnd.sealed.mpeg1=video.desktop; video/vnd.sealed.mpeg4=video.desktop; video/vnd.sealed.swf=video.desktop; video/vnd.sealedmedia.softseal.mov=video.desktop; +video/vnd.uvvu.mp4=video.desktop; video/vnd.vivo=video.desktop; video/webm=video.desktop; video/x-annodex=video.desktop; +video/x-f4v=video.desktop; +video/x-fli=video.desktop; video/x-flv=video.desktop; video/x-javafx=video.desktop; +video/x-la-asf=video.desktop; +video/x-m4v=video.desktop; video/x-matroska=video.desktop; video/x-matroska-3d=video.desktop; +video/x-mng=video.desktop; video/x-ms-asf=video.desktop; +video/x-ms-vob=video.desktop; video/x-ms-wm=video.desktop; video/x-ms-wmv=video.desktop; video/x-ms-wmx=video.desktop; video/x-ms-wvx=video.desktop; video/x-msvideo=video.desktop; video/x-sgi-movie=video.desktop; +video/x-smv=video.desktop; +x-scheme-handler/http=browser.desktop; +x-scheme-handler/https=browser.desktop; x-scheme-handler/magnet=torrent.desktop; -x-scheme-handler/mailto=email.desktop; -[Default Applications] -message/rfc822=email.desktop; -x-scheme-handler/magnet=torrent.desktop; -x-scheme-handler/mailto=email.desktop; - +x-scheme-handler/mailto=message.desktop; diff --git a/.config/mimeo/associations.txt b/.config/mimeo/associations.txt index 3466fc1..519b2fe 100644 --- a/.config/mimeo/associations.txt +++ b/.config/mimeo/associations.txt @@ -1,6 +1,3 @@ -chromium %U - ^https?:// - xournalpp %U \.xoj$ \.xopp$ diff --git a/.config/moc/config b/.config/moc/config index b7b469e..c3f7971 100644 --- a/.config/moc/config +++ b/.config/moc/config @@ -1 +1,2 @@ Theme = /home/thedro/.config/moc/themes/terminal +Keymap = keymap diff --git a/.config/moc/keymap b/.config/moc/keymap new file mode 100644 index 0000000..79b54ff --- /dev/null +++ b/.config/moc/keymap @@ -0,0 +1,9 @@ +menu_down = j DOWN +menu_up = k UP +menu_page_down = ^f PAGE_DOWN +menu_page_up = ^b PAGE_UP +menu_first_item = J HOME +menu_last_item = K END +toggle_menu = ^W TAB +toggle_layout = +help = ? diff --git a/.config/nixpkgs/config.nix b/.config/nixpkgs/config.nix index bac5908..5a1ffa3 100644 --- a/.config/nixpkgs/config.nix +++ b/.config/nixpkgs/config.nix @@ -1,49 +1,66 @@ let + pkgs = import <nixpkgs> { }; + + previous = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; }) { }; + stable = import (builtins.fetchTarball { - url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3346.4d0ee90c6e2/nixexprs.tar.xz"; - sha256 = "1hl3ibkqpk0fihppj85fgiin5r6l9jsqmfjbmcqfyjvykh9fy6ag"; }) {}; + url = "https://releases.nixos.org/nixos/23.05/nixos-23.05.861.d3bb401dcfc/nixexprs.tar.xz"; + sha256 = "1b9871if05n92r6acmy46jn6kj583wflp0sgrgfmfmkj3xxsd2i0"; }) { }; unstable = import (builtins.fetchTarball { - url = "https://releases.nixos.org/nixos/unstable/nixos-21.03pre265961.891f607d530/nixexprs.tar.xz"; - sha256 = "1hwwb4n15bbqxnbqffq4kfb369vz65sq74p537fqdp6i4ywpqsyh"; }) {}; + url = "https://releases.nixos.org/nixos/unstable/nixos-23.11pre530560.f5892ddac112/nixexprs.tar.xz"; + sha256 = "0i4hycnrl8m38gyk5qv76wr8zkwd0g9swgwhwhaczrfczskpms31"; }) { }; in { + allowBroken = true; allowUnfree = true; + allowUnsupportedSystem = true; + allowInsecurePredicate = pkgs: true; packageOverrides = pkgs: with stable; { # Machines - Heron = pkgs.buildEnv { - name = "heron"; + Woodpecker = pkgs.buildEnv { + name = "woodpecker"; paths = [ - Terminal Graphical Xorg Awesome Fonts Audio LaTeX - Android JavaScript Python PHP Lua Elixir Html Shell Haskell - Perl Nix C Golang Rust CSS SQL YAML + Terminal Graphical Xorg Wayland Awesome Fonts Audio LaTeX Dictionary Android + JavaScript Python PHP Lua Elixir HTML Shell Haskell Perl Nix C Golang Rust CSS + SQL YAML HTTP Ruby Nim Themes Emulators Clojure Lisp ]; }; Talon = pkgs.buildEnv { - name = "talon"; - paths = [ Heron ]; + name = "talon"; paths = [ Woodpecker ]; + }; + + Heron = pkgs.buildEnv { + name = "heron"; paths = [ Woodpecker ]; }; Ferret = pkgs.buildEnv { name = "ferret"; - paths = [ Terminal Graphical Fonts Xorg Awesome Audio ]; + paths = [ Terminal Graphical Fonts Xorg Awesome Audio Themes ]; }; Tiger = pkgs.buildEnv { name = "tiger"; - paths = [ Nix Terminal Graphical Fonts Xorg Awesome JavaScript Python ]; + paths = [ Nix Terminal Graphical Fonts Xorg Awesome JavaScript Python Themes ]; }; Hound = pkgs.buildEnv { name = "hound"; - paths = [ Terminal Graphical Fonts Xorg Xfce JavaScript Python ]; + paths = [ Terminal Graphical Fonts Xorg Xfce JavaScript Python Themes ]; + }; + + Ant = pkgs.buildEnv { + name = "ant"; + paths = [ Xorg-Aarch64 Xfce-Aarch64 Terminal-Aarch64 Graphical-Aarch64 Themes Fonts ]; }; # Package Sets @@ -51,21 +68,32 @@ in Terminal = pkgs.buildEnv { name = "terminal"; paths = [ - (callPackage ./packages/amfora/default.nix {}) - (callPackage ./packages/chromexup/default.nix {}) - (callPackage ./packages/gmni/default.nix {}) - (callPackage ./packages/literate/default.nix {}) - (callPackage ./packages/systemd2nix/default.nix {}) - (callPackage ./packages/youtube-dl/default.nix {}) - (pass.withExtensions (ext: with ext; [ (callPackage ./packages/pass-import/default.nix {}) pass-audit pass-otp ])) - unstable.emacs - unstable.fzf + (callPackage ./packages/chromexup/package.nix { }) + (callPackage ./packages/emacs-batch-indent/package.nix { }) + (callPackage ./packages/pdf2htmlex/package.nix { }) + (callPackage ./packages/rxvt-unicode/package.nix { }) + (callPackage ./packages/systemd2nix/package.nix { }) + (pass.withExtensions (ext: with ext; [ pass-import pass-audit pass-otp ])) unstable.hugo + unstable.piper-tts + unstable.validator-nu + unstable.vimHugeX + unstable.yt-dlp aerc + alacritty alsaUtils + amfora + ansi2html ansible + atftp + atool bat + bind bleachbit + cava + cloc + csvkit + curlftpfs davmail desktop-file-utils diceware @@ -73,21 +101,27 @@ in docker-compose dtrx electrum + emacs encfs entr - exercism + expect + fdupes ffmpeg flashrom fortune + fzf gettext gifsicle git groff + hexedit + hexyl highlight ideviceinstaller imagemagick img2pdf jpegoptim + jq keychain kjv libqalculate @@ -95,37 +129,48 @@ in mdcat mimeo moc + monolith neofetch + netcat-openbsd + nethogs newsboat nnn + nodePackages.mermaid-cli ocrmypdf pandoc - picotts + pdsh + pipes + plantuml pngnq pngquant poppler_utils - powertop - pulsemixer + pssh + quickemu ranger rclone ripgrep - rxvt-unicode - sbcl + s-tui + sfeed silver-searcher sshfs subversion surfraw tcl + tesseract tmux + toipe trash-cli units vale - vault - vimHugeX + vcal + ventoy-bin + vnstat w3m wavemon weechat + woof xdg-user-dirs + xterm zbar ]; pathsToLink = [ "/etc" "/share" "/bin" ]; @@ -134,83 +179,99 @@ in Graphical = pkgs.buildEnv { name = "graphical"; paths = [ - (callPackage ./packages/boomer/default.nix {}) - (callPackage ./packages/dmenu/default.nix {}) - (callPackage ./packages/gnaural/default.nix {}) - (callPackage ./packages/ntrviewer/default.nix {}) - unstable.nyxt - unstable.tilp2 + (callPackage ./packages/boomer/package.nix { }) + (callPackage ./packages/dmenu/package.nix { }) + (callPackage ./packages/rofi/package.nix { }) + (callPackage ./packages/sowon/package.nix { }) + (mplayer.override { v4lSupport = true; }) + previous.recoll + unstable.firefox + unstable.google-chrome unstable.ungoogled-chromium aegisub anki - audacity blender + claws-mail code-server - copyq + corrscope + dconf diffpdf escrotum evince + exiftool feh - firefox flameshot freerdp + fsearch gImageReader + gcolor2 gimp - gnome3.simple-scan - gnome3.zenity - google-chrome + gnaural gparted + gromit-mpx + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer i3lock-fancy + kcharselect keepassxc krop libnotify libreoffice + liferea mate.engrampa meld - mplayer - mupdf + mupdf_1_17 mypaint - palemoon pavucontrol peek - planner qownnotes qrencode - recoll redshift - rofi scrcpy screenkey - scribus + sent sigil skippy-xd spaceFM + stalonetray sublime3 sxiv syncthing - tabula - thunderbird tigervnc transmission-gtk treesheets - treesheets - unclutter - vimb virt-manager + vlc vscodium - wmctrl xournalpp xsane + yad zathura - zim + zeal + ]; + }; + + Emulators = pkgs.buildEnv { + name = "emulators"; + paths = [ + (callPackage ./packages/ntrviewer/package.nix { }) + (callPackage ./packages/tiemu/package.nix { }) + desmume + mgba ]; - pathsToLink = [ "/share" "/bin" ]; }; Xorg = pkgs.buildEnv { name = "xorg"; paths = [ - (callPackage ./packages/xprintidle/default.nix {}) + previous.x11vnc + autocutsel + glxinfo + unclutter-xfixes + wmctrl + xbindkeys + xdotool xorg.xauth xorg.xev xorg.xf86inputevdev @@ -228,103 +289,152 @@ in xorg.xrdb xorg.xset xorg.xsetroot - glxinfo - x11vnc - xbindkeys - xdotool + xprintidle xsel xzoom ]; }; - Awesome = pkgs.buildEnv { - name = "awesome"; + Wayland = pkgs.buildEnv { + name = "wayland"; paths = [ - (callPackage ./packages/deepin-gtk-theme/default.nix {}) - awesome - lxappearance + (callPackage ./packages/wf-shell/package.nix { }) + wayfire + weston + wev + wofi ]; - pathsToLink = [ "/share" "/bin" ]; + }; + + Awesome = pkgs.buildEnv { + name = "awesome"; + paths = [ awesome ]; }; Xfce = pkgs.buildEnv { name = "xfce"; paths = [ - plank + bamf deadbeef - zuki-themes + dunst + plank polkit_gnome xfce.exo - xfce.gvfs xfce.garcon - xfce.tumbler - xfce.xfwm4 - xfce.xfwm4-themes + xfce.libxfce4ui + xfce.libxfce4util xfce.thunar xfce.thunar-archive-plugin xfce.thunar-volman - xfce.xfconf - xfce.xfdesktop - xfce.libxfce4ui - xfce.libxfce4util xfce.xfce4-session xfce.xfce4-settings + xfce.xfconf + xfce.xfdesktop + xfce.xfwm4 + xfce.xfwm4-themes + zuki-themes ]; }; Fonts = pkgs.buildEnv { name = "fonts"; paths = [ - (callPackage ./packages/nerdfonts-dejavu-sans-mono/default.nix {}) - etBook - ibm-plex - corefonts + (callPackage ./packages/nerdfonts-dejavu-sans-mono/package.nix { }) cm_unicode cooper-hewitt + corefonts + etBook + fira + fira-code + fira-code-symbols + fira-mono font-awesome_4 - yanone-kaffeesatz + ibm-plex + inter noto-fonts noto-fonts-cjk noto-fonts-emoji - fira - fira-code - fira-mono - fira-code-symbols source-code-pro + source-sans-pro source-serif-pro + yanone-kaffeesatz + ]; + }; + + Themes = pkgs.buildEnv { + name = "themes"; + paths = [ + glib + gnome.dconf-editor + gnome.gnome-themes-extra + gtk-engine-murrine + gtk3.dev + librsvg + lxappearance + papirus-icon-theme + qt4 + unstable.nwg-look + vanilla-dmz + ]; + }; + + Dictionary = pkgs.buildEnv { + name = "dictionary"; + paths = [ + (aspellWithDicts (dictionary: [ + dictionary.en + dictionary.en-computers + dictionary.en-science + ])) + hunspell + hunspellDicts.en_US-large + hyphen + mythes ]; }; Audio = pkgs.buildEnv { name = "audio"; - paths = [ ardour cadence qjackctl jack2 ]; + paths = [ + (callPackage ./packages/qprompt/package.nix { }) + ardour + pulseeffects-pw + pulsemixer + qjackctl + tenacity + ]; }; - LaTeX = pkgs.buildEnv { - name = "latex"; - paths = [ gummi texworks texlive.combined.scheme-full ]; + Design = pkgs.buildEnv { + name = "design"; + paths = [ kicad freecadStable openscad librecad ]; }; Android = pkgs.buildEnv { name = "android"; paths = [ - (callPackage ./packages/edl/default.nix {}) - (callPackage ./packages/mkbootfs/default.nix {}) - (callPackage ./packages/mkbootimg/default.nix {}) + (callPackage ./packages/mkbootfs/package.nix { }) + (callPackage ./packages/mkbootimg/package.nix { }) + edl abootimg ]; }; + LaTeX = pkgs.buildEnv { + name = "latex"; + paths = [ gummi texlive.combined.scheme-full texworks ]; + }; + JavaScript = pkgs.buildEnv { name = "javascript"; paths = [ - nodejs-14_x unstable.deno - nodePackages.bower2nix + unstable.swc + esbuild nodePackages.eslint nodePackages.jsonlint - nodePackages.node2nix nodePackages.prettier + nodejs ]; pathsToLink = [ "/bin" ]; }; @@ -332,64 +442,94 @@ in Python = pkgs.buildEnv { name = "python"; paths = [ - (python38.withPackages (ps: with ps; [ bandit black mypy pyflakes pylint ])) + (python39.withPackages (ps: with ps; [ + bandit + black + flake8 + mypy + pyflakes + pygments + pylint + ])) + ruff ]; }; PHP = pkgs.buildEnv { name = "php"; paths = [ - php74 - php74Packages.psysh - php74Packages.psalm - php74Packages.phpcbf - php74Packages.phpstan - php74Packages.composer + (php.buildEnv { + extensions = ({ enabled, all }: enabled ++ (with all; [ xdebug ])); + extraConfig = '' + xdebug.mode=develop,debug + xdebug.start_with_request=yes + ''; + }) + (callPackage ./packages/phar-composer/package.nix { }) + graphviz + kcachegrind + phpPackages.composer + phpPackages.phpcbf + phpPackages.phpstan + phpPackages.psalm + phpPackages.psysh ]; }; Lua = pkgs.buildEnv { name = "lua"; paths = [ - (callPackage ./packages/luaformatter/default.nix {}) - lua5_3 - lua53Packages.luacheck + (callPackage ./packages/redbean/package.nix { }) + lua + luaPackages.luacheck + luaformatter ]; }; Elixir = pkgs.buildEnv { name = "elixir"; - paths = [ elixir_1_10 ]; + paths = [ elixir ]; }; - Html = pkgs.buildEnv { + HTML = pkgs.buildEnv { name = "html"; paths = [ html-tidy html-xml-utils libxml2 + libxslt xmlstarlet ]; }; Shell = pkgs.buildEnv { name = "shell"; - paths = [ bats dash shellcheck shfmt ]; + paths = [ dash fish bats shellcheck shfmt ]; }; Haskell = pkgs.buildEnv { name = "haskell"; - paths = [ ghc ghcid haskellPackages.hlint haskellPackages.brittany ]; + paths = [ ghc ghcid haskellPackages.hlint previous.haskellPackages.brittany ]; + }; + + Clojure = pkgs.buildEnv { + name = "clojure"; + paths = [ clojure leiningen ]; }; Perl = pkgs.buildEnv { name = "perl"; - paths = [ rakudo perl530 perl530Packages.PerlCritic perl530Packages.PerlTidy ]; + paths = [ rakudo (perl.withPackages (ps: with ps; [ PerlCritic PerlTidy TextLorem LaTeXML ])) ]; }; Nix = pkgs.buildEnv { name = "nix"; - paths = [ nixos-generators nix-index nix-linter nixfmt nixpkgs-fmt nixpkgs-lint ]; + paths = [ nix-index previous.nix-linter nixfmt nixpkgs-fmt nixpkgs-lint ]; + }; + + Ruby = pkgs.buildEnv { + name = "ruby"; + paths = [ rubocop ruby ]; }; C = pkgs.buildEnv { @@ -399,7 +539,7 @@ in Golang = pkgs.buildEnv { name = "golang"; - paths = [ go unstable.gore ]; + paths = [ go gore ]; }; Rust = pkgs.buildEnv { @@ -407,32 +547,143 @@ in paths = [ evcxr rustup ]; }; + Nim = pkgs.buildEnv { + name = "nim"; + paths = [ nim ]; + }; + + Lisp = pkgs.buildEnv { + name = "lisp"; + paths = [ + (pkgs.writeScriptBin "guile" '' + export GUILE_LOAD_PATH="${pkgs.lib.concatStrings [ + "${unstable.guile-gnutls}/share/guile/site/3.0:" + "$GUILE_LOAD_PATH" + ]}" + ${unstable.guile_3_0}/bin/guile "$@" + '') + sbcl + ]; + }; + + HTTP = pkgs.buildEnv { + name = "http"; + paths = [ caddy apacheHttpd httpie ]; + }; + CSS = pkgs.buildEnv { name = "css"; paths = [ - (callPackage ./packages/csstidy/default.nix {}) + (previous.callPackage ./packages/csstidy/package.nix { }) + nodePackages.stylelint csslint + sassc ]; }; SQL = pkgs.buildEnv { name = "sql"; paths = [ - (callPackage ./packages/skeema/default.nix {}) - (callPackage ./packages/sqldef/default.nix {}) - (callPackage ./packages/sqlfluff/default.nix {}) - dbeaver pgformatter + skeema + sqlfluff sqlint sqlite + sqlitebrowser + unstable.sqldef ]; }; YAML = pkgs.buildEnv { name = "yaml"; paths = [ - (callPackage ./packages/ruamel.yaml.cmd/default.nix {}) - python38Packages.yamllint + (previous.callPackage ./packages/yaml2nix/package.nix { }) + (callPackage ./packages/ruamel.yaml.cmd/package.nix { }) + python39Packages.yamllint + yj + ]; + }; + + Xorg-Aarch64 = pkgs.buildEnv { + name = "xorg-aarch64"; + paths = [ + glxinfo + unclutter-xfixes + wmctrl + x11vnc + xbindkeys + xdotool + xorg.xauth + xorg.xev + xorg.xf86inputevdev + xorg.xf86inputlibinput + xorg.xf86videofbdev + xorg.xinit + xorg.xinput + xorg.xmodmap + xorg.xorgserver + xorg.xrandr + xorg.xrdb + xorg.xset + xorg.xsetroot + xprintidle + xsel + xzoom + ]; + }; + + Xfce-Aarch64 = pkgs.buildEnv { + name = "xfce-aarch64"; + paths = [ + bamf + dunst + polkit_gnome + xfce.exo + xfce.garcon + xfce.libxfce4ui + xfce.libxfce4util + xfce.thunar + xfce.thunar-archive-plugin + xfce.thunar-volman + xfce.xfce4-session + xfce.xfce4-settings + xfce.xfconf + xfce.xfdesktop + xfce.xfwm4 + xfce.xfwm4-themes + zuki-themes + ]; + }; + + Graphical-Aarch64 = pkgs.buildEnv { + name = "graphical-aarch64"; + paths = [ + unstable.firefox + unstable.ungoogled-chromium + audacity + freerdp + fsearch + galculator + gpicview + pavucontrol + pcmanfm + sylpheed + xsane + ]; + }; + + Terminal-Aarch64 = pkgs.buildEnv { + name = "terminal-aarch64"; + paths = [ + unstable.vimHugeX + alsaUtils + fzf + libnotify + redshift + rofi + rxvt-unicode + skippy-xd + tigervnc ]; }; }; diff --git a/.config/nixpkgs/packages/amfora/default.nix b/.config/nixpkgs/packages/amfora/default.nix deleted file mode 100644 index 5c35b37..0000000 --- a/.config/nixpkgs/packages/amfora/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenv, fetchgit, buildGoModule }: - -buildGoModule rec { - pname = "amfora"; - version = "v1.6.0"; - url = "https://github.com/makeworld-the-better-one/amfora"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "1f5r12hmdgj26p4ss5pcpfcvqlcn19fr9xvvvk2izckcr48p4fy7"; - }; - - vendorSha256 = "0mkk7xxfxxp1w9890mkmag11mzxhy2zmh8v1macpyp1zmzgs21f8"; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.gpl3; - description = "A fancy terminal browser for the Gemini protocol."; - }; -} diff --git a/.config/nixpkgs/packages/boomer/default.nix b/.config/nixpkgs/packages/boomer/package.nix index 417aa22..885de27 100644 --- a/.config/nixpkgs/packages/boomer/default.nix +++ b/.config/nixpkgs/packages/boomer/package.nix @@ -1,17 +1,15 @@ -{ stdenv, fetchFromGitHub, makeWrapper, nim, libX11, libXrandr, libGL }: +{ lib, stdenv, fetchgit, makeWrapper, nim, libX11, libXrandr, libGL }: let - x11-nim = fetchFromGitHub { - repo = "x11"; - owner = "nim-lang"; + x11-nim = fetchgit { + url = "https://github.com/nim-lang/x11"; rev = "b7bae7dffa4e3f12370d5a18209359422ae8bedd"; sha256 = "1j3kyp0vf2jl20c67gcm759jnfskdf0wc4ajrdbvfxias285c5sb"; }; - opengl-nim = fetchFromGitHub { - repo = "opengl"; - owner = "nim-lang"; + opengl-nim = fetchgit { + url = "https://github.com/nim-lang/opengl"; rev = "a6fb649e5bd94d8420d4a11287092a4dc3e922b4"; sha256 = "0w62lfrdms2vb24kd4jnypwmqvdk5x9my1dinnqdq82yl4nz6d0s"; }; @@ -19,12 +17,12 @@ let in stdenv.mkDerivation rec { pname = "boomer"; - version = "d16c65ce3eae31f4c77de1585b340d8d624c1252"; - src = fetchFromGitHub { - owner = "tsoding"; - repo = "boomer"; + version = "cc0f5311193da8361ee782a421d6bc4ad8541cf3"; + + src = fetchgit { + url = "https://github.com/tsoding/boomer"; rev = version; - sha256 = "1kqfg2i5p1zrvl9jx0ig7f0ckxnaxi9svr0bs52aavwydldnnl8d"; + sha256 = "sha256-3yg0nuJE0Rrw13VEQ/CjjjPN5G4ytssgiesdXwlHaF8="; }; buildInputs = [ nim libX11 libXrandr libGL makeWrapper ]; @@ -44,14 +42,12 @@ in stdenv.mkDerivation rec { fixupPhase = '' runHook preFixup - patchelf --set-rpath ${ - stdenv.lib.makeLibraryPath [ stdenv.cc.cc libX11 libXrandr libGL ] - } $out/bin/boomer + patchelf --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc libX11 libXrandr libGL ]} $out/bin/boomer wrapProgram "$out/bin/boomer" --set LIBGL_ALWAYS_SOFTWARE 1 runHook postFixup ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.mit; platforms = platforms.linux; homepage = "https://github.com/tsoding/boomer"; diff --git a/.config/nixpkgs/packages/chromexup/default.nix b/.config/nixpkgs/packages/chromexup/package.nix index 78d974b..c6c4622 100644 --- a/.config/nixpkgs/packages/chromexup/default.nix +++ b/.config/nixpkgs/packages/chromexup/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, python38 }: +{ lib, fetchgit, python38 }: with python38.pkgs; @@ -20,7 +20,7 @@ buildPythonApplication rec { cp -rT scripts/systemd $out ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.mit; inherit (src.meta) homepage; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/csstidy/default.nix b/.config/nixpkgs/packages/csstidy/package.nix index 7e9a8d0..5ccf7ff 100644 --- a/.config/nixpkgs/packages/csstidy/default.nix +++ b/.config/nixpkgs/packages/csstidy/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, sconsPackages, gcc }: +{ lib, stdenv, fetchgit, sconsPackages, gcc }: stdenv.mkDerivation rec { @@ -14,15 +14,17 @@ stdenv.mkDerivation rec { buildInputs = [ sconsPackages.scons_3_0_1 ]; preBuild = '' - sed -i "/env = Environment()/a env.Replace(CXX='${gcc}/bin/g++')" SConstruct + sed --in-place "/env = Environment()/a env.Replace(CXX='${gcc}/bin/g++')" SConstruct ''; installPhase = '' - mkdir -p $out/bin + runHook preInstall + mkdir --parents $out/bin cp release/csstidy/csstidy $out/bin + runHook postInstall ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.lgpl21; inherit (src.meta) homepage; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/deepin-gtk-theme/default.nix b/.config/nixpkgs/packages/deepin-gtk-theme/default.nix deleted file mode 100644 index bdddc28..0000000 --- a/.config/nixpkgs/packages/deepin-gtk-theme/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ stdenv, fetchFromGitHub, gtk-engine-murrine }: - -stdenv.mkDerivation rec { - name = "deepin-gtk-theme-${version}"; - version = "17.10.5"; - - src = fetchFromGitHub { - owner = "linuxdeepin"; - repo = "deepin-gtk-theme"; - rev = version; - sha256 = "0ff1yg4gz4p7nd0qg3dcbsiw8yqlvqccm55kxi998w8j1wrg6pq3"; - }; - - propagatedUserEnvPkgs = [ gtk-engine-murrine ]; - - makeFlags = [ "PREFIX=$(out)" ]; - - meta = { - description = "Deepin GTK Theme"; - homepage = https://github.com/linuxdeepin/deepin-gtk-theme; - license = stdenv.lib.licenses.lgpl3; - platforms = stdenv.lib.platforms.unix; - maintainers = [ stdenv.lib.maintainers.romildo ]; - }; -} diff --git a/.config/nixpkgs/packages/dmenu/default.nix b/.config/nixpkgs/packages/dmenu/default.nix deleted file mode 100644 index 2ac9664..0000000 --- a/.config/nixpkgs/packages/dmenu/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ stdenv, fetchurl, libX11, libXinerama, libXft, zlib, fetchpatch }: - -stdenv.mkDerivation rec { - name = "dmenu-4.9"; - - src = fetchurl { - url = "https://dl.suckless.org/tools/${name}.tar.gz"; - sha256 = "0ia9nqr83bv6x247q30bal0v42chcj9qcjgv59xs6xj46m7iz5xk"; - }; - - buildInputs = [ libX11 libXinerama zlib libXft ]; - - patches = [ - (fetchpatch { - name = "dmenu-xresources-4.9.patch"; - url = "https://tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff"; - sha256 = "0clczp17zwkxy1qhy0inqjplxpq4mgaf4vvfvn063hk733r4i7rn"; - }) - (fetchpatch { - name = "xim.patch"; - url = "https://raw.githubusercontent.com/NixOS/nixpkgs/1f16d0496ce86d4c903e2e4ed6cbe4e952a7196f/pkgs/applications/misc/dmenu/xim.patch"; - sha256 = "006np7hlhr11wmj9652fcvacrw1fnv4w8hdlm80pyn0vn1wjdkw6"; - }) - ]; - - postPatch = '' - sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run - sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path - ''; - - preConfigure = '' - sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk - ''; - - makeFlags = [ "CC:=$(CC)" ]; - - meta = with stdenv.lib; { - license = licenses.mit; - platforms = platforms.all; - homepage = "https://tools.suckless.org/dmenu"; - maintainers = with maintainers; [ pSub globin ]; - description = "A generic, highly customizable, and efficient menu for the X Window System"; - }; -} diff --git a/.config/nixpkgs/packages/dmenu/package.nix b/.config/nixpkgs/packages/dmenu/package.nix new file mode 100644 index 0000000..f0f933c --- /dev/null +++ b/.config/nixpkgs/packages/dmenu/package.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchgit, libX11, libXinerama, libXft, zlib }: + +stdenv.mkDerivation rec { + name = "dmenu"; + version = "9b0be7712e2aae65b459f758a080c56983056021"; + + src = fetchgit { + rev = version; + url = "https://www.thedroneely.com/git/thedroneely/dmenu/"; + sha256 = "0sbwwxbm5bcn0m4s1y2gl90wc224kf6755d1xdr23bz5ihy3jzg2"; + }; + + buildInputs = [ libX11 libXinerama zlib libXft ]; + + postPatch = '' + sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run + sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path + ''; + + preConfigure = '' + sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk + ''; + + makeFlags = [ "CC:=$(CC)" ]; + + meta = { + license = lib.licenses.mit; + platforms = lib.platforms.all; + homepage = "https://tools.suckless.org/dmenu"; + description = "A generic, highly customizable, and efficient menu for the X Window System"; + }; +} diff --git a/.config/nixpkgs/packages/edl/default.nix b/.config/nixpkgs/packages/edl/default.nix deleted file mode 100644 index 1830afa..0000000 --- a/.config/nixpkgs/packages/edl/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ stdenv, fetchgit, python38 }: - -python38.pkgs.buildPythonApplication rec { - - pname = "edl"; - url = "https://github.com/bkerler/edl.git"; - version = "6ca9feb8ac7b260a0395d4f51e9e91fc0feda058"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "1lpgamg6wkwpj3mxcn8nrxxw90svx5xy3kahk8rdf09ph6wlii4x"; - }; - - doCheck = false; - dontBuild = true; - - propagatedBuildInputs = with python38.pkgs; [ - pyusb - pyserial - docopt - pycryptodome - qrcode - ]; - - pythonEnv = python38.withPackages (ps: with ps; propagatedBuildInputs); - - installPhase = '' - mkdir -p $out/share/edl - cp -rT ${src} $out/share/edl - makeWrapper ${pythonEnv}/bin/python $out/bin/edl --add-flags $out/share/edl/edl.py - makeWrapper ${pythonEnv}/bin/python $out/bin/edl-diag --add-flags $out/share/edl/diag.py - makeWrapper ${pythonEnv}/bin/python $out/bin/edl-tcpclient --add-flags $out/share/edl/tcpclient.py - makeWrapper ${pythonEnv}/bin/python $out/bin/edl-fhloaderparse --add-flags $out/share/edl/fhloaderparse.py - ''; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.mit; - platforms = platforms.linux; - description = "QC Firehose / Sahara Client / QC Diag Tools :)"; - }; -} diff --git a/.config/nixpkgs/packages/emacs-batch-indent/package.nix b/.config/nixpkgs/packages/emacs-batch-indent/package.nix new file mode 100644 index 0000000..92042af --- /dev/null +++ b/.config/nixpkgs/packages/emacs-batch-indent/package.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit }: + +stdenv.mkDerivation rec { + + name = "emacs-batch-indent"; + version = "145e8771b9709a82e3df82cdc06c6d9505de905d"; + url = "https://github.com/cwfoo/emacs-batch-indent"; + + src = fetchgit { + inherit url; + rev = version; + sha256 = "sha256-Qqg/ZLbfTZnH2aO7ZW2XiiVBqEvK2+LMo2Kz6HSnOCE="; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp emacs-batch-indent $out/bin + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + license = licenses.gpl3; + platforms = platforms.linux; + description = "Indent Common Lisp, Emacs Lisp, and Scheme from the command line using Emacs."; + }; +} diff --git a/.config/nixpkgs/packages/gmni/default.nix b/.config/nixpkgs/packages/gmni/default.nix deleted file mode 100644 index 573c9df..0000000 --- a/.config/nixpkgs/packages/gmni/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenv, fetchgit, pkg-config, openssl }: - -stdenv.mkDerivation rec { - pname = "gmni"; - version = "f5d540bc5d0112895376aebe6bf54adb32545d6e"; - url = "https://git.sr.ht/~sircmpwn/gmni"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "0x4bg7mffq7vj9f3dj3s0m7q6f18nrysl68x6dlzk74hj6wsslbc"; - }; - - buildInputs = [ pkg-config openssl ]; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.gpl3; - description = "A Gemini client"; - }; -} diff --git a/.config/nixpkgs/packages/gnaural/default.nix b/.config/nixpkgs/packages/gnaural/default.nix deleted file mode 100644 index 4324736..0000000 --- a/.config/nixpkgs/packages/gnaural/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, fetchurl, portaudio, libsndfile, pkg-config, gtk2, gcc48 }: - -stdenv.mkDerivation rec { - - pname = "gnaural"; - version = "20110606"; - - src = fetchurl { - url = "https://iweb.dl.sourceforge.net/project/gnaural/Gnaural/gnaural_${version}.tar.xz"; - sha256 = "1gq519c0imsh57zklyi0f8h64l3ai48lh672c834470z8c6kvbfi"; - }; - - patches = [ - (fetchurl { - name = "gnaural.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/gnaural.patch?h=gnaural"; - sha256 = "15bplxcvjml8cz7pi2fwb444fpp7ypsh279642v8s9hgl3i3jvsz"; - }) - ]; - - buildInputs = [ gcc48 portaudio pkg-config gtk2 libsndfile ]; - - meta = with stdenv.lib; { - license = licenses.gpl2; - platforms = platforms.linux; - homepage = "http://gnaural.sourceforge.net/"; - description = "Auditory binaural-beat generator"; - }; -} diff --git a/.config/nixpkgs/packages/literate/default.nix b/.config/nixpkgs/packages/literate/default.nix deleted file mode 100644 index f5be32e..0000000 --- a/.config/nixpkgs/packages/literate/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchgit, dmd, dub }: - -stdenv.mkDerivation rec { - name = "Literate"; - version = "7004dffec0cff3068828514eca72172274fd3f7d"; - - src = fetchgit { - rev = version; - url = "https://github.com/zyedidia/Literate.git"; - sha256 = "0x4xgrdskybaa7ssv81grmwyc1k167v3nwj320jvp5l59xxlbcvs"; - }; - - buildInputs = [ dmd dub ]; - - installPhase = "install -D bin/lit $out/bin/lit"; - - meta = with stdenv.lib; { - description = "A literate programming tool for any language"; - homepage = "http://literate.zbyedidia.webfactional.com/"; - license = licenses.mit; - platforms = platforms.unix; - }; -} diff --git a/.config/nixpkgs/packages/luaformatter/default.nix b/.config/nixpkgs/packages/luaformatter/default.nix deleted file mode 100644 index 88bbc9f..0000000 --- a/.config/nixpkgs/packages/luaformatter/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchFromGitHub, cmake }: - -stdenv.mkDerivation rec { - pname = "LuaFormatter"; - version = "1.3.3"; - - src = fetchFromGitHub { - sha256 = "1dfqsh6v8brnwzg3lgi7228lw08qqfy4ghbjyvwn7mr82fy1xcnd"; - rev = version; - repo = pname; - owner = "Koihik"; - fetchSubmodules = true; - }; - - buildInputs = [ cmake ]; - - meta = with stdenv.lib; { - inherit (src.meta) homepage; - description = "Code formatter for Lua"; - license = licenses.asl20; - platforms = platforms.linux; - }; -} diff --git a/.config/nixpkgs/packages/mkbootfs/default.nix b/.config/nixpkgs/packages/mkbootfs/package.nix index 379bb8c..b8c6050 100644 --- a/.config/nixpkgs/packages/mkbootfs/default.nix +++ b/.config/nixpkgs/packages/mkbootfs/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit }: +{ lib, stdenv, fetchgit }: stdenv.mkDerivation rec { @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { cp mkbootfs $out/bin ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = url; platforms = platforms.linux; license = licenses.unlicense; diff --git a/.config/nixpkgs/packages/mkbootimg/default.nix b/.config/nixpkgs/packages/mkbootimg/package.nix index 40be21d..738fd33 100644 --- a/.config/nixpkgs/packages/mkbootimg/default.nix +++ b/.config/nixpkgs/packages/mkbootimg/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit }: +{ lib, stdenv, fetchgit }: stdenv.mkDerivation rec { @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { cp unpackbootimg $out/bin ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = url; platforms = platforms.linux; license = licenses.unlicense; diff --git a/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/default.nix b/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/package.nix index 18d3b15..866a6af 100644 --- a/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/default.nix +++ b/.config/nixpkgs/packages/nerdfonts-dejavu-sans-mono/package.nix @@ -1,10 +1,9 @@ -{ stdenv, fetchurl, unzip }: +{ lib, stdenv, fetchurl, unzip }: stdenv.mkDerivation rec { pname = "nerdfonts-dejavu-sans-mono"; version = "2.1.0"; - buildInputs = [ unzip ]; src = fetchurl { @@ -13,23 +12,18 @@ stdenv.mkDerivation rec { }; phases = [ "unpackPhase" "installPhase" ]; - unpackPhase = '' unzip ${src} ''; installPhase = '' - mkdir -p $out/share/fonts/nerdfonts-dejavu-sans-mono - cp -r * $out/share/fonts/nerdfonts-dejavu-sans-mono + runHook preInstall + mkdir --parents $out/share/fonts/nerdfonts-dejavu-sans-mono + cp --recursive * $out/share/fonts/nerdfonts-dejavu-sans-mono + runHook postInstall ''; - meta = with stdenv.lib; { - description = '' - Nerd Fonts is a project that attempts to patch as many developer targeted - and/or used fonts as possible. The patch is to specifically add a high - number of additional glyphs from popular 'iconic fonts' such as Font - Awesome, Devicons, Octicons, and others. - ''; - homepage = "https://github.com/ryanoasis/nerd-fonts"; + meta = with lib; { license = licenses.mit; platforms = platforms.all; + homepage = "https://github.com/ryanoasis/nerd-fonts"; }; } diff --git a/.config/nixpkgs/packages/nixpkgs.lib/package.nix b/.config/nixpkgs/packages/nixpkgs.lib/package.nix new file mode 100644 index 0000000..6f5c4e8 --- /dev/null +++ b/.config/nixpkgs/packages/nixpkgs.lib/package.nix @@ -0,0 +1,59 @@ +{ lib, stdenv, fetchgit, writeTextFile }: + +stdenv.mkDerivation rec { + + pname = "nixpkgs.lib"; + version = "f9d58ee370835f4c658cd0a62e8def4bda8b1f32"; + + src = fetchgit { + url = "https://github.com/nix-community/nixpkgs.lib.git"; + sha256 = "sha256-KnumcE6UuNQPapsr32KjcRVDVuRGWB5PnAczHoo9nJc="; + rev = version; + }; + + installPhase = '' + runHook preInstall + mkdir --parents $out + cp --recursive --no-target-directory $src $out + runHook postInstall + ''; + + patches = [ + (writeTextFile { + name = "remove-nonexistent-external-calls.patch"; + text = '' + --- a/lib/default.nix + +++ b/lib/default.nix + @@ -24,8 +24,8 @@ let + # packaging + customisation = callLibs ./customisation.nix; + derivations = callLibs ./derivations.nix; + - maintainers = import ../maintainers/maintainer-list.nix; + - teams = callLibs ../maintainers/team-list.nix; + + maintainers = { }; + + teams = { }; + meta = callLibs ./meta.nix; + sources = callLibs ./sources.nix; + versions = callLibs ./versions.nix; + diff --git a/lib/trivial.nix b/lib/trivial.nix + index 5d4fad8..d679563 100644 + --- a/lib/trivial.nix + +++ b/lib/trivial.nix + @@ -164,7 +164,7 @@ rec { + version = release + versionSuffix; + + /* Returns the current nixpkgs release number as string. */ + - release = lib.strings.fileContents ../.version; + + release = ""; + + /* The latest release that is supported, at the time of release branch-off, + if applicable. + ''; + }) + ]; + + meta = with lib; { + description = "nixpkgs lib for cheap instantiation "; + homepage = "https://github.com/nix-community/nixpkgs.lib"; + }; +} diff --git a/.config/nixpkgs/packages/ntrviewer/default.nix b/.config/nixpkgs/packages/ntrviewer/package.nix index 6a754bf..af155bf 100644 --- a/.config/nixpkgs/packages/ntrviewer/default.nix +++ b/.config/nixpkgs/packages/ntrviewer/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, fetchpatch, libjpeg, ffmpeg, SDL }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, libjpeg, ffmpeg, SDL }: stdenv.mkDerivation rec { pname = "ntrviewer"; @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { patches = [ (fetchpatch { name = "ntrviewer.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/ntrviewer.patch?h=ntrviewer-git"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/ntrviewer.patch?h=ntrviewer-git&id=7ae6776d6db1476ee9df8cac7a933167a1bc3d25"; sha256 = "0lw1zmm4fdjb09iqsw593pdv4p36q77zq5lb2qh0xqcaf2ll84z5"; }) ]; @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { runHook postInstall ''; - meta = with stdenv.lib; { + meta = with lib; { license = licenses.gpl3; inherit (src.meta) homepage; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/pass-import/default.nix b/.config/nixpkgs/packages/pass-import/default.nix deleted file mode 100644 index 78dded4..0000000 --- a/.config/nixpkgs/packages/pass-import/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ stdenv, pass, fetchFromGitHub, python38, makeWrapper, fetchpatch }: - -with python38.pkgs; - -let - - pythonEnv = pythonPackages.python.withPackages (_: [ - defusedxml - setuptools - pyaml - pykeepass - filemagic - cryptography - secretstorage - ]); - -in stdenv.mkDerivation rec { - pname = "pass-import"; - version = "a8f56cc6a85362ed20f46c1360c87fdd213b890c"; - - src = fetchFromGitHub { - owner = "roddhjav"; - repo = "pass-import"; - rev = version; - sha256 = "0hg40fqnss9n31ns8lc8v1h9hjdw4qjg68xs0hm6c9njabahl1pq"; - }; - - dontBuild = true; - buildInputs = [ pythonEnv ]; - nativeBuildInputs = [ makeWrapper ]; - - patches = [ - # https://github.com/roddhjav/pass-import/pull/91 - (fetchpatch { - url = "https://github.com/roddhjav/pass-import/commit/6ccaf639e92df45bd400503757ae4aa2c5c030d7.patch"; - sha256 = "0lw9vqvbqcy96s7v7nz0i1bdx93x7qr13azymqypcdhjwmq9i63h"; - }) - ]; - - postPatch = '' - sed -i -e 's|$0|${pass}/bin/pass|' import.bash - ''; - - installFlags = [ "PREFIX=$(out)" "BASHCOMPDIR=$(out)/etc/bash_completion.d" ]; - - postFixup = '' - install -D pass_import.py $out/${pythonPackages.python.sitePackages}/pass_import.py - wrapProgram $out/lib/password-store/extensions/import.bash \ - --prefix PATH : "${pythonEnv}/bin" \ - --prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}" \ - --run "export PREFIX" - ''; - - meta = with stdenv.lib; { - description = "Pass extension for importing data from existing password managers"; - homepage = "https://github.com/roddhjav/pass-import"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ lovek323 the-kenny fpletz tadfisher ]; - platforms = platforms.unix; - }; -} diff --git a/.config/nixpkgs/packages/pdf2htmlex/package.nix b/.config/nixpkgs/packages/pdf2htmlex/package.nix new file mode 100644 index 0000000..82021ef --- /dev/null +++ b/.config/nixpkgs/packages/pdf2htmlex/package.nix @@ -0,0 +1,17 @@ +{ lib, fetchurl, appimageTools }: + +appimageTools.wrapType2 rec { + name = "pdf2htmlex"; + version = "0.18.8.rc1"; + + src = fetchurl { + url = "https://github.com/pdf2htmlEX/pdf2htmlEX/releases/download/v${version}/pdf2htmlEX-${version}-master-20200630-Ubuntu-focal-x86_64.AppImage"; + sha256 = "sha256-Ed4lg6Orzl8UH9f6+x/qLGexWIblRta3Z1xgABLmq4w="; + }; + + meta = with lib; { + license = licenses.gpl3; + platforms = platforms.linux; + description = "Convert PDF to HTML without losing text or format. "; + }; +} diff --git a/.config/nixpkgs/packages/phar-composer/package.nix b/.config/nixpkgs/packages/phar-composer/package.nix new file mode 100644 index 0000000..79ee71b --- /dev/null +++ b/.config/nixpkgs/packages/phar-composer/package.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, makeWrapper, lib, php }: + +stdenv.mkDerivation rec { + + pname = "phar-composer"; + version = "1.4.0"; + + src = fetchurl { + url = "https://github.com/clue/${pname}/releases/download/v${version}/${pname}-${version}.phar"; + sha256 = "sha256-GUKo/l8b0UkQpGHsyagjgtAkZbfmjdhWOXkZT5vLB8A="; + }; + + dontUnpack = true; + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + install -D $src $out/libexec/${pname}/${pname}.phar + makeWrapper ${php}/bin/php $out/bin/${pname} --add-flags "$out/libexec/${pname}/${pname}.phar" + runHook postInstall + ''; + + meta = { + license = lib.licenses.mit; + homepage = "https://github.com/clue/phar-composer#readme"; + description = "Simple phar creation for every PHP project managed via Composer."; + }; +} diff --git a/.config/nixpkgs/packages/qprompt/package.nix b/.config/nixpkgs/packages/qprompt/package.nix new file mode 100644 index 0000000..67a4c83 --- /dev/null +++ b/.config/nixpkgs/packages/qprompt/package.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit, cmake, extra-cmake-modules, qt5, libsForQt5 }: + +stdenv.mkDerivation rec { + name = "qprompt"; + version = "v1.1.2"; + + src = fetchgit { + rev = version; + url = "https://github.com/Cuperino/QPrompt.git"; + sha256 = "sha256-EeLJC77X9lcjvbr+TkIpMHO0YFdI91tiVUplde3wEzA="; + }; + + buildInputs = [ + cmake + extra-cmake-modules + qt5.wrapQtAppsHook + qt5.qtquickcontrols2.dev + qt5.qtx11extras.dev + libsForQt5.ki18n.dev + libsForQt5.kcoreaddons.dev + libsForQt5.kiconthemes.dev + libsForQt5.kirigami2.dev + ]; + + meta = { + license = with lib.licenses; [ gpl3 cc-by-sa-40 ]; + homepage = "https://github.com/Cuperino/QPrompt#qprompt"; + description = "Personal teleprompter software for all video creators."; + }; +} diff --git a/.config/nixpkgs/packages/redbean/package.nix b/.config/nixpkgs/packages/redbean/package.nix new file mode 100644 index 0000000..7ede4c6 --- /dev/null +++ b/.config/nixpkgs/packages/redbean/package.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + + pname = "redbean"; + version = "2.0.1"; + + src = fetchurl { + url = "https://redbean.dev/redbean-${version}.com"; + sha256 = "sha256-W5GpecQdDwawkrkmENxSqCz40PkyrLh34FtiUwD7Kzk="; + }; + + dontFixup = true; + dontUnpack = true; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp ${src} $out/bin/${pname}.com + chmod +x $out/bin/${pname}.com + runHook postInstall + ''; + + meta = with lib; { + license = licenses.isc; + platforms = platforms.all; + homepage = "https://github.com/jart/cosmopolitan"; + }; +} diff --git a/.config/nixpkgs/packages/rofi/package.nix b/.config/nixpkgs/packages/rofi/package.nix new file mode 100644 index 0000000..420d2d2 --- /dev/null +++ b/.config/nixpkgs/packages/rofi/package.nix @@ -0,0 +1,49 @@ +{ stdenv, lib, fetchgit, autoreconfHook, pkg-config, libxkbcommon, pango +, which, git, cairo, libxcb, xcbutil, xcbutilwm, xcbutilxrm, xcb-util-cursor +, libstartup_notification, bison, flex, librsvg, check }: + +stdenv.mkDerivation rec { + pname = "rofi-unwrapped"; + version = "1.7.0"; + + src = fetchgit { + rev = version; + fetchSubmodules = true; + url = "https://github.com/davatorium/rofi.git"; + sha256 = "03wdy56b3g8p2czb0qydrddyyhj3x037pirnhyqr5qbfczb9a63v"; + }; + + preConfigure = '' + patchShebangs "script" + # root not present in build /etc/passwd + sed -i 's/~root/~nobody/g' test/helper-expand.c + ''; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ + libxkbcommon + pango + cairo + git + bison + flex + librsvg + check + libstartup_notification + libxcb + xcbutil + xcbutilwm + xcbutilxrm + xcb-util-cursor + which + ]; + + doCheck = false; + + meta = with lib; { + license = licenses.mit; + platforms = with platforms; linux; + homepage = "https://github.com/davatorium/rofi"; + description = "Window switcher, run dialog and dmenu replacement"; + }; +} diff --git a/.config/nixpkgs/packages/ruamel.yaml.cmd/default.nix b/.config/nixpkgs/packages/ruamel.yaml.cmd/default.nix deleted file mode 100644 index f2dc6f9..0000000 --- a/.config/nixpkgs/packages/ruamel.yaml.cmd/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ stdenv, python38 }: - -with python38.pkgs; - -let - - meta = with stdenv.lib; { - license = licenses.mit; - description = "Command line utility to manipulate YAML files"; - homepage = "https://sourceforge.net/p/ruamel-yaml-cmd/code/ci/default/tree"; - }; - - ruamel.std.argparse = buildPythonPackage rec { - pname = "ruamel.std.argparse"; - version = "0.8.3"; - src = fetchPypi { - inherit pname version; - sha256 = "0srv4g6jryyaz26csx315pbmfhm4rw8jhfsl7rq7krrglgqwjryi"; - }; - doCheck = false; - inherit meta; - }; - - ruamel.std.convert = buildPythonPackage rec { - pname = "ruamel.yaml.convert"; - version = "0.3.2"; - src = fetchPypi { - inherit pname version; - sha256 = "1i6919b5f5ygj7y7c4x0wi91n8y0mw4nf9f0bcfjk29i594xjph6"; - }; - propagatedBuildInputs = [ python-dateutil ruamel_yaml ]; - doCheck = false; - inherit meta; - }; - - ruamel.yaml.cmd = buildPythonPackage rec { - pname = "ruamel.yaml.cmd"; - version = "0.5.6"; - src = fetchPypi { - inherit pname version; - sha256 = "0zc2h6b721r8c05dm7y8zgrgbvifbgcm8jmqvns7ar4ajll3cvwv"; - }; - propagatedBuildInputs = [ configobj ruamel.std.argparse ruamel.std.convert ]; - patches = [ ./disable-backup-files.patch ]; - doCheck = false; - dontWrapPythonPrograms = true; - inherit meta; - }; - -in buildPythonApplication rec { - - pname = ruamel.yaml.cmd.pname; - version = ruamel.yaml.cmd.version; - propagatedBuildInputs = [ ruamel.yaml.cmd ]; - pythonEnvironment = python38.withPackages (_: propagatedBuildInputs); - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - cp ${ruamel.yaml.cmd}/bin/yaml $out/bin - sed -i 's|^#!.*$|#!${pythonEnvironment}/bin/python3.8|' $out/bin/yaml - runHook postInstall - ''; - - dontUnpack = true; - dontBuild = true; - doCheck = false; - inherit meta; -} diff --git a/.config/nixpkgs/packages/ruamel.yaml.cmd/disable-backup-files.patch b/.config/nixpkgs/packages/ruamel.yaml.cmd/disable-backup-files.patch deleted file mode 100644 index b56e616..0000000 --- a/.config/nixpkgs/packages/ruamel.yaml.cmd/disable-backup-files.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/yaml_cmd.py 2020-12-14 22:13:19.000000000 -0500 -+++ b/yaml_cmd.py 2020-12-14 22:13:34.067115865 -0500 -@@ -513,8 +513,6 @@ - def round_trip_save(self, file_name): - inp = open(file_name).read() - backup_file_name = file_name + '.orig' -- if not os.path.exists(backup_file_name): -- os.rename(file_name, backup_file_name) - return self.round_trip_single(inp, out_file=file_name) - - def round_trip_input(self, inp): diff --git a/.config/nixpkgs/packages/ruamel.yaml.cmd/package.nix b/.config/nixpkgs/packages/ruamel.yaml.cmd/package.nix new file mode 100644 index 0000000..362b4bd --- /dev/null +++ b/.config/nixpkgs/packages/ruamel.yaml.cmd/package.nix @@ -0,0 +1,85 @@ +{ lib, pkgs, python39 }: + +let + + meta = with lib; { + license = licenses.mit; + description = "Command line utility to manipulate YAML files"; + homepage = "https://sourceforge.net/p/ruamel-yaml-cmd/code/ci/default/tree"; + }; + + ruamel.std.argparse = python39.pkgs.buildPythonPackage rec { + pname = "ruamel.std.argparse"; + version = "0.8.3"; + src = python39.pkgs.fetchPypi { + inherit pname version; + sha256 = "0srv4g6jryyaz26csx315pbmfhm4rw8jhfsl7rq7krrglgqwjryi"; + }; + doCheck = false; + inherit meta; + }; + + ruamel.std.convert = python39.pkgs.buildPythonPackage rec { + pname = "ruamel.yaml.convert"; + version = "0.3.2"; + src = python39.pkgs.fetchPypi { + inherit pname version; + sha256 = "1i6919b5f5ygj7y7c4x0wi91n8y0mw4nf9f0bcfjk29i594xjph6"; + }; + propagatedBuildInputs = [ python39.pkgs.python-dateutil python39.pkgs.ruamel_yaml ]; + doCheck = false; + inherit meta; + }; + + ruamel.yaml.cmd = python39.pkgs.buildPythonPackage rec { + pname = "ruamel.yaml.cmd"; + version = "0.5.7"; + src = python39.pkgs.fetchPypi { + inherit pname version; + sha256 = "0w6ralskvjhswqsgxyqm5wpn0an7kj3v2mzf46ipp7b8xirjrc6r"; + }; + propagatedBuildInputs = [ python39.pkgs.configobj ruamel.std.argparse ruamel.std.convert ]; + patches = [ + (pkgs.writeTextFile { + name = "disable-backup-files.patch"; + text = '' + --- a/yaml_cmd.py 2020-12-14 22:13:19.000000000 -0500 + +++ b/yaml_cmd.py 2020-12-14 22:13:34.067115865 -0500 + @@ -513,8 +513,6 @@ + def round_trip_save(self, file_name): + inp = open(file_name).read() + backup_file_name = file_name + '.orig' + - if not os.path.exists(backup_file_name): + - os.rename(file_name, backup_file_name) + return self.round_trip_single(inp, out_file=file_name) + + def round_trip_input(self, inp): + ''; + }) + ]; + doCheck = false; + dontWrapPythonPrograms = true; + inherit meta; + }; + +in python39.pkgs.buildPythonApplication rec { + + pname = ruamel.yaml.cmd.pname; + version = ruamel.yaml.cmd.version; + propagatedBuildInputs = [ ruamel.yaml.cmd ]; + pythonEnvironment = python39.withPackages (_: propagatedBuildInputs); + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp ${ruamel.yaml.cmd}/bin/yaml $out/bin + sed --in-place 's|^#!.*$|#!${pythonEnvironment}/bin/python|' $out/bin/yaml + runHook postInstall + ''; + + dontUnpack = true; + dontBuild = true; + doCheck = false; + format = "other"; + inherit meta; +} diff --git a/.config/nixpkgs/packages/rxvt-unicode/package.nix b/.config/nixpkgs/packages/rxvt-unicode/package.nix new file mode 100644 index 0000000..dd3540c --- /dev/null +++ b/.config/nixpkgs/packages/rxvt-unicode/package.nix @@ -0,0 +1,102 @@ +{ lib, stdenv, fetchurl, fetchpatch, libX11, libXt, libXft, libXrender, ncurses +, fontconfig, freetype, pkg-config, gdk-pixbuf, perl, writeTextFile }: + +let + pname = "rxvt-unicode"; + version = "9.26"; + description = "A clone of the well-known terminal emulator rxvt"; + +in stdenv.mkDerivation { + + inherit pname version; + name = "${pname}-unwrapped-${version}"; + + src = fetchurl { + url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2"; + sha256 = "12y9p32q0v7n7rhjla0j2g9d5rj2dmwk20c9yhlssaaxlawiccb4"; + }; + + buildInputs = [ + fontconfig + freetype + gdk-pixbuf + libX11 + libXft + libXrender + libXt + ncurses + perl + pkg-config + ]; + + outputs = [ "out" "terminfo" ]; + + patches = [ + (fetchpatch { + name = "enable-wide-glyphs.patch"; + url = "https://raw.githubusercontent.com/owl4ce/nelumbonaceae/e6be9823ec9ab7c14a23f5a25dfb33ce705d9950/x11-terms/rxvt-unicode/files/enable-wide-glyphs.patch"; + sha256 = "0vfpidysc1kxr3zark2y1b8fxx7k2lck79ccb7b97mgz04mxchvd"; + }) + (fetchpatch { + name = "improve-font-rendering.patch"; + url = "https://raw.githubusercontent.com/owl4ce/nelumbonaceae/e6be9823ec9ab7c14a23f5a25dfb33ce705d9950/x11-terms/rxvt-unicode/files/improve-font-rendering.patch"; + sha256 = "0xkwvn204n679v4mgpw2dl4c30pdl622l6b2iw6sr0gijga8zqcd"; + }) + (fetchpatch { + name = "256-color-resources.patch"; + url = "https://raw.githubusercontent.com/NixOS/nixpkgs/2bb3a9da24ca60d9f5bed69f679a1ec50dbdf997/pkgs/applications/terminal-emulators/rxvt-unicode/patches/256-color-resources.patch"; + sha256 = "sha256-lz0naMdlu7+e2/+zP6KvGTI6exIS4qx+Tqr0OpUkXGI="; + }) + (fetchpatch { + name = "fixed-layout-size.patch"; + url = "https://raw.githubusercontent.com/owl4ce/nelumbonaceae/b593a0eb7bb45a0b471c2ee2aa02b0e66776b9c0/x11-terms/rxvt-unicode/files/fixed-layout-size.patch"; + sha256 = "148vpln61zs3qv4sipcc5c7fiyc4d4q6k10r7bpr0k0q4pzshljh"; + }) + (writeTextFile { + name = "silence-x-errors.patch"; + text = '' + --- a/src/main.C + +++ b/src/main.C + @@ -494,7 +494,7 @@ + #if ENABLE_MINIMAL + old_xerror_handler (display, event); + #else + - print_x_error (display, event); + + // print_x_error (display, event); + #endif + } + ''; + }) + ]; + + configureFlags = [ + "--enable-perl" + "--enable-unicode3" + "--enable-256-color" + "--enable-wide-glyphs" + "--with-terminfo=$terminfo/share/terminfo" + ]; + + CFLAGS = [ "-I${freetype.dev}/include/freetype2" ]; + LDFLAGS = [ "-lfontconfig" "-lXrender" "-lpthread" ]; + + preConfigure = '' + mkdir -p $terminfo/share/terminfo + export TERMINFO=$terminfo/share/terminfo + mkdir -p $out/$(dirname ${perl.libPrefix}) + ln -s $out/lib/urxvt $out/${perl.libPrefix} + ''; + + postInstall = '' + mkdir -p $out/nix-support + echo "$terminfo" >> $out/nix-support/propagated-user-env-packages + ''; + + meta = { + inherit description; + license = lib.licenses.gpl3; + platforms = lib.platforms.unix; + downloadPage = "http://dist.schmorp.de/rxvt-unicode/Attic/"; + homepage = "http://software.schmorp.de/pkg/rxvt-unicode.html"; + }; +} diff --git a/.config/nixpkgs/packages/skeema/default.nix b/.config/nixpkgs/packages/skeema/default.nix deleted file mode 100644 index 4017f75..0000000 --- a/.config/nixpkgs/packages/skeema/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchgit, buildGoModule }: - -buildGoModule rec { - pname = "skeema"; - version = "v1.5.0"; - url = "https://github.com/skeema/skeema"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "0mrspmgiww0jlpml24r5f4ail8153f2liva88w9760fd5aky3ix3"; - }; - - vendorSha256 = null; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.asl20; - description = "Schema management CLI for MySQL"; - }; -} diff --git a/.config/nixpkgs/packages/sowon/package.nix b/.config/nixpkgs/packages/sowon/package.nix new file mode 100644 index 0000000..38d06b0 --- /dev/null +++ b/.config/nixpkgs/packages/sowon/package.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit, SDL2, pkg-config }: + +stdenv.mkDerivation rec { + pname = "sowon"; + version = "85dbbd06e7f20fe0a727fcb34e5206c23894ff83"; + url = "https://github.com/tsoding/sowon.git"; + + src = fetchgit { + inherit url; + rev = version; + sha256 = "06gc1qsn5j902861qfbrixpjdmxyngrhvp312zz82k9gqjsacwyi"; + }; + + buildInputs = [ SDL2 ]; + nativeBuildInputs = [ pkg-config ]; + + installPhase = '' + runHook preInstall + mkdir --parents $out/bin + cp ${pname} $out/bin + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + inherit version; + license = licenses.mit; + description = "Starting Soon Timer for Tsoding Streams"; + }; +} diff --git a/.config/nixpkgs/packages/sqldef/default.nix b/.config/nixpkgs/packages/sqldef/default.nix deleted file mode 100644 index 6829f00..0000000 --- a/.config/nixpkgs/packages/sqldef/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchgit, buildGoModule }: - -buildGoModule rec { - pname = "sqldef"; - version = "v0.8.9"; - url = "https://github.com/k0kubun/sqldef"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "1hvx05qwy2g4r1zc1k2f9xv4z815p5jh1a6g41fdlxskjl3kyyf5"; - }; - - vendorSha256 = "066184zmwdhd8dbkbmwds8aimiawfcvb8px8z1q48c949gvywlx7"; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.mit; - description = "Idempotent MySQL/PostgreSQL schema management by SQL"; - }; -} diff --git a/.config/nixpkgs/packages/sqlfluff/default.nix b/.config/nixpkgs/packages/sqlfluff/default.nix deleted file mode 100644 index 0030d31..0000000 --- a/.config/nixpkgs/packages/sqlfluff/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ stdenv, fetchgit, python36 }: - -with python36.pkgs; - -let - - bench-it = buildPythonPackage rec { - pname = "bench-it"; - version = "1.0.1"; - src = fetchPypi { - inherit pname version; - sha256 = "0v6kfvgdnjlfmwlafmyjadgllfr8qc1hq83kz9q287gh5nvw851f"; - }; - postPatch = '' - # Avoid building pypandoc - sed -i 's|^import pypandoc.*||' setup.py - sed -i 's|^description = pypandoc.*|description = ""|' setup.py - ''; - doCheck = false; - }; - -in buildPythonApplication rec { - - pname = "sqlfluff"; - url = "https://github.com/sqlfluff/sqlfluff"; - version = "0.4.1"; - - src = fetchgit { - inherit url; - rev = version; - sha256 = "0g53rhdg8b2p3xx9rmkc2fkqnz4fsrmkg98n5fi10s16wscn90kz"; - }; - - propagatedBuildInputs = [ - appdirs - bench-it - cached-property - click - colorama - configparser - dataclasses - diff_cover - jinja2 - oyaml - pathspec - pluggy - typing-extensions - ]; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = url; - license = licenses.mit; - platforms = platforms.linux; - description = "A SQL linter and auto-formatter for Humans"; - }; -} diff --git a/.config/nixpkgs/packages/systemd2nix/default.nix b/.config/nixpkgs/packages/systemd2nix/package.nix index 9d78393..b4c6103 100644 --- a/.config/nixpkgs/packages/systemd2nix/default.nix +++ b/.config/nixpkgs/packages/systemd2nix/package.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, python38 }: +{ lib, fetchgit, python38 }: python38.pkgs.buildPythonApplication rec { @@ -14,14 +14,17 @@ python38.pkgs.buildPythonApplication rec { doCheck = false; dontBuild = true; + format = "other"; installPhase = '' - mkdir -p $out/bin $out/share/${pname} + runHook preInstall + mkdir --parents $out/bin $out/share/${pname} cp ${src}/${pname}.py $out/share/${pname} makeWrapper ${python38}/bin/python $out/bin/${pname} --add-flags $out/share/${pname}/${pname}.py + runHook postInstall ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = url; license = licenses.mit; platforms = platforms.linux; diff --git a/.config/nixpkgs/packages/tiemu/package.nix b/.config/nixpkgs/packages/tiemu/package.nix new file mode 100644 index 0000000..f703981 --- /dev/null +++ b/.config/nixpkgs/packages/tiemu/package.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libticalcs2, libticables2 +, libtifiles2, libticonv, gnome2, gtk2, SDL, glib }: + +stdenv.mkDerivation rec { + name = "tiemu"; + version = "3.03"; + src = fetchurl { + url = "http://download.sourceforge.net/project/gtktiemu/tiemu-linux/TIEmu%20${version}/tiemu-${version}-nogdb.tar.gz"; + sha256 = "14m5p1ani7pz23z77h2hibl38sz0i5dpywdhkbr8v2i788487llj"; + }; + + hardeningDisable = [ "format" ]; + preConfigure = ''configureFlags="--without-kde --disable-gdb"''; + + buildInputs = [ + pkg-config + libticables2 + libticalcs2 + libtifiles2 + glib + libticonv + gtk2 + gnome2.libglade + SDL + ]; + + patches = [ + (fetchpatch { + name = "01-build-fix.patch"; + sha256 = "0p4qns6w1hfs3ci6pqpidd2ikjgvpvyd7bnsfj9cx06chwc9sysl"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/01-build-fix.patch?h=tiemu"; + }) + (fetchpatch { + name = "sysdeps.patch"; + sha256 = "1j6gns3vhykizxyb09670a65lafa1xd8wjyl45kvmysv250089z5"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/sysdeps.patch?h=tiemu"; + }) + ]; + + meta = with lib; { + license = licenses.gpl2; + platforms = platforms.linux; + homepage = "http://lpg.ticalc.org/prj_tiemu/"; + }; +} diff --git a/.config/nixpkgs/packages/wf-shell/package.nix b/.config/nixpkgs/packages/wf-shell/package.nix new file mode 100644 index 0000000..46448b9 --- /dev/null +++ b/.config/nixpkgs/packages/wf-shell/package.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchgit, meson, ninja, pkg-config, wayland, alsa-lib, gtkmm3 +, gtk-layer-shell, pulseaudio, wayfire, wf-config, libdbusmenu-gtk3 }: + +stdenv.mkDerivation rec { + pname = "wf-shell"; + version = "9a9af00dc02780357466e27c5e77e316469e7a37"; + + src = fetchgit { + url = "https://github.com/WayfireWM/wf-shell"; + sha256 = "sha256-DoGW9rCEQFDO/SJ/ZWv2SPzC/acLFnPPncs683ugEvY="; + }; + + mesonFlags = [ "--sysconfdir" "/etc" ]; + nativeBuildInputs = [ meson ninja pkg-config wayland ]; + + buildInputs = [ + alsa-lib + gtk-layer-shell + gtkmm3 + libdbusmenu-gtk3 + pulseaudio + wayfire + wf-config + ]; + + meta = with lib; { + homepage = "https://github.com/WayfireWM/wf-shell"; + description = "GTK3-based panel for Wayfire"; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/.config/nixpkgs/packages/xprintidle/default.nix b/.config/nixpkgs/packages/xprintidle/default.nix deleted file mode 100644 index 975b464..0000000 --- a/.config/nixpkgs/packages/xprintidle/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ stdenv, fetchFromGitHub, libX11, libXScrnSaver, libXext, meson, pkg-config -, ninja }: - -stdenv.mkDerivation rec { - pname = "xprintidle"; - version = "0.2.4"; - - src = fetchFromGitHub { - owner = "g0hl1n"; - repo = pname; - rev = version; - sha256 = "10na3ymzfhpq800wsyd23m57ngz69nn5i10c7p9iya8hzi7cf20a"; - }; - - nativeBuildInputs = [ meson pkg-config ninja ]; - - buildInputs = [ libX11 libXScrnSaver libXext ]; - - meta = { - inherit version; - description = "A command-line tool to print idle time from libXss"; - homepage = "https://github.com/g0hl1n/xprintidle"; - license = stdenv.lib.licenses.gpl2; - maintainers = [ stdenv.lib.maintainers.raskin ]; - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/.config/nixpkgs/packages/yaml2nix/package.nix b/.config/nixpkgs/packages/yaml2nix/package.nix new file mode 100644 index 0000000..af4ae38 --- /dev/null +++ b/.config/nixpkgs/packages/yaml2nix/package.nix @@ -0,0 +1,20 @@ +{ lib, rustPlatform, fetchgit }: + +rustPlatform.buildRustPackage rec { + pname = "yaml2nix"; + version = "b220acf4299376ee1b4131ca4c4248ebf0337d79"; + + src = fetchgit { + rev = version; + url = "https://github.com/euank/yaml2nix.git"; + sha256 = "1i7s18chpqckq16ljy9sh81zvambqkh4hvcyap6xi4yzp2h82198"; + }; + + cargoSha256 = "0bnkznzmyi7iyv4rlkfj8ikkx1ajfhvwd3rrmhrlbx6hbv554fkh"; + + meta = with lib; { + homepage = url; + license = licenses.gpl3; + description = "A command line tool to convert yaml into a nix expression."; + }; +} diff --git a/.config/nixpkgs/packages/youtube-dl/default.nix b/.config/nixpkgs/packages/youtube-dl/default.nix deleted file mode 100644 index 3dc4a27..0000000 --- a/.config/nixpkgs/packages/youtube-dl/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ python38Packages, lib, fetchurl, zip, ffmpeg, rtmpdump, phantomjs2 -, atomicparsley, pandoc, generateManPage ? true, ffmpegSupport ? true -, rtmpSupport ? true, phantomjsSupport ? false, hlsEncryptedSupport ? true -, installShellFiles, makeWrapper }: - -python38Packages.buildPythonPackage rec { - - pname = "youtube-dl"; - version = "2020.12.05"; - - src = fetchurl { - url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz"; - sha256 = "065s45l8qz7wlkaxw9bj20gq9647zpwdj9vc6chhqjscl63z1aqm"; - }; - - nativeBuildInputs = [ installShellFiles makeWrapper ]; - buildInputs = [ zip ] ++ lib.optional generateManPage pandoc; - propagatedBuildInputs = - lib.optional hlsEncryptedSupport python38Packages.pycryptodome; - - makeWrapperArgs = let - packagesToBinPath = [ atomicparsley ] ++ lib.optional ffmpegSupport ffmpeg - ++ lib.optional rtmpSupport rtmpdump - ++ lib.optional phantomjsSupport phantomjs2; - in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ]; - - setupPyBuildFlags = [ "build_lazy_extractors" ]; - - postInstall = '' - installShellCompletion youtube-dl.zsh - ''; - - doCheck = false; - - meta = with lib; { - homepage = "https://ytdl-org.github.io/youtube-dl/"; - description = - "Command-line tool to download videos from YouTube.com and other sites"; - longDescription = '' - youtube-dl is a small, Python-based command-line program - to download videos from YouTube.com and a few more sites. - youtube-dl is released to the public domain, which means - you can modify it, redistribute it or use it however you like. - ''; - license = licenses.publicDomain; - platforms = with platforms; linux ++ darwin; - maintainers = with maintainers; [ - bluescreen303 - phreedom - AndersonTorres - fpletz - enzime - ma27 - ]; - }; -} diff --git a/.config/nixpkgs/shells/ansible.nix b/.config/nixpkgs/shells/ansible.nix deleted file mode 100644 index 8653f3d..0000000 --- a/.config/nixpkgs/shells/ansible.nix +++ /dev/null @@ -1,20 +0,0 @@ -with import <nixpkgs> { }; - -let project = "${builtins.getEnv "HOME"}/Shares/Projects/infrastructure/ansible"; - -in mkShell rec { - name = "ansible-mitogen"; - buildInputs = [ python38.pkgs.pip ansible_2_9 ]; - shellHook = '' - export virtualenvs=$HOME/.local/share/virtualenvs - mkdir -p $virtualenvs - python -m venv $virtualenvs/ansible-mitogen - . $virtualenvs/ansible-mitogen/bin/activate - python -m pip install mitogen==0.2.9 - export ANSIBLE_STRATEGY_PLUGINS=$virtualenvs/ansible-mitogen/lib/python3.8/site-packages/ansible_mitogen/plugins - export ANSIBLE_STRATEGY=mitogen_linear - export PS1='\h (${name}) \W \$ ' - cd "${project}" - ssh -T git@github.com - ''; -} diff --git a/.config/nixpkgs/shells/ansible/shell.nix b/.config/nixpkgs/shells/ansible/shell.nix new file mode 100644 index 0000000..96eb244 --- /dev/null +++ b/.config/nixpkgs/shells/ansible/shell.nix @@ -0,0 +1,29 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + + name = "nix-shell.ansible"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }; + + project = "${builtins.getEnv "HOME"}/Shares/Projects/infrastructure/ansible"; + + python = pkgs.python39.withPackages (ps: with ps; [ mitogen ]); + +in pkgs.mkShell { + + inherit name; + + buildInputs = [ python pkgs.ansible_2_10 ]; + + shellHook = '' + export ANSIBLE_STRATEGY_PLUGINS=${python}/lib/*/site-packages/ansible_mitogen/plugins + export ANSIBLE_STRATEGY=mitogen_linear + export PS1='\h (${name}) \W \$ ' + cd '${project}' || exit 1 + ssh -T git@github.com + ''; +} diff --git a/.config/nixpkgs/shells/bubblewrap/shell.nix b/.config/nixpkgs/shells/bubblewrap/shell.nix new file mode 100644 index 0000000..aee8a8b --- /dev/null +++ b/.config/nixpkgs/shells/bubblewrap/shell.nix @@ -0,0 +1,36 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://github.com/containers/bubblewrap/blob/main/demos/bubblewrap-shell.sh + # https://manpages.debian.org/testing/bubblewrap/bwrap.1.en.html + + name = "nix-shell.bubblewrap"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + bubblewrap = arguments@{ ... }: pkgs.writeShellApplication { + inherit name; + text = '' + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.bubblewrap ]} + bwrap \ + '' + pkgs.lib.strings.concatStringsSep " \\\n" + (pkgs.lib.attrsets.mapAttrsToList (argument: value: "--${argument} ${value} ") + arguments) + "/bin/sh\n"; + }; + + jail = bubblewrap { + clearenv = ""; + setenv = "PATH ${pkgs.lib.strings.makeBinPath [ pkgs.busybox ]}"; + ro-bind = "/nix /nix" + " --ro-bind /bin /bin"; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/cake/shell.nix b/.config/nixpkgs/shells/cake/shell.nix new file mode 100644 index 0000000..3a88218 --- /dev/null +++ b/.config/nixpkgs/shells/cake/shell.nix @@ -0,0 +1,203 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # NIX_CONFIG="sandbox = relaxed" nix-shell --option builders '' cake.nix + + name = "nix-shell.cake"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + alpine-3-12-amd64 = pkgs.dockerTools.exportImage { + fromImage = pkgs.dockerTools.pullImage rec { + imageName = "alpine"; + imageDigest = "sha256:2a8831c57b2e2cb2cda0f3a7c260d3b6c51ad04daea0b3bfc5b55f489ebafd71"; + sha256 = "1px8xhk0a3b129cc98d3wm4s0g1z2mahnrxd648gkdbfsdj9dlxp"; + finalImageName = imageName; + finalImageTag = "3.12"; + }; + diskSize = "128"; + }; + + cook = { name, src, contents ? [ ], path ? [ ], script ? "", prepare ? "", cleanup ? "" }: pkgs.stdenvNoCC.mkDerivation { + __noChroot = true; + inherit name src contents; + phases = [ "installPhase" ]; + buildInputs = [ pkgs.proot pkgs.rsync pkgs.tree pkgs.kmod ]; + bootstrap = pkgs.writeScript "bootstrap-${name}" '' + ${script} + rm "$0" + ''; + PROOT_NO_SECCOMP = "1"; + installPhase = '' + set -euo pipefail + mkdir --parents rootfs $out/rootfs + tar --extract --file=${src} -C rootfs + + ${prepare} + + cp $bootstrap rootfs/bootstrap + proot --cwd=/ --root-id --rootfs=rootfs /usr/bin/env - /bin/sh -euc '. /etc/profile && /bootstrap' + printf 'PATH=${pkgs.lib.strings.makeBinPath path}:$PATH' >> rootfs/etc/profile + + [ -n "$contents" ] && { + printf "\n" + for paths in $contents; do + printf "Cooking... Adding %s \n" "$paths" + rsync --copy-dirlinks --relative --archive --chown=0:0 "$paths/" "rootfs" || exit 1 + done + printf "\n" + } || printf '\n%s\n' 'No contents to cook.'; + + ${cleanup} + + printf '\n%s\n\n' "$(du --all --max-depth 1 --human-readable rootfs | sort --human-numeric-sort)" + cp --recursive --no-target-directory rootfs $out/rootfs + ''; + }; + + bake = { name, image, size ? "1G", debug ? false, kernel ? pkgs.linux, options ? [ ], modules ? [ ], uuid ? "99999999-9999-9999-9999-999999999999" }: let + initrd = cook { + name = "initrd-${name}"; + src = alpine-3-12-amd64; + script = '' + rm -rf home opt media root run srv tmp var + printf '#!/bin/sh -eu + mount -t devtmpfs none /dev + mount -t proc none /proc + mount -t sysfs none /sys + sh /lib/modules/initrd/init + ${pkgs.lib.optionalString (debug) "sh +m"} + mount -r "$(findfs UUID=${uuid})" /mnt + mount -o move /dev /mnt/dev + umount /proc /sys + exec switch_root /mnt /sbin/init + ' > init + chmod +x init + find . ! -name bootstrap ! -name initramfs.cpio | cpio -H newc -ov > initramfs.cpio + gzip -9 initramfs.cpio + ''; + prepare = '' + modules='${pkgs.lib.strings.concatMapStringsSep " " (module: module) modules}' + initrd_directory=rootfs/lib/modules/initrd + [ -n "$modules" ] && { + mkdir --parents "$initrd_directory" + printf "\n" + for module in $modules; do + module_file=$(find ${kernel} -name "$module.ko*" -type f) + module_basename=$(basename "$module_file") + printf "Cooking initrd... Adding module %s \n" "$module" + cp "$module_file" "$initrd_directory" || exit 1 + printf 'insmod /lib/modules/initrd/%s\n' "$module_basename" >> "$initrd_directory/init" + done + } || printf '\n%s\n' 'No modules to cook.' + ''; + }; in pkgs.writeScript name '' + set -euo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ + pkgs.coreutils + pkgs.e2fsprogs + pkgs.gawk + pkgs.rsync + pkgs.syslinux + pkgs.tree + pkgs.utillinux + ]} + IMAGE=${name}.img + LOOP=/dev/loop0 + ROOTFS=rootfs + rm "$IMAGE" || true + fallocate --length ${size} $IMAGE && chmod o+rw "$IMAGE" + printf 'o\nn\np\n1\n2048\n\na\nw\n' | fdisk "$IMAGE" + dd bs=440 count=1 conv=notrunc if=${pkgs.syslinux}/share/syslinux/mbr.bin of="$IMAGE" + mkdir --parents "$ROOTFS" + umount --verbose "$ROOTFS" || true + losetup --detach "$LOOP" || true + losetup --offset "$((2048 * 512))" "$LOOP" "$IMAGE" + mkfs.ext4 -U ${uuid} "$LOOP" + mount --verbose "$LOOP" "$ROOTFS" + rsync --archive --chown=0:0 "${image}/rootfs/" "$ROOTFS"; + mkdir --parents "$ROOTFS/boot" + cp ${kernel}/bzImage "$ROOTFS/boot/vmlinux" + cp ${initrd}/rootfs/initramfs.cpio.gz "$ROOTFS/boot/initrd" + printf ' + DEFAULT linux + LABEL linux + LINUX /boot/vmlinux + INITRD /boot/initrd + APPEND ${pkgs.lib.strings.concatMapStringsSep " " (option: option) options} + ' > "$ROOTFS/boot/syslinux.cfg" + extlinux --heads 64 --sectors 32 --install $ROOTFS/boot + printf '\n%s\n\n' "$(du --max-depth 1 --human-readable $ROOTFS | sort --human-numeric-sort)" + umount --verbose "$ROOTFS" + rm -r "$ROOTFS" + losetup --detach "$LOOP" + ''; + + alpine = cook { + name = "alpine"; + src = alpine-3-12-amd64; + contents = [ pkgs.glibc pkgs.gawk ]; + path = [ pkgs.gawk ]; + script = '' + cat /etc/alpine-release + sed -i 's/#ttyS0/ttyS0/' /etc/inittab + printf 'migh7Lib\nmigh7Lib\n' | adduser alpine + ''; + }; + + alpine-machine = bake { + name = "alpine-machine"; + image = alpine; + kernel = pkgs.linuxPackages_5_10.kernel; + options = [ "console=tty1" "console=ttyS0" ]; + size = "128M"; + modules = [ + "virtio" + "virtio_ring" + "virtio_blk" + "virtio_pci" + "jbd2" + "mbcache" + "crc16" + "crc32c_generic" + "ext4" + ]; + }; + + container = { rootfs, binds ? [ ], options ? [] }: + pkgs.writeScript name '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.proot ]} + proot \ + --cwd=/ \ + --rootfs='${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (option: "--bind=${option}") binds} \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + /usr/bin/env - /bin/sh -c '. /etc/profile && sh' + ''; + +in pkgs.mkShell { + + inherit name; + + buildInputs = [ pkgs.proot pkgs.qemu ]; + + shellHook = '' + export PS1='\h (${name}) \W \$ ' + + # sudo ${alpine-machine} + # doas ${alpine-machine} + # qemu-system-x86_64 -nographic -drive if=virtio,file=./${alpine-machine.name}.img,format=raw + # qemu-system-x86_64 -curses -drive if=virtio,file=./${alpine-machine.name}.img,format=raw + + ${container { + rootfs = "${alpine}/rootfs"; + binds = [ "/proc" "/dev" ]; + options = [ "--verbose=0" ]; + }} + exit + ''; +} diff --git a/.config/nixpkgs/shells/coreboot/shell.nix b/.config/nixpkgs/shells/coreboot/shell.nix new file mode 100644 index 0000000..242c621 --- /dev/null +++ b/.config/nixpkgs/shells/coreboot/shell.nix @@ -0,0 +1,108 @@ +let + + # Shell derivation condensed from https://git.petabyte.dev/petabyteboy/corenix + + # nix-shell -E 'import (builtins.fetchurl "$url")' + + name = "nix-shell.coreboot"; + architecture = "i386"; + url = "https://review.coreboot.org/coreboot"; + project = "${builtins.getEnv "HOME"}/Shares/Projects/coreboot"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3824.dec334fa196/nixexprs.tar.xz"; + sha256 = "1i38d1z672gzn73k6gsas2zjbbradg06w7dw3zs9f64l0hr3qd94"; }) {}; + + dependencies = { fetchurl }: [ + rec { name = "llvm-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "clang-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "091bvcny2lh32zy8f3m9viayyhb2zannrndni7325rl85cwgr6pr"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "clang-tools-extra-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "compiler-rt-${version}.src.tar.xz"; version = "11.0.0"; archive = fetchurl { sha256 = "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}"; }; } + rec { name = "Python-${version}.tar.xz"; version = "3.8.5"; archive = fetchurl { sha256 = "1c43dbv9lvlp3ynqmgdi4rh8q94swanhqarqrdx62zmigpakw073"; url = "https://www.python.org/ftp/python/${version}/${name}"; }; } + rec { name = "acpica-unix2-${version}.tar.gz"; version = "20200925"; archive = fetchurl { sha256 = "18n6129fkgj85piid7v4zxxksv3h0amqp4p977vcl9xg3bq0zd2w"; url = "https://acpica.org/sites/acpica/files/${name}"; }; } + rec { name = "binutils-${version}.tar.xz"; version = "2.35.1"; archive = fetchurl { sha256 = "01w6xvfy7sjpw8j08k111bnkl27j760bdsi0wjvq44ghkgdr3v9w"; url = "https://ftpmirror.gnu.org/binutils/${name}"; }; } + rec { name = "cmake-${version}.1.tar.gz"; version = "3.18"; archive = fetchurl { sha256 = "0215srmc9l7ygwdpfms8yx0wbd96qgz2d58ykmdiarvysf5k7qy0"; url = "https://cmake.org/files/v${version}/${name}"; }; } + rec { name = "expat-${version}.tar.bz2"; version = "2.2.9"; archive = fetchurl { sha256 = "0dx2m58gkj7cadk51lmp54ma7cqjhff4kjmwv8ks80j3vj2301pi"; url = "https://distfiles.macports.org/expat/${name}"; }; } + rec { name = "gcc-${version}.tar.xz"; version = "8.3.0"; archive = fetchurl { sha256 = "0b3xv411xhlnjmin2979nxcbnidgvzqdf4nbhix99x60dkzavfk4"; url = "https://ftpmirror.gnu.org/gcc/gcc-${version}/${name}"; }; } + rec { name = "gdb-${version}.tar.xz"; version = "9.2"; archive = fetchurl { sha256 = "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n"; url = "https://ftpmirror.gnu.org/gdb/${name}"; }; } + rec { name = "gmp-${version}.tar.xz"; version = "6.2.0"; archive = fetchurl { sha256 = "09hmg8k63mbfrx1x3yy6y1yzbbq85kw5avbibhcgrg9z3ganr3i5"; url = "https://ftpmirror.gnu.org/gmp/${name}"; }; } + rec { name = "mpc-${version}.tar.gz"; version = "1.2.0"; archive = fetchurl { sha256 = "19pxx3gwhwl588v496g3aylhcw91z1dk1d5x3a8ik71sancjs3z9"; url = "https://ftpmirror.gnu.org/mpc/${name}"; }; } + rec { name = "mpfr-${version}.tar.xz"; version = "4.1.0"; archive = fetchurl { sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c"; url = "https://ftpmirror.gnu.org/mpfr/${name}"; }; } + rec { name = "nasm-${version}.tar.bz2"; version = "2.15.05"; archive = fetchurl { sha256 = "1l1gxs5ncdbgz91lsl4y7w5aapask3w02q9inayb2m5bwlwq6jrw"; url = "https://www.nasm.us/pub/nasm/releasebuilds/${version}/${name}"; }; } + ]; + + toolchain = pkgs.stdenv.mkDerivation rec { + pname = "crossgcc-${architecture}"; + version = "4.14"; + src = pkgs.fetchgit { + inherit url; + rev = version; + fetchSubmodules = true; + sha256 = "00xr74yc0kj9rrqa1a8b7bih865qlp9i4zs67ysavkfrjrwwssxm"; + }; + + hardeningDisable = [ "format" ]; + nativeBuildInputs = builtins.attrValues { inherit (pkgs) curl m4 flex bison zlib gnat; }; + + buildPhase = '' + mkdir --parents util/crossgcc/tarballs + ${pkgs.lib.concatMapStringsSep "\n" (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") (pkgs.callPackage dependencies { })} + sed "s/SOURCE_DATE_EPOCH := .*/SOURCE_DATE_EPOCH := $SOURCE_DATE_EPOCH/" --in-place Makefile + make crossgcc-${architecture} CPUS=$(nproc) + ''; + + installPhase = '' + runHook preInstall + cp -r util/crossgcc $out + runHook postInstall + ''; + }; + +in pkgs.mkShell { + + inherit name; + + buildInputs = builtins.attrValues { inherit (pkgs) git coreboot-utils flashrom me_cleaner ncurses qemu m4 flex bison zlib gnat; }; + + shellHook = '' + export PS1='\h (${name}) \W \$ ' + mkdir -p '${project}' + git clone '${url}' '${project}' || true + cd '${project}' || exit 1 + rm -rf util/crossgcc + git fetch --all + git reset --hard origin/master + git checkout ${toolchain.version} + rm -rf util/crossgcc + ln -sf ${toolchain} util/crossgcc + sed -i 's|$(OBJCOPY) --strip-$(STRIP) $< $@|$(OBJCOPY) --strip-debug $< $@|g' payloads/libpayload/Makefile.payload + + printf ' + flashrom --programmer internal # read BIOS chipset internally if possible + flashrom --programmer internal --read backup.rom --chip $chipset # read BIOS internally if possible with selected chipset + flashrom --programmer internal --read backup1.rom --chip $chipset + flashrom --programmer internal --read backup2.rom --chip $chipset + flashrom --programmer internal --read backup3.rom --chip $chipset + flashrom --programmer ch341a_spi --read backup.rom --chip $chipset # use an external programmer if internal does not work + sha256sum *.rom # check BIOS hashes for exactness + me_cleaner.py --soft-disable backup.rom # clean management engine and overwrite bios inplace + ifdtool --extract backup.rom # split regions of cleaned bios + + # Rename and move descriptor.bin, gbe.bin, me.bin into 3rdparty/blobs/mainboard/$vendor/$model where + # $vendor and $model are variable (for example lenovo/t420). Create folders if they do not exist. + # To test in qemu select model/vendor Emulation/QEMU x86 i440fx/piix4 in nconfig. + # In real world situations, one might only read and write internally to the bios region. + + flashrom --programmer internal --read bios.rom --chip $chipset --ifd --image bios + flashrom --programmer internal --write bios.rom --chip $chipset --ifd --image bios + + make distclean # clear old configuration + make clean # clear old compilation and keep configuration + make nconfig # setup configurtion + cat .config # check configuration + make # build coreboot + qemu-system-x86_64 -bios build/coreboot.rom -serial stdio # test image in qemu + + ' + ''; +} diff --git a/.config/nixpkgs/shells/falcon.nix b/.config/nixpkgs/shells/falcon/shell.nix index 23ea8a5..7bd0b54 100644 --- a/.config/nixpkgs/shells/falcon.nix +++ b/.config/nixpkgs/shells/falcon/shell.nix @@ -1,19 +1,24 @@ -with import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/360e2af4f87.tar.gz"; - sha256 = "1i3i9cpn6m3r07pgw4w3xinbqmxkm7pmnqjlz96x424ngbc21sg2"; }) {}; - let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + + name = "nix-shell.falcon-kernel"; + + pkgs = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/360e2af4f87.tar.gz"; + sha256 = "1i3i9cpn6m3r07pgw4w3xinbqmxkm7pmnqjlz96x424ngbc21sg2"; }) {}; + project = "${builtins.getEnv "HOME"}/Desktop/moto-falcon/lineageos-kernel/lineageos-motorala-msm8226"; - toolchain = stdenv.mkDerivation rec { + toolchain = pkgs.stdenv.mkDerivation rec { name = "gcc-linaro-4.9.4"; src = builtins.fetchTarball { url = "https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz"; sha256 = "11zznrx0hkq34bn7x7kxn5q9icrf22vqgmd1ifxmdskm2g14x3l8"; }; dontBuild = true; - buildInputs = [ python2 zlib ncurses5 expat lzma ]; - nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = builtins.attrValues { inherit (pkgs) python2 zlib ncurses5 expat lzma; }; + nativeBuildInputs = builtins.attrValues { inherit (pkgs) autoPatchelfHook; }; installPhase = '' runHook preInstall mkdir $out @@ -22,18 +27,16 @@ let ''; }; -in - -mkShell { +in pkgs.mkShell { - name = "falcon-kernel"; + inherit name; - buildInputs = [ gnumake ncurses ]; + buildInputs = builtins.attrValues { inherit (pkgs) gnumake ncurses; }; shellHook = '' export CROSS_COMPILE=${toolchain}/bin/arm-linux-gnueabihf- export ARCH=arm - export PS1='\h (falcon kernel) \W \$ ' - cd '${project}' + export PS1='\h (${name}) \W \$ ' + cd '${project}' || exit 1 ''; } diff --git a/.config/nixpkgs/shells/firejail/shell.nix b/.config/nixpkgs/shells/firejail/shell.nix new file mode 100644 index 0000000..4f5e5e1 --- /dev/null +++ b/.config/nixpkgs/shells/firejail/shell.nix @@ -0,0 +1,48 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://www.man7.org/linux/man-pages/man1/Firejail.1.html + + name = "nix-shell.firejail"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + firejail = { + rootfs ? "rootfs", + options ? [ ], + path ? [ pkgs.busybox ], + entrypoint ? "/bin/sh" + }: + pkgs.writeShellApplication { + inherit name; + text = '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.firejail pkgs.coreutils ]} + mkdir --parents '${rootfs}' + firejail \ + --chroot '${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + -- /usr/bin/env --ignore-environment ${ + pkgs.writeScript "entrypoint-${name}" '' + set -eu + export PATH=${pkgs.lib.strings.makeBinPath path} + ${entrypoint} + '' + }; + ''; + }; + + jail = firejail { + options = [ ]; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/larynx-server/shell.nix b/.config/nixpkgs/shells/larynx-server/shell.nix new file mode 100644 index 0000000..9021e47 --- /dev/null +++ b/.config/nixpkgs/shells/larynx-server/shell.nix @@ -0,0 +1,54 @@ +let + + name = "nix-shell.larynx-server"; + + nixpkgs = import <nixpkgs> { }; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + larynx = pkgs.stdenvNoCC.mkDerivation rec { + name = "larynx"; + version = "1.1.0"; + sourceRoot = "."; + + src = pkgs.dockerTools.exportImage { + fromImage = pkgs.dockerTools.pullImage rec { + imageName = "rhasspy/larynx"; + imageDigest = "sha256:ada5b443e2446b38ba61d764ec37c0ed78d46e659a011243967e7cc8e52311e3"; + sha256 = "sha256-TbaHNNMRGp4SWYC06WSmNr3igpiJagDKoD3TEnttYt8="; + finalImageName = imageName; + finalImageTag = version; + }; + diskSize = "3072"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir --parents $out/bin/larynx/app + cp --recursive home/larynx/app/.venv $out/bin/larynx/app + cp --recursive home/larynx/app/larynx $out/bin/larynx/app + ''; + }; + + fhs = pkgs.buildFHSUserEnv { + name = "larynx-server"; + runScript = "${pkgs.writeScriptBin name '' + export PYTHONPATH=/bin/larynx/app + /bin/larynx/app/.venv/bin/python3 -m larynx.server + ''}/bin/${name}"; + targetPkgs = pkgs: [ + larynx + pkgs.python39 + ]; + profile = "export FHS=1"; + }; + +in pkgs.mkShell { + inherit fhs; + inherit name; + shellHook = "exec ${fhs}/bin/${fhs.name}"; +} diff --git a/.config/nixpkgs/shells/larynx/shell.nix b/.config/nixpkgs/shells/larynx/shell.nix new file mode 100644 index 0000000..ac2e940 --- /dev/null +++ b/.config/nixpkgs/shells/larynx/shell.nix @@ -0,0 +1,54 @@ +let + + name = "nix-shell.larynx"; + + nixpkgs = import <nixpkgs> { }; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + larynx = pkgs.stdenvNoCC.mkDerivation rec { + name = "larynx"; + version = "1.1.0"; + sourceRoot = "."; + + src = pkgs.dockerTools.exportImage { + fromImage = pkgs.dockerTools.pullImage rec { + imageName = "rhasspy/larynx"; + imageDigest = "sha256:ada5b443e2446b38ba61d764ec37c0ed78d46e659a011243967e7cc8e52311e3"; + sha256 = "sha256-TbaHNNMRGp4SWYC06WSmNr3igpiJagDKoD3TEnttYt8="; + finalImageName = imageName; + finalImageTag = version; + }; + diskSize = "3072"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + mkdir --parents $out/bin/larynx/app + cp --recursive home/larynx/app/.venv $out/bin/larynx/app + cp --recursive home/larynx/app/larynx $out/bin/larynx/app + ''; + }; + + fhs = pkgs.buildFHSUserEnv { + name = "larynx"; + runScript = "${pkgs.writeScriptBin name '' + export PYTHONPATH=/bin/larynx/app + /bin/larynx/app/.venv/bin/python3 -m larynx "$@" + ''}/bin/${name}"; + targetPkgs = pkgs: [ + larynx + pkgs.python39 + ]; + profile = "export FHS=1"; + }; + +in pkgs.mkShell { + inherit fhs; + inherit name; + shellHook = "exec ${fhs}/bin/${fhs.name}"; +} diff --git a/.config/nixpkgs/shells/mermaid-live-editor/shell.nix b/.config/nixpkgs/shells/mermaid-live-editor/shell.nix new file mode 100644 index 0000000..db89a42 --- /dev/null +++ b/.config/nixpkgs/shells/mermaid-live-editor/shell.nix @@ -0,0 +1,74 @@ +let + + name = "nix-shell.mermaid-live-editor"; + version = "bf6c54c00e84d8c7d541920607db72f50d775ba5"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + package = pkgs.callPackage ({ lib, stdenv, fetchgit, mkYarnModules }: + + stdenv.mkDerivation rec { + inherit version; + pname = "mermaid-live-editor-node-modules"; + + src = fetchgit { + rev = version; + url = "https://github.com/mermaid-js/mermaid-live-editor.git"; + sha256 = "sha256-SadZzBruGKh4LCR9vr87vl/HBEgVN8Qczi9+thGmNCE="; + }; + + node_modules = mkYarnModules { + inherit pname version; + yarnLock = "${src}/yarn.lock"; + packageJSON = "${src}/package.json"; + }; + + installPhase = '' + runHook preInstall + mkdir $out + cp --recursive --no-target-directory ${node_modules} $out + cd $out/node_modules + chmod +w . + ln --symbolic mermaid-live-editor/node_modules/svelte-preprocess . + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + license = licenses.mit; + description = "Edit, preview and share mermaid charts/diagrams. New implementation of the live editor."; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${ + pkgs.lib.strings.makeBinPath [ + package + pkgs.busybox + pkgs.git + pkgs.yarn + ] + } + git clone https://github.com/mermaid-js/mermaid-live-editor.git + cd mermaid-live-editor + git checkout '${version}' + ln -sf '${package}/node_modules' + stat .svelte-kit || yarn build + yarn preview + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/nixops.nix b/.config/nixpkgs/shells/nixops.nix deleted file mode 100644 index 4954794..0000000 --- a/.config/nixpkgs/shells/nixops.nix +++ /dev/null @@ -1,19 +0,0 @@ -with import <nixpkgs> { }; - -let - - version = "20.09"; - project = "${builtins.getEnv "HOME"}/Shares/Projects/infrastructure"; - channel = (import "${project}/nixos/versions.nix")."${version}".channel; - -in mkShell { - name = "nixops-${version}"; - shellHook = '' - export VAULT_ADDR='http://vault.test' - export NIX_PATH=${channel}/nixexprs.tar.xz - export _NIX_CHANNEL=${channel} - export PS1='\h (nixos ${version} ''${_NIX_CHANNEL##*.}) \W \$ ' - cd "${project}" - ssh -T git@github.com - ''; -} diff --git a/.config/nixpkgs/shells/nsjail/shell.nix b/.config/nixpkgs/shells/nsjail/shell.nix new file mode 100644 index 0000000..d954588 --- /dev/null +++ b/.config/nixpkgs/shells/nsjail/shell.nix @@ -0,0 +1,52 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://nsjail.dev/ + + name = "nix-shell.nsjail"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + nsjail = { + rootfs ? "rootfs", + options ? [ ], + path ? [ pkgs.busybox ], + entrypoint ? "/bin/sh" + }: + pkgs.writeShellApplication { + inherit name; + text = '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.nsjail pkgs.coreutils ]} + mkdir --parents '${rootfs}' + nsjail \ + --chroot "$(pwd)"/'${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + -- /usr/bin/env --ignore-environment ${ + pkgs.writeScript "entrypoint-${name}" '' + set -eu + export PATH=${pkgs.lib.strings.makeBinPath path} + ${entrypoint} + '' + }; + ''; + }; + + jail = nsjail { + options = [ + "--bindmount_ro /nix" + "--bindmount_ro /usr" + "--bindmount_ro /bin" + ]; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/planner/shell.nix b/.config/nixpkgs/shells/planner/shell.nix new file mode 100644 index 0000000..079beda --- /dev/null +++ b/.config/nixpkgs/shells/planner/shell.nix @@ -0,0 +1,68 @@ +let + + name = "nix-shell.planner"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ lib, stdenvNoCC, fetchgit, pkgconfig, intltool + , automake111x, autoconf, libtool, gnome2, libxslt, python2, gcc48 }: + stdenvNoCC.mkDerivation rec { + pname = "planner"; + version = "de43d655f9f8103993129cde9de3d0e080d0546c"; + src = fetchgit { + url = "https://gitlab.gnome.org/World/planner.git"; + sha256 = "1zpcswdpcjhllk7phy3z1zyxcgqr4pp0vf5fgpg5f3gqpk4xvwyg"; + rev = version; + }; + nativeBuildInputs = [ + autoconf + automake111x + gnome2.gnome-common + gnome2.gtk-doc + gnome2.scrollkeeper + intltool + libtool + pkgconfig + ]; + buildInputs = [ + gcc48 + gnome2.GConf + gnome2.gtk + gnome2.libglade + gnome2.libgnomecanvas + gnome2.libgnomeui + libxslt + python2.pkgs.pygtk + ]; + enableParallelBuilding = true; + preConfigure = "./autogen.sh"; + makeFlags = [ "CFLAGS=-DGLIB_DISABLE_DEPRECATION_WARNINGS" ]; + configureFlags = [ "--enable-python" "--enable-python-plugin" ]; + meta = with lib; { + description = "Project management application for GNOME"; + homepage = "https://wiki.gnome.org/Apps/Planner"; + license = licenses.gpl2Plus; + platforms = platforms.all; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/proot/shell.nix b/.config/nixpkgs/shells/proot/shell.nix new file mode 100644 index 0000000..46ed76f --- /dev/null +++ b/.config/nixpkgs/shells/proot/shell.nix @@ -0,0 +1,52 @@ +let + + # nix-shell -E 'import (builtins.fetchurl "$url")' + # https://manpages.ubuntu.com/manpages/trusty/man1/proot.1.html + + name = "nix-shell.proot"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + proot = { + rootfs ? "rootfs", + binds ? [ ], + options ? [ ], + path ? [ pkgs.busybox ], + entrypoint ? "/bin/sh" + }: + pkgs.writeShellApplication { + inherit name; + text = '' + set -euxo pipefail + PATH=${pkgs.lib.strings.makeBinPath [ pkgs.proot pkgs.coreutils ]} + mkdir --parents '${rootfs}' + proot \ + --rootfs='${rootfs}' \ + ${pkgs.lib.strings.concatMapStringsSep " " (option: "--bind=${option}") binds} \ + ${pkgs.lib.strings.concatMapStringsSep " " (value: value) options} \ + /usr/bin/env --ignore-environment ${ + pkgs.writeScript "entrypoint-${name}" '' + set -eu + export HISTFILE=/dev/null + export PATH=${pkgs.lib.strings.makeBinPath path} + ${entrypoint} + '' + }; + ''; + }; + + jail = proot { + binds = [ "/nix" "/usr" "/bin" ]; + options = [ "--cwd=/" "--verbose=0" ]; + }; + +in pkgs.mkShell { + inherit name; + shellHook = '' + printf '%s\n' "${jail}/bin/${jail.name}" + exec "${jail}/bin/${jail.name}" + ''; +} diff --git a/.config/nixpkgs/shells/pure/shell.nix b/.config/nixpkgs/shells/pure/shell.nix new file mode 100644 index 0000000..2e58365 --- /dev/null +++ b/.config/nixpkgs/shells/pure/shell.nix @@ -0,0 +1,22 @@ +let + + name = "nix-shell.pure"; + pkgs = import <nixpkgs> { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/scribus/shell.nix b/.config/nixpkgs/shells/scribus/shell.nix new file mode 100644 index 0000000..9658c0a --- /dev/null +++ b/.config/nixpkgs/shells/scribus/shell.nix @@ -0,0 +1,96 @@ +let + + name = "nix-shell.scribus"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ lib, stdenv, fetchurl, pkg-config, freetype, lcms, libtiff + , libxml2, gnome2, qt4, python2, cups, fontconfig, libjpeg, zlib, libpng + , xorg, cairo, podofo, hunspell, boost, cmake, imagemagick, ghostscript }: + + let + icon = fetchurl { + url = "https://gist.githubusercontent.com/ejpcmac/a74b762026c9bc4000be624c3d085517/raw/18edc497c5cb6fdeef1c8aede37a0ee68413f9d3/scribus-icon-centered.svg"; + sha256 = "0hq3i7c2l50445an9glhhg47kj26y16svfajc6naqn307ph9vzc3"; + }; + pythonEnv = python2.withPackages (ps: [ ps.tkinter ps.pillow ]); + in stdenv.mkDerivation rec { + pname = "scribus"; + version = "1.4.8"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0bq433myw6h1siqlsakxv6ghb002rp3mfz5k12bg68s0k6skn992"; + }; + + nativeBuildInputs = [ pkg-config cmake ]; + buildInputs = with xorg; [ + boost + cairo + cups + fontconfig + freetype + gnome2.libart_lgpl + hunspell + imagemagick + lcms + libX11 + libXau + libXaw + libXdmcp + libXext + libXi + libXinerama + libXtst + libjpeg + libpng + libpthreadstubs + libtiff + libxml2 + podofo + pythonEnv + qt4 + zlib + ]; + + postPatch = '' + substituteInPlace scribus/util_ghostscript.cpp \ + --replace 'QString gsName("gs");' \ + 'QString gsName("${ghostscript}/bin/gs");' + ''; + + postInstall = '' + for i in 16 24 48 64 96 128 256 512; do + mkdir -p $out/share/icons/hicolor/''${i}x''${i}/apps + convert -background none -resize ''${i}x''${i} ${icon} $out/share/icons/hicolor/''${i}x''${i}/apps/scribus.png + done + ''; + + meta = { + platforms = lib.platforms.linux; + description = "Desktop Publishing (DTP) and Layout program for Linux"; + homepage = "https://www.scribus.net"; + license = lib.licenses.gpl2; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/tilp2/shell.nix b/.config/nixpkgs/shells/tilp2/shell.nix new file mode 100644 index 0000000..f57bc3b --- /dev/null +++ b/.config/nixpkgs/shells/tilp2/shell.nix @@ -0,0 +1,66 @@ +let + + name = "nix-shell.tilp2"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ stdenv, lib, fetchurl, fetchpatch + , autoreconfHook, pkg-config, intltool, glib, gnome2, gtk2, gfm + , libticables2, libticalcs2, libticonv, libtifiles2 }: + + stdenv.mkDerivation rec { + pname = "tilp2"; + version = "1.18"; + src = fetchurl { + url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2"; + sha256 = "0isf73bjwk06baz2gm3vpdh600gqck9ca4aqxzb089dmxriv6fkv"; + }; + + patches = fetchpatch { + name = "remove-broken-kde-support.patch"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/remove-broken-kde-support.patch?h=tilp"; + sha256 = "1fn6vh7r45spkwpmkvffkbn7zrcsdrs5mjmspd5rwi3jc12cy3ny"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config intltool ]; + + buildInputs = [ + glib + gtk2 + gnome2.libglade + gfm + libticables2 + libticalcs2 + libticonv + libtifiles2 + ]; + + meta = with lib; { + changelog = "http://lpg.ticalc.org/prj_tilp/news.html"; + description = "Transfer data between Texas Instruments graphing calculators and a computer"; + homepage = "http://lpg.ticalc.org/prj_tilp/"; + license = licenses.gpl2Plus; + platforms = with platforms; linux ++ darwin; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/npmrc b/.config/npmrc index 813f01a..bf1ad15 100644 --- a/.config/npmrc +++ b/.config/npmrc @@ -1 +1,4 @@ -cache=~/.cache/npm +prefix=${XDG_DATA_HOME}/npm +cache=${XDG_CACHE_HOME}/npm +init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js +update-notifier=false diff --git a/.config/prettier/config.yaml b/.config/prettier/config.yaml new file mode 100644 index 0000000..cdfba32 --- /dev/null +++ b/.config/prettier/config.yaml @@ -0,0 +1,11 @@ +--- +arrowParens: always # Include parentheses around a sole arrow function parameter. +bracketSpacing: true # Print spaces between brackets in object literals. +embeddedLanguageFormatting: off # Never automatically format embedded in markdown code. +printWidth: 80 # Try to limit the line length to 80. +proseWrap: always # Always wrap prose in markdown. +semi: true # Print semicolons at the ends of statements. +singleQuote: false # Use double quotes instead of single quotes. +tabWidth: 2 # Specify the number of spaces per indentation-level. +trailingComma: es5 # Print trailing commas +useTabs: false # Indent lines with tabs instead of spaces. diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 763df21..0270531 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -13,7 +13,7 @@ map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm. map / console scout -ftsea%space # Open with dmenu -map ru shell compgen -c | dmenu -f -i -b -p 'Open With' | xargs -I{} -r bash -c "{} %s &> /dev/null" & +map ru shell compgen -c | dmenu -f -i -b -p ⠀:::⠀open⠀::: | xargs -I{} -r /bin/sh -c "{} %s > /dev/null 2>&1" & # Sort by last modified set sort=ctime diff --git a/.config/recoll/mimeview b/.config/recoll/mimeview new file mode 100644 index 0000000..66c1871 --- /dev/null +++ b/.config/recoll/mimeview @@ -0,0 +1,17 @@ +# The system-wide configuration files for recoll are located in: +# /usr/share/recoll/examples +# The default configuration files are commented, you should take a look +# at them for an explanation of what can be set (you could also take a look +# at the manual instead). +# Values set in this file will override the system-wide values for the file +# with the same name in the central directory. The syntax for setting +# values is identical. + +xallexcepts+ = text/html +xallexcepts- = +[view] +inode/directory = spacefm %f +inode/directory|parentopen = spacefm %f +application/x-fsdirectory = spacefm %f +application/pdf = zathura --page %p --find %s %f +text/html = chromium --new-window --app=file://%f#:~:text=%s diff --git a/.config/rncbc.org/QjackCtl.conf b/.config/rncbc.org/QjackCtl.conf new file mode 100644 index 0000000..c257138 --- /dev/null +++ b/.config/rncbc.org/QjackCtl.conf @@ -0,0 +1,107 @@ +[Defaults] +ConnectionsTabPage=0 +MessagesStatusTabPage=0 +PatchbayPath= +SessionSaveVersion=true + +[GraphView] +Menubar=true +SortOrder=0 +SortType=0 +Statusbar=false +TextBesideIcons=true +Toolbar=false +ZoomRange=false + +[Options] +ActivePatchbay=false +ActivePatchbayPath= +ActivePatchbayReset=false +AliasesEditing=false +AliasesEnabled=false +AlsaSeqEnabled=true +BaseFontSize=0 +ConnectionsFont="Ubuntu Semi-Bold,8,-1,5,50,0,0,0,0,0" +ConnectionsIconSize=0 +CustomColorTheme= +CustomStyleTheme= +DBusEnabled=false +DisplayBlink=true +DisplayEffect=true +DisplayFont1="Monospace,14,-1,5,50,0,0,0,0,0" +DisplayFont2="Monospace,8,-1,5,50,0,0,0,0,0" +GraphButton=true +JackClientPortAlias=0 +JackClientPortMetadata=false +JackDBusEnabled=false +KeepOnTop=false +LeftButtons=true +MessagesFont="Ubuntu Semi-Bold,8,-1,5,50,0,0,0,0,0" +MessagesLimit=true +MessagesLimitLines=1000 +MessagesLog=false +MessagesLogPath=qjackctl.log +PostShutdownScript=false +PostShutdownScriptShell= +PostStartupScript=false +PostStartupScriptShell= +QueryClose=true +QueryDisconnect=true +QueryRestart=false +QueryShutdown=true +RightButtons=true +ServerConfig=false +ServerConfigName=.jackdrc +ShutdownScript=false +ShutdownScriptShell= +Singleton=true +StartJack=false +StartMinimized=false +StartupScript=false +StartupScriptShell= +StdoutCapture=true +StopJack=true +SystemTray=false +SystemTrayQueryClose=false +TextLabels=true +TimeDisplay=0 +TransportButtons=true +XrunRegex=xrun of at least ([0-9|\\.]+) msecs + +[Settings] +Audio=0 +Chan=0 +ClockSource=0 +Dither=0 +Driver=alsa +Frames=1024 +HWMeter=false +IgnoreHW=false +InChannels=0 +InDevice= +InLatency=0 +Interface= +MidiDriver=none +Monitor=false +NoMemLock=false +OutChannels=0 +OutDevice= +OutLatency=0 +Periods=2 +PortMax=256 +Priority=5 +Realtime=true +SampleRate=48000 +SelfConnectMode=32 +Server=jackd +ServerName= +ServerSuffix= +Shorts=false +SoftMode=false +StartDelay=2 +Sync=false +Timeout=500 +UnlockMem=false +Verbose=false +Wait=21333 +WordLength=16 diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..af15d51 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,9 @@ +configuration { + kb-remove-to-eol: ""; + disable-history: false; + kb-row-up: "Up,Control+k"; + kb-row-down: "Down,Control+j"; + kb-accept-entry: "Control+m,Return,KP_Enter"; +} + +@theme "theme" diff --git a/.config/rofi/theme.rasi b/.config/rofi/theme.rasi new file mode 100644 index 0000000..8869f36 --- /dev/null +++ b/.config/rofi/theme.rasi @@ -0,0 +1,168 @@ +* { + red: rgba (220, 50, 47, 100 %); + selected-active-foreground: rgba (27, 43, 52, 100 %); + lightfg: rgba (88, 104, 117, 100 %); + separatorcolor: rgba (250, 200, 99, 100 %); + urgent-foreground: rgba (249, 145, 87, 100 %); + alternate-urgent-background: rgba (0, 0, 0, 0 %); + lightbg: rgba (238, 232, 213, 100 %); + background-color: rgba (0, 0, 0, 0 %); + border-color: rgba (250, 200, 99, 100 %); + normal-background: rgba (0, 0, 0, 0 %); + selected-urgent-background: rgba (249, 145, 87, 100 %); + alternate-active-background: rgba (0, 0, 0, 0 %); + spacing: 2; + blue: rgba (38, 139, 210, 100 %); + alternate-normal-foreground: var(foreground); + urgent-background: rgba (0, 0, 0, 0 %); + selected-normal-foreground: rgba (27, 43, 52, 100 %); + active-foreground: rgba (255, 255, 255, 100 %); + background: rgba (34, 34, 34, 80 %); + selected-active-background: rgba (102, 153, 204, 100 %); + active-background: rgba (0, 0, 0, 0 %); + selected-normal-background: rgba (250, 200, 99, 100 %); + alternate-normal-background: rgba (0, 0, 0, 0 %); + foreground: rgba (255, 255, 255, 100 %); + selected-urgent-foreground: rgba (27, 43, 52, 100 %); + normal-foreground: var(foreground); + alternate-urgent-foreground: var(urgent-foreground); + alternate-active-foreground: var(active-foreground); +} +element { + padding: 1px; + spacing: 5px; + border: 0; +} +element normal.normal { + background-color: var(normal-background); + text-color: var(normal-foreground); +} +element normal.urgent { + background-color: var(urgent-background); + text-color: var(urgent-foreground); +} +element normal.active { + background-color: var(active-background); + text-color: var(active-foreground); +} +element selected.normal { + background-color: var(selected-normal-background); + text-color: var(selected-normal-foreground); +} +element selected.urgent { + background-color: var(selected-urgent-background); + text-color: var(selected-urgent-foreground); +} +element selected.active { + background-color: var(selected-active-background); + text-color: var(selected-active-foreground); +} +element alternate.normal { + background-color: var(alternate-normal-background); + text-color: var(alternate-normal-foreground); +} +element alternate.urgent { + background-color: var(alternate-urgent-background); + text-color: var(alternate-urgent-foreground); +} +element alternate.active { + background-color: var(alternate-active-background); + text-color: var(alternate-active-foreground); +} +element-text { + background-color: rgba (0, 0, 0, 0 %); + highlight: inherit; + text-color: inherit; +} +element-icon { + background-color: rgba (0, 0, 0, 0 %); + size: 1em; + text-color: inherit; +} +window { + padding: 15; + background-color: var(background); + border: 1px; +} +mainbox { + padding: 0; + border: 0; +} +message { + padding: 1px; + border-color: var(separatorcolor); + border: 0; +} +textbox { + text-color: var(foreground); +} +listview { + padding: 2px 0 0; + scrollbar: false; + border-color: var(separatorcolor); + spacing: 2px; + fixed-height: 0; + border: 0; +} +scrollbar { + width: 4px; + padding: 0; + handle-width: 8px; + border: 0; + handle-color: var(normal-foreground); +} +sidebar { + border-color: var(separatorcolor); + border: 2px dash 0 0; +} +button { + spacing: 0; + text-color: var(normal-foreground); +} +button selected { + background-color: var(selected-normal-background); + text-color: var(selected-normal-foreground); +} +num-filtered-rows { + expand: false; + text-color: rgba (128, 128, 128, 100 %); +} +num-rows { + expand: false; + text-color: rgba (128, 128, 128, 100 %); +} +textbox-num-sep { + expand: false; + str: "/"; + text-color: rgba (128, 128, 128, 100 %); +} +inputbar { + padding: 1px; + spacing: 0; + text-color: var(normal-foreground); + children: [ prompt, textbox-prompt-colon, entry, num-filtered-rows, + textbox-num-sep, num-rows, case-indicator ]; +} +case-indicator { + spacing: 0; + text-color: var(normal-foreground); +} +entry { + text-color: var(normal-foreground); + spacing: 0; + placeholder-color: rgba (128, 128, 128, 100 %); + placeholder: "Type to filter"; +} +prompt { + spacing: 0; + text-color: var(normal-foreground); +} +textbox-prompt-colon { + margin: 0 0.3em 0em 0em; + expand: false; + str: ":"; + text-color: inherit; +} +mode-switcher { + border: 0; +} diff --git a/.config/screenkey.json b/.config/screenkey.json new file mode 100644 index 0000000..0665358 --- /dev/null +++ b/.config/screenkey.json @@ -0,0 +1,26 @@ +{ + "no_systray": false, + "timeout": 2.5, + "recent_thr": 0.1, + "compr_cnt": 3, + "ignore": [], + "position": "bottom", + "persist": false, + "font_desc": "Sans Bold", + "font_size": "small", + "font_color": "#000000", + "bg_color": "#000000", + "opacity": 0, + "key_mode": "composed", + "bak_mode": "baked", + "mods_mode": "normal", + "mods_only": false, + "multiline": false, + "vis_shift": true, + "vis_space": true, + "geometry": null, + "screen": 0, + "start_disabled": false, + "mouse": false, + "button_hide_duration": 1 +} diff --git a/.config/seance/spirits b/.config/seance/spirits new file mode 100644 index 0000000..a305c48 --- /dev/null +++ b/.config/seance/spirits @@ -0,0 +1,11 @@ +anki +bin/chromium +claws-mail +keepassxc +mupdf +spacefm +urxvt -e vim +urxvt -hold +zim +QOwnNotes +recoll diff --git a/.config/skippy-xd/skippy-xd.rc b/.config/skippy-xd/skippy-xd.rc index b2d867f..5fac657 100644 --- a/.config/skippy-xd/skippy-xd.rc +++ b/.config/skippy-xd/skippy-xd.rc @@ -20,6 +20,7 @@ clientDisplayModes = thumbnail icon filled none iconFillSpec = orig mid mid #00FFFF fillSpec = orig mid mid #FFFFFF background = +animationDuration = 0 [xinerama] showAll = true diff --git a/.config/spacefm/session b/.config/spacefm/session index 07cec65..f99e196 100644 --- a/.config/spacefm/session +++ b/.config/spacefm/session @@ -569,7 +569,7 @@ cstm_298bc815-key=111 cstm_298bc815-keymod=4 cstm_298bc815-label=Open with... cstm_298bc815-prev=con_open -cstm_298bc815-line=bash -c 'compgen -c' | dmenu -f -i -b -p 'Open With' | xargs -I{} -r bash -c "{} '${fm_files[@]}'" +cstm_298bc815-line=bash -c 'compgen -c' | dmenu -f -i -b -p '⠀:::⠀open⠀:::' | xargs -I{} -r bash -c "{} '${fm_files[@]}'" cstm_298bc815-task_err=1 cstm_298bc815-task_out=1 cstm_36fddd7b-y= diff --git a/.config/stylelint/config.js b/.config/stylelint/config.js new file mode 100644 index 0000000..77db00b --- /dev/null +++ b/.config/stylelint/config.js @@ -0,0 +1,45 @@ +'use strict'; + +module.exports = { + rules: { + 'at-rule-no-unknown': true, + 'block-no-empty': true, + 'color-no-invalid-hex': true, + 'comment-no-empty': true, + 'declaration-block-no-duplicate-custom-properties': true, + 'declaration-block-no-duplicate-properties': [ + true, + { + ignore: ['consecutive-duplicates-with-different-values'], + }, + ], + 'declaration-block-no-shorthand-property-overrides': true, + 'font-family-no-duplicate-names': true, + 'font-family-no-missing-generic-family-keyword': true, + 'function-calc-no-invalid': true, + 'function-calc-no-unspaced-operator': true, + 'function-linear-gradient-no-nonstandard-direction': true, + 'keyframe-declaration-no-important': true, + 'media-feature-name-no-unknown': true, + 'named-grid-areas-no-invalid': true, + 'no-descending-specificity': true, + 'no-duplicate-at-import-rules': true, + 'no-duplicate-selectors': true, + 'no-empty-source': true, + 'no-extra-semicolons': true, + 'no-invalid-double-slash-comments': true, + 'no-invalid-position-at-import-rule': true, + 'no-irregular-whitespace': true, + 'property-no-unknown': true, + 'selector-pseudo-class-no-unknown': true, + 'selector-pseudo-element-no-unknown': true, + 'selector-type-no-unknown': [ + true, + { + ignore: ['custom-elements'], + }, + ], + 'string-no-newline': true, + 'unit-no-unknown': true, + }, +}; diff --git a/.config/swc/swc.json b/.config/swc/swc.json new file mode 100644 index 0000000..2f3bfc6 --- /dev/null +++ b/.config/swc/swc.json @@ -0,0 +1,23 @@ +{ + "jsc": { + "parser": { + "syntax": "ecmascript", + "jsx": false, + "dynamicImport": false, + "privateMethod": false, + "functionBind": false, + "exportDefaultFrom": false, + "exportNamespaceFrom": false, + "decorators": false, + "decoratorsBeforeExport": false, + "topLevelAwait": false, + "importMeta": false, + "preserveAllComments": false + }, + "target": "es3", + "loose": false, + "externalHelpers": false, + "keepClassNames": false + }, + "isModule": false +}
\ No newline at end of file diff --git a/.config/systemd/user/autocutsel.service b/.config/systemd/user/autocutsel.service new file mode 100644 index 0000000..495e703 --- /dev/null +++ b/.config/systemd/user/autocutsel.service @@ -0,0 +1,16 @@ +[Unit] +Description=Keep the X clipboard and the cutbuffer in sync +StartLimitIntervalSec=0 + +[Service] +Type=forking +RestartSec=3 +Restart=always +SyslogIdentifier=autocutsel +ExecStartPre=/usr/bin/env autocutsel -fork -selection PRIMARY +ExecStart=/usr/bin/env autocutsel -fork -selection CLIPBOARD +MemoryHigh=3M +MemoryMax=5M + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/copyq.service b/.config/systemd/user/copyq.service index cd09ee0..4d9afab 100644 --- a/.config/systemd/user/copyq.service +++ b/.config/systemd/user/copyq.service @@ -1,12 +1,13 @@ [Unit] Description=Copyq server +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/usr/bin/env copyq +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=copyq +ExecStart=/usr/bin/env copyq [Install] WantedBy=default.target diff --git a/.config/systemd/user/events-idle.service b/.config/systemd/user/events-idle.service index 7c5cdec..62b4edd 100644 --- a/.config/systemd/user/events-idle.service +++ b/.config/systemd/user/events-idle.service @@ -1,15 +1,16 @@ [Unit] Description=Execute events on X11 idle +StartLimitIntervalSec=0 [Service] Type=simple -ExecStartPre=/usr/bin/env sh -c '%h/.local/bin/scripts/events-idle' -ExecStart=/usr/bin/env sh -c 'while true; do sleep 300 && [ "$(xprintidle)" -gt 120000 ] && %h/.local/bin/scripts/events-idle; done' +IOWeight=60 +CPUQuota=60% +RestartSec=5 Restart=always -RestartSec=5s SyslogIdentifier=events-idle -CPUQuota=60% -IOWeight=60 +ExecStartPre=/usr/bin/env sh -c 'events-idle' +ExecStart=/usr/bin/env sh -c 'while true; do sleep 300 && [ "$(xprintidle)" -gt 120000 ] && events-idle; done' [Install] WantedBy=default.target diff --git a/.config/systemd/user/events-resume.service b/.config/systemd/user/events-resume.service index b8bce6a..a65c0a8 100644 --- a/.config/systemd/user/events-resume.service +++ b/.config/systemd/user/events-resume.service @@ -1,12 +1,13 @@ [Unit] Description=Execute events on resume event +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/usr/bin/env sh -c 'dbus-monitor --system | while read; do grep -q 'PrepareForSleep' && %h/.local/bin/scripts/events-resume; done' +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=events-resume +ExecStart=/usr/bin/env sh -c 'dbus-monitor --system | while read; do grep -q 'PrepareForSleep' && events-resume; done' [Install] WantedBy=default.target diff --git a/.config/systemd/user/events-usb.service b/.config/systemd/user/events-usb.service index d2a5b63..201d171 100644 --- a/.config/systemd/user/events-usb.service +++ b/.config/systemd/user/events-usb.service @@ -1,12 +1,13 @@ [Unit] Description=Execute events on kernel usb events +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/usr/bin/env sh -c 'udevadm monitor | while read; do grep -m1 -q "(usb)" && %h/.local/bin/scripts/events-usb; done' +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=events-usb +ExecStart=/usr/bin/env sh -c 'udevadm monitor | while read; do grep -m1 -q "(usb)" && events-usb; done' [Install] WantedBy=default.target diff --git a/.config/systemd/user/flameshot.service b/.config/systemd/user/flameshot.service index 431fc04..1761acd 100644 --- a/.config/systemd/user/flameshot.service +++ b/.config/systemd/user/flameshot.service @@ -1,12 +1,13 @@ [Unit] Description=Screenshot tool +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/usr/bin/env flameshot +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=flameshot +ExecStart=/usr/bin/env flameshot [Install] WantedBy=default.target diff --git a/.config/systemd/user/plank.service b/.config/systemd/user/plank.service index 4f92af7..760e71b 100644 --- a/.config/systemd/user/plank.service +++ b/.config/systemd/user/plank.service @@ -4,12 +4,12 @@ StartLimitIntervalSec=0 [Service] Type=simple -Environment=XDG_SESSION_TYPE=X11 -ExecStart=/usr/bin/env plank +RestartSec=1 Restart=always -RestartSec=1s KillMode=process SyslogIdentifier=plank +ExecStart=/usr/bin/env plank +Environment=XDG_SESSION_TYPE=X11 [Install] WantedBy=default.target diff --git a/.config/systemd/user/redshift.service b/.config/systemd/user/redshift.service index e18f1e4..4392596 100644 --- a/.config/systemd/user/redshift.service +++ b/.config/systemd/user/redshift.service @@ -1,12 +1,13 @@ [Unit] Description=Redshift +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/usr/bin/env redshift +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=redshift +ExecStart=/usr/bin/env redshift [Install] WantedBy=default.target diff --git a/.config/systemd/user/syncthing.service b/.config/systemd/user/syncthing.service index d1b862c..2e5ebc6 100644 --- a/.config/systemd/user/syncthing.service +++ b/.config/systemd/user/syncthing.service @@ -1,21 +1,14 @@ [Unit] Description=Syncthing - Open Source Continuous File Synchronization -After=network.target +StartLimitIntervalSec=0 [Service] -ExecStart=/usr/bin/env syncthing -no-browser -no-restart -logflags=0 +IOWeight=60 +CPUQuota=60% +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=syncthing -CPUQuota=60% -IOWeight=60 - -# Hardening -ProtectSystem=full -PrivateTmp=true -SystemCallArchitectures=native -MemoryDenyWriteExecute=true -NoNewPrivileges=true +ExecStart=/usr/bin/env syncthing -no-browser -no-restart -logflags=0 [Install] WantedBy=default.target diff --git a/.config/systemd/user/unclutter.service b/.config/systemd/user/unclutter.service index ac4941c..78f0c40 100644 --- a/.config/systemd/user/unclutter.service +++ b/.config/systemd/user/unclutter.service @@ -1,12 +1,13 @@ [Unit] Description=Hide mouse on idle +StartLimitIntervalSec=0 [Service] Type=simple -ExecStart=/usr/bin/env unclutter -idle 1 +RestartSec=3 Restart=always -RestartSec=5s SyslogIdentifier=unclutter +ExecStart=/usr/bin/env unclutter -idle 1 -grab [Install] WantedBy=default.target diff --git a/.config/systemd/user/workout-notify.service b/.config/systemd/user/workout-notify.service index 3ea82f4..e043f07 100644 --- a/.config/systemd/user/workout-notify.service +++ b/.config/systemd/user/workout-notify.service @@ -4,5 +4,5 @@ Description=Workout notifications [Service] Type=oneshot Environment=DISPLAY=:0 -ExecStart=%h/.local/bin/scripts/workout-notify +ExecStart=/usr/bin/env sh -c 'workout-notify' SyslogIdentifier=workout-notify diff --git a/.config/systemd/user/x0vncserver.service b/.config/systemd/user/x0vncserver.service deleted file mode 100644 index e3e1abe..0000000 --- a/.config/systemd/user/x0vncserver.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Remote desktop service (VNC) - -[Service] -Type=forking -ExecStart=/usr/bin/env /usr/bin/sh -c '/usr/bin/x0vncserver -rfbport 5900 -RemapKeys="0x3c->0x2c" -passwordfile %h/.vnc/passwd &' -Restart=always -RestartSec=5s -SyslogIdentifier=x0vncserver - -[Install] -WantedBy=default.target diff --git a/.config/systemd/user/x11vnc.service b/.config/systemd/user/x11vnc.service index 6dd50bd..b055585 100644 --- a/.config/systemd/user/x11vnc.service +++ b/.config/systemd/user/x11vnc.service @@ -4,10 +4,10 @@ StartLimitIntervalSec=0 [Service] Type=simple -RestartSec=1s +RestartSec=3 Restart=always SyslogIdentifier=x11vnc -ExecStart=/usr/bin/env x11vnc -display :0 -rfbport 5900 -usepw -nowf -norepeat -forever -noxrecord -noxfixes -auth $XAUTHORITY +ExecStart=/usr/bin/env x11vnc -display $DISPLAY -rfbport 5901 -shared -usepw -forever -nowireframe -norepeat -noxdamage -noxrecord -ncache_cr -noxfixes -cursor arrow -auth $XAUTHORITY [Install] WantedBy=default.target diff --git a/.config/systemd/user/xbindkeys.service b/.config/systemd/user/xbindkeys.service index 9e94b36..5f312b8 100644 --- a/.config/systemd/user/xbindkeys.service +++ b/.config/systemd/user/xbindkeys.service @@ -1,13 +1,14 @@ [Unit] Description=Keyboard shortcut binder +StartLimitIntervalSec=0 [Service] Type=simple -RestartSec=5s +RestartSec=3 Restart=always KillMode=process SyslogIdentifier=xbindkeys -ExecStart=/usr/bin/env bash -l -c 'xbindkeys -f %h/.config/xbindkeysrc -p -n' +ExecStart=/usr/bin/env bash -l -c 'xbindkeys -f %h/.config/X11/xbindkeysrc -p -n' [Install] WantedBy=default.target diff --git a/.config/tidy.conf b/.config/tidy.conf new file mode 100644 index 0000000..c031d89 --- /dev/null +++ b/.config/tidy.conf @@ -0,0 +1,13 @@ +accessibility-check: 0 +ascii-chars: yes +clean: yes +custom-tags: blocklevel +drop-empty-elements: no +fix-style-tags: no +indent-spaces: 2 +indent: yes +markup: no +quiet: no +show-body-only: yes +vertical-space: yes +wrap: 80 diff --git a/.config/tidy/url.conf b/.config/tidy/url.conf new file mode 100644 index 0000000..a762628 --- /dev/null +++ b/.config/tidy/url.conf @@ -0,0 +1,13 @@ +accessibility-check: 0 +ascii-chars: yes +clean: yes +custom-tags: blocklevel +drop-empty-elements: no +fix-style-tags: no +indent-spaces: 2 +indent: yes +markup: no +quiet: yes +show-body-only: yes +vertical-space: yes +wrap: 80 diff --git a/.config/urxvt/ext/keyboard-select b/.config/urxvt/ext/keyboard-select new file mode 100644 index 0000000..14405d4 --- /dev/null +++ b/.config/urxvt/ext/keyboard-select @@ -0,0 +1,606 @@ +#! perl -w +# Author: Bert Muennich +# Website: http://www.github.com/muennich/urxvt-perls +# License: GPLv2 + +# Use keyboard shortcuts to select and copy text. + +# Usage: put the following lines in your .Xdefaults/.Xresources: +# URxvt.perl-ext-common: ...,keyboard-select +# URxvt.keysym.M-Escape: perl:keyboard-select:activate +# The following line overwrites the default Meta-s binding and allows to +# activate keyboard-select directly in backward search mode: +# URxvt.keysym.M-s: perl:keyboard-select:search + +# Use Meta-Escape to activate selection mode, then use the following keys: +# h/j/k/l: Move cursor left/down/up/right (also with arrow keys) +# g/G/0/^/$/H/M/L/f/F/;/,/w/W/b/B/e/E: More vi-like cursor movement keys +# '/'/?: Start forward/backward search +# n/N: Repeat last search, N: in reverse direction +# Ctrl-f/b: Scroll down/up one screen +# Ctrl-d/u: Scroll down/up half a screen +# v/V/Ctrl-v: Toggle normal/linewise/blockwise selection +# y/Return: Copy selection to primary buffer, Return: quit afterwards +# Y: Copy selected lines to primary buffer or cursor line and quit +# q/Escape: Quit keyboard selection mode + +# Options: +# URxvt.keyboard-select.clipboard: If true, copy to clipboard too + + +use strict; + +sub on_start{ + my ($self) = @_; + + $self->{clipboard} = $self->x_resource_boolean('keyboard-select.clipboard'); + + $self->{patterns}{'w'} = qr/\w[^\w\s]|\W\w|\s\S/; + $self->{patterns}{'W'} = qr/\s\S/; + $self->{patterns}{'b'} = qr/.*(?:\w[^\w\s]|\W\w|\s\S)/; + $self->{patterns}{'B'} = qr/.*\s\S/; + $self->{patterns}{'e'} = qr/[^\w\s](?=\w)|\w(?=\W)|\S(?=\s|$)/; + $self->{patterns}{'E'} = qr/\S(?=\s|$)/; + + () +} + + +sub on_action { + my ($self, $action) = @_; + + on_user_command($self, "keyboard-select:" . $action); +} + + +sub on_user_command { + my ($self, $cmd) = @_; + + if (not $self->{active}) { + if ($cmd eq 'keyboard-select:activate') { + activate($self); + } elsif ($cmd eq 'keyboard-select:search') { + activate($self, 1); + } + } + + () +} + + +sub key_press { + my ($self, $event, $keysym, $char) = @_; + my $key = chr($keysym); + + if (lc($key) eq 'c' && $event->{state} & urxvt::ControlMask) { + deactivate($self); + } elsif ($self->{search}) { + if ($keysym == 0xff1b) { + if ($self->{search_mode}) { + deactivate($self); + } else { + $self->{search} = ''; + status_area($self); + } + } elsif ($keysym == 0xff08) { + $self->{search} = substr($self->{search}, 0, -1); + if (not $self->{search} and $self->{search_mode}) { + deactivate($self); + } else { + status_area($self); + } + } elsif ($keysym == 0xff0d || + (lc($key) eq 'm' && $event->{state} & urxvt::ControlMask)) { + my $txt = substr($self->{search}, 1); + if ($txt) { + $self->{pattern} = ($txt =~ m/[[:upper:]]/) ? qr/\Q$txt\E/ : + qr/\Q$txt\E/i; + } elsif ($self->{pattern}) { + delete $self->{pattern}; + } + $self->{search} = ''; + $self->screen_cur($self->{srhcr}, $self->{srhcc}); + if (not find_next($self)) { + if ($self->{search_mode}) { + deactivate($self); + } else { + status_area($self); + } + } + } elsif (length($char) > 0) { + $self->{search} .= $self->locale_decode($char); + my $txt = substr($self->{search}, 1); + if ($txt) { + $self->{pattern} = ($txt =~ m/[[:upper:]]/) ? qr/\Q$txt\E/ : + qr/\Q$txt\E/i; + } elsif ($self->{pattern}) { + delete $self->{pattern}; + } + $self->screen_cur($self->{srhcr}, $self->{srhcc}); + find_next($self); + status_area($self); + } + } elsif ($self->{move_to}) { + if ($keysym == 0xff1b) { + $self->{move_to} = 0; + status_area($self); + } elsif (length($char) > 0) { + $self->{move_to} = 0; + $self->{patterns}{'f-1'} = qr/^.*\Q$key\E/; + $self->{patterns}{'f+1'} = qr/^.+?\Q$key\E/; + move_to($self, ';'); + status_area($self); + } + } elsif ($keysym == 0xff1b || lc($key) eq 'q') { + deactivate($self); + } elsif (lc($key) eq 'y' || $keysym == 0xff0d || + (lc($key) eq 'm' && $event->{state} & urxvt::ControlMask)) { + my $quit = 0; + if ($key eq 'Y' && $self->{select} ne 'l') { + $quit = !$self->{select}; + toggle_select($self, 'l'); + } + if ($self->{select}) { + my ($br, $bc, $er, $ec) = calc_span($self); + $ec = $self->line($er)->l if $self->{select} eq 'l'; + $self->selection_beg($br, $bc); + $self->selection_end($er, $ec); + $self->selection_make($event->{time}, $self->{select} eq 'b'); + if ($self->{clipboard}) { + $self->selection($self->selection(), 1); + $self->selection_grab($event->{time}, 1); + } + if (lc($key) eq 'y') { + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + $self->{select} = ''; + status_area($self); + $self->want_refresh(); + } else { + $quit = 1; + } + } + if ($quit) { + deactivate($self); + } + } elsif ($key eq 'V') { + toggle_select($self, 'l'); + } elsif ($key eq 'v') { + if ($event->{state} & urxvt::ControlMask) { + toggle_select($self, 'b'); + } else { + toggle_select($self, 'n'); + } + } elsif ($key eq 'k' || $keysym == 0xff52) { + move_cursor($self, 'k'); + } elsif ($key eq 'j' || $keysym == 0xff54) { + move_cursor($self, 'j'); + } elsif ($key eq 'h' || $keysym == 0xff51) { + move_cursor($self, 'h'); + } elsif ($key eq 'l' || $keysym == 0xff53) { + move_cursor($self, 'l'); + } elsif ($keysym == 0xff57) { + move_cursor($self, '$'); + } elsif ($keysym == 0xff50) { + move_cursor($self, '^'); + } elsif ('gG0^$HML' =~ m/\Q$key\E/ || + ('fbdu' =~ m/\Q$key\E/ && $event->{state} & urxvt::ControlMask)) { + move_cursor($self, $key); + } elsif (lc($key) eq 'f') { + $self->{move_to} = 1; + $self->{move_dir} = $key eq 'F' ? -1 : 1; + status_area($self, $key); + } elsif (';,wWbBeE' =~ m/\Q$key\E/) { + move_to($self, $key); + } elsif ($key eq '/' || $key eq '?') { + $self->{search} = $key; + $self->{search_dir} = $key eq '?' ? -1 : 1; + ($self->{srhcr}, $self->{srhcc}) = $self->screen_cur(); + status_area($self); + } elsif (lc($key) eq 'n') { + find_next($self, $self->{search_dir} * ($key eq 'N' ? -1 : 1)); + } + + return 1; +} + + +sub move_cursor { + my ($self, $key) = @_; + my ($cr, $cc) = $self->screen_cur(); + my $line = $self->line($cr); + + if ($key eq 'k' && $line->beg > $self->top_row) { + $cr = $line->beg - 1; + } elsif ($key eq 'j' && $line->end < $self->nrow - 1) { + $cr = $line->end + 1; + } elsif ($key eq 'h' && $self->{offset} > 0) { + $self->{offset} = $line->offset_of($cr, $cc) - 1; + $self->{dollar} = 0; + } elsif ($key eq 'l' && $self->{offset} < $line->l - 1) { + ++$self->{offset}; + } elsif ($key eq 'f' || $key eq 'd') { + my $vs = $self->view_start() + + ($key eq 'd' ? $self->nrow / 2 : $self->nrow - 1); + $vs = 0 if $vs > 0; + $cr += $vs - $self->view_start($vs); + } elsif ($key eq 'b' || $key eq 'u') { + my $vs = $self->view_start() - + ($key eq 'u' ? $self->nrow / 2 : $self->nrow - 1); + $vs = $self->top_row if $vs < $self->top_row; + $cr += $vs - $self->view_start($vs); + } elsif ($key eq 'g') { + ($cr, $self->{offset}) = ($self->top_row, 0); + $self->{dollar} = 0; + } elsif ($key eq 'G') { + ($cr, $self->{offset}) = ($self->nrow - 1, 0); + $self->{dollar} = 0; + } elsif ($key eq '0') { + $self->{offset} = 0; + $self->{dollar} = 0; + } elsif ($key eq '^') { + my $ltxt = $self->special_decode($line->t); + while ($ltxt =~ s/^( *)\t/$1 . " " x (8 - length($1) % 8)/e) {} + $self->{offset} = $ltxt =~ m/^ +/ ? $+[0] : 0; + $self->{dollar} = 0; + } elsif ($key eq '$') { + my $co = $line->offset_of($cr, $cc); + $self->{dollar} = $co + 1; + $self->{offset} = $line->l - 1; + } elsif ($key eq 'H') { + $cr = $self->view_start(); + } elsif ($key eq 'M') { + $cr = $self->view_start() + $self->nrow / 2; + } elsif ($key eq 'L') { + $cr = $self->view_start() + $self->nrow - 1; + } + + $line = $self->line($cr); + $cc = $self->{dollar} || $self->{offset} >= $line->l ? $line->l - 1 : + $self->{offset}; + $self->screen_cur($line->coord_of($cc)); + + status_area($self); + $self->want_refresh(); + + () +} + + +sub move_to { + my ($self, $key) = @_; + my ($cr, $cc) = $self->screen_cur(); + my $line = $self->line($cr); + my $offset = $self->{offset}; + my ($dir, $pattern); + my ($wrap, $found) = (0, 0); + + if ($key eq ';' || $key eq ',') { + $dir = $self->{move_dir} * ($key eq ',' ? -1 : 1); + $pattern = $self->{patterns}{sprintf('f%+d', $dir)}; + return if not $pattern; + } else { + if (lc($key) eq 'b') { + $dir = -1; + } else { + $dir = 1; + ++$offset if lc($key) eq 'e'; + } + $pattern = $self->{patterns}{$key}; + $wrap = 1; + } + + if ($dir > 0) { + NEXTDOWN: my $text = substr($line->t, $offset); + if ($text =~ m/$pattern/) { + $offset += $+[0] - 1; + $found = 1; + } elsif ($wrap && $line->end + 1 < $self->nrow) { + $cr = $line->end + 1; + $line = $self->line($cr); + $offset = 0; + if (lc($key) eq 'e') { + goto NEXTDOWN; + } else { + $found = 1; + } + } + } elsif ($dir < 0) { + NEXTUP: my $text = substr($line->t, 0, $offset); + if ($text =~ m/$pattern/) { + $offset += $+[0] - length($text) - 1; + $found = 1; + } elsif ($wrap) { + if ($offset > 0) { + $offset = 0; + $found = 1; + } elsif ($line->beg > $self->top_row) { + $cr = $line->beg - 1; + $line = $self->line($cr); + $offset = $line->l; + goto NEXTUP; + } + } + } + + if ($found) { + $self->{dollar} = 0; + $self->{offset} = $offset; + $self->screen_cur($line->coord_of($offset)); + $self->want_refresh(); + } + + () +} + + +sub find_next { + my ($self, $dir) = @_; + + return if not $self->{pattern}; + $dir = $self->{search_dir} if not $dir; + + my ($cr, $cc) = $self->screen_cur(); + my $line = $self->line($cr); + my $offset = $line->offset_of($cr, $cc); + my $text; + my $found = 0; + + ++$offset if $dir > 0; + + while (not $found) { + if ($dir > 0) { + $text = substr($line->t, $offset); + if ($text =~ m/$self->{pattern}/) { + $found = 1; + $offset += $-[0]; + } else { + last if $line->end >= $self->nrow; + $line = $self->line($line->end + 1); + $offset = 0; + } + } else { + $text = substr($line->t, 0, $offset); + if ($text =~ m/$self->{pattern}/) { + $found = 1; + $offset = $-[0] while $text =~ m/$self->{pattern}/g; + } else { + last if $line->beg <= $self->top_row; + $line = $self->line($line->beg - 1); + $offset = $line->l; + } + } + } + + if ($found) { + $self->{dollar} = 0; + $self->{offset} = $offset; + $self->screen_cur($line->coord_of($offset)); + status_area($self); + $self->want_refresh(); + } + + return $found; +} + + +sub tt_write { + return 1; +} + + +sub refresh { + my ($self) = @_; + my ($cr, $cc) = $self->screen_cur(); + + # scroll the current cursor position into visible area + if ($cr < $self->view_start()) { + $self->view_start($cr); + } elsif ($cr >= $self->view_start() + $self->nrow) { + $self->view_start($cr - $self->nrow + 1); + } + + if ($self->{select}) { + my ($hl, $reverse_cursor); + my ($br, $bc, $er, $ec) = calc_span($self); + + if ($self->x_resource('highlightColor')) { + $hl = urxvt::RS_Sel; + $reverse_cursor = 0; + } else { + $hl = urxvt::RS_RVid; + $reverse_cursor = $self->{select} ne 'l'; + } + if ($self->{select} eq 'b') { + my $co = $self->line($cr)->offset_of($cr, $cc); + my $dollar = $self->{dollar} && $co >= $self->{dollar} - 1; + + my $r = $br; + while ($r <= $er) { + my $line = $self->line($r); + if ($bc < $line->l) { + $ec = $line->l if $dollar; + my ($br, $bc) = $line->coord_of($bc); + my ($er, $ec) = $line->coord_of($ec <= $line->l ? $ec : $line->l); + $self->scr_xor_span($br, $bc, $er, $ec, $hl); + } elsif ($r == $cr) { + $reverse_cursor = 0; + } + $r = $line->end + 1; + } + } else { + $self->scr_xor_span($br, $bc, $er, $ec, $hl); + } + + if ($reverse_cursor) { + # make the cursor visible again + $self->scr_xor_span($cr, $cc, $cr, $cc + 1, $hl); + } + } + + () +} + + +sub activate { + my ($self, $search) = @_; + + $self->{active} = 1; + + $self->{select} = ''; + $self->{dollar} = 0; + $self->{move_to} = 0; + + if ($search) { + $self->{search} = '?'; + $self->{search_dir} = -1; + $self->{search_mode} = 1; + } else { + $self->{search} = ''; + $self->{search_mode} = 0; + } + + ($self->{oldcr}, $self->{oldcc}) = $self->screen_cur(); + ($self->{srhcr}, $self->{srhcc}) = $self->screen_cur(); + $self->{old_view_start} = $self->view_start(); + $self->{old_pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE); + + my $line = $self->line($self->{oldcr}); + $self->{offset} = $line->offset_of($self->{oldcr}, $self->{oldcc}); + + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + + $self->enable( + key_press => \&key_press, + refresh_begin => \&refresh, + refresh_end => \&refresh, + tt_write => \&tt_write, + ); + + if ($self->{offset} >= $line->l) { + $self->{offset} = $line->l > 0 ? $line->l - 1 : 0; + $self->screen_cur($line->coord_of($self->{offset})); + $self->want_refresh(); + } + + $self->{overlay_len} = 0; + status_area($self); + + () +} + + +sub deactivate { + my ($self) = @_; + + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + + delete $self->{overlay} if $self->{overlay}; + + $self->disable("key_press", "refresh_begin", "refresh_end", "tt_write"); + $self->screen_cur($self->{oldcr}, $self->{oldcc}); + $self->view_start($self->{old_view_start}); + $self->pty_ev_events($self->{old_pty_ev_events}); + + $self->want_refresh(); + + $self->{active} = 0; + + () +} + + +sub status_area { + my ($self, $extra) = @_; + my ($stat, $stat_len); + + if ($self->{search}) { + $stat_len = $self->ncol; + $stat = $self->{search} . ' ' x ($stat_len - length($self->{search})); + } else { + if ($self->{select}) { + $stat = "-V" . ($self->{select} ne 'n' ? uc($self->{select}) : "") . "- "; + } + + if ($self->top_row == 0) { + $stat .= "All"; + } elsif ($self->view_start() == $self->top_row) { + $stat .= "Top"; + } elsif ($self->view_start() == 0) { + $stat .= "Bot"; + } else { + $stat .= sprintf("%2d%%", + ($self->top_row - $self->view_start) * 100 / $self->top_row); + } + + $stat = "$extra $stat" if $extra; + $stat_len = length($stat); + } + + if (!$self->{overlay} || $self->{overlay_len} != $stat_len) { + delete $self->{overlay} if $self->{overlay}; + $self->{overlay} = $self->overlay(-1, -1, $stat_len, 1, + urxvt::OVERLAY_RSTYLE, 0); + $self->{overlay_len} = $stat_len; + } + + $self->{overlay}->set(0, 0, $self->special_encode($stat)); + $self->{overlay}->show(); + + () +} + + +sub toggle_select { + my ($self, $mode) = @_; + + if ($self->{select} eq $mode) { + $self->{select} = ''; + } else { + if (not $self->{select}) { + ($self->{ar}, $self->{ac}) = $self->screen_cur(); + } + $self->{select} = $mode; + } + + status_area($self); + $self->want_refresh(); + + () +} + + +sub calc_span { + my ($self) = @_; + my ($cr, $cc) = $self->screen_cur(); + my ($br, $bc, $er, $ec); + + if ($self->{select} eq 'b') { + $br = $self->line($cr)->beg; + $bc = $self->line($cr)->offset_of($cr, $cc); + $er = $self->line($self->{ar})->beg; + $ec = $self->line($self->{ar})->offset_of($self->{ar}, $self->{ac}); + ($br, $er) = ($er, $br) if $br > $er; + ($bc, $ec) = ($ec, $bc) if $bc > $ec; + } else { + if ($cr < $self->{ar}) { + ($br, $bc, $er, $ec) = ($cr, $cc, $self->{ar}, $self->{ac}); + } elsif ($cr > $self->{ar}) { + ($br, $bc, $er, $ec) = ($self->{ar}, $self->{ac}, $cr, $cc); + } else { + ($br, $er) = ($cr, $cr); + ($bc, $ec) = $cc < $self->{ac} ? ($cc, $self->{ac}) : ($self->{ac}, $cc); + } + } + + if ($self->{select} eq 'l') { + ($br, $er) = ($self->line($br)->beg, $self->line($er)->end); + ($bc, $ec) = (0, $self->ncol); + } else { + ++$ec; + } + + return ($br, $bc, $er, $ec); +} diff --git a/.config/urxvt/ext/url-select b/.config/urxvt/ext/url-select new file mode 100644 index 0000000..34637bb --- /dev/null +++ b/.config/urxvt/ext/url-select @@ -0,0 +1,408 @@ +#! perl -w +# Author: Bert Muennich +# Website: http://www.github.com/muennich/urxvt-perls +# Based on: http://www.jukie.net/~bart/blog/urxvt-url-yank +# License: GPLv2 + +# Use keyboard shortcuts to select URLs. +# This should be used as a replacement for the default matcher extension, +# it also makes URLs clickable with the middle mouse button. + +# Usage: put the following lines in your .Xdefaults/.Xresources: +# URxvt.perl-ext-common: ...,url-select +# URxvt.keysym.M-u: perl:url-select:select_next + +# Use Meta-u to activate URL selection mode, then use the following keys: +# j/k: Select next downward/upward URL (also with arrow keys) +# g/G: Select first/last URL (also with home/end key) +# o/Return: Open selected URL in browser, Return: deactivate afterwards +# y: Copy (yank) selected URL and deactivate selection mode +# q/Escape: Deactivate URL selection mode + +# Options: +# URxvt.url-select.autocopy: If true, selected URLs are copied to PRIMARY +# URvxt.url-select.button: Mouse button to click-open URLs (default: 2) +# URxvt.url-select.launcher: Browser/command to open selected URL with +# URxvt.url-select.underline: If set to true, all URLs get underlined + +use strict; + +# The custom rendition bit to use for marking the cell as being underlined +# by us so we can unset it again after a line has changed. +use constant UNDERLINED => 1<<3; # arbitrarily chosen in hope of no collision + +sub on_start { + my ($self) = @_; + + # read resource settings + if ($self->x_resource('url-select.launcher')) { + @{$self->{browser}} = split /\s+/, $self->x_resource('url-select.launcher'); + } else { + @{$self->{browser}} = ('x-www-browser'); + } + if ($self->x_resource('url-select.underline') eq 'true') { + $self->enable(line_update => \&line_update); + } + if ($self->x_resource('url-select.autocopy') eq 'true') { + $self->{autocopy} = 1; + } + + $self->{state} = 0; + + for my $mod (split '', $self->x_resource("url-select.button") || + $self->x_resource("matcher.button") || 2) { + if ($mod =~ /^\d+$/) { + $self->{button} = $mod; + } elsif ($mod eq "C") { + $self->{state} |= urxvt::ControlMask; + } elsif ($mod eq "S") { + $self->{state} |= urxvt::ShiftMask; + } elsif ($mod eq "M") { + $self->{state} |= $self->ModMetaMask; + } elsif ($mod ne "-" && $mod ne " ") { + warn("invalid button/modifier in $self->{_name}<$self->{argv}[0]>: $mod\n"); + } + } + + if ($self->x_resource('matcher.pattern')) { + @{$self->{pattern}} = ($self->x_resource('matcher.pattern')); + } elsif ($self->x_resource('matcher.pattern.0')) { + my $current = 0; + + while (defined (my $res = $self->x_resource("matcher.pattern.$current"))) { + $res = $self->locale_decode($res); + utf8::encode $res; + push @{$self->{pattern}}, qr($res)x; + $current++; + } + } else { + @{$self->{pattern}} = qr{ + (?:https?://|ftp://|news://|mailto:|file://|\bwww\.) + [\w\-\@;\/?:&=%\$.+!*\x27,~#]* + ( + \([\w\-\@;\/?:&=%\$.+!*\x27,~#]*\) # Allow a pair of matched parentheses + | # + [\w\-\@;\/?:&=%\$+*~] # exclude some trailing characters (heuristic) + )+ + }x; + } + + () +} + + +sub line_update { + my ($self, $row) = @_; + + my $line = $self->line($row); + my $text = $line->t; + my $rend = $line->r; + + # clear all underlines that were set by us + for (@$rend) { + if (urxvt::GET_CUSTOM($_) & UNDERLINED) { + $_ = urxvt::SET_CUSTOM($_, urxvt::GET_CUSTOM($_) & ~UNDERLINED) & + ~urxvt::RS_Uline; + } + } + + for my $pattern (@{$self->{pattern}}) { + while ($text =~ /$pattern/g) { + my $url = $&; + my ($beg, $end) = ($-[0], $+[0] - 1); + + for (@{$rend}[$beg .. $end]) { + unless ($_ & urxvt::RS_Uline) { + $_ = urxvt::SET_CUSTOM($_, urxvt::GET_CUSTOM($_) | UNDERLINED); + $_ |= urxvt::RS_Uline; + } + } + } + } + + $line->r($rend); + + () +} + +sub on_action { + my ($self, $action) = @_; + + on_user_command($self, "url-select:" . $action); +} + + +sub on_user_command { + my ($self, $cmd) = @_; + + if ($cmd eq 'url-select:select_next') { + if (not $self->{active}) { + activate($self); + } + select_next($self, -1); + } + + () +} + + +sub key_press { + my ($self, $event, $keysym) = @_; + my $char = chr($keysym); + + if ($keysym == 0xff1b || lc($char) eq 'q' || + (lc($char) eq 'c' && $event->{state} & urxvt::ControlMask)) { + deactivate($self); + } elsif ($keysym == 0xff0d || $char eq 'o' || + (lc($char) eq 'm' && $event->{state} & urxvt::ControlMask)) { + $self->exec_async(@{$self->{browser}}, ${$self->{found}[$self->{n}]}[4]); + deactivate($self) unless $char eq 'o'; + } elsif ($char eq 'y') { + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + deactivate($self); + } elsif ($char eq 'k' || $keysym == 0xff52 || $keysym == 0xff51) { + select_next($self, -1, $event); + } elsif ($char eq 'j' || $keysym == 0xff54 || $keysym == 0xff53) { + select_next($self, 1, $event); + } elsif ($char eq 'g' || $keysym == 0xff50) { + $self->{row} = $self->top_row - 1; + delete $self->{found}; + select_next($self, 1, $event); + } elsif ($char eq 'G' || $keysym == 0xff57) { + $self->{row} = $self->nrow; + delete $self->{found}; + select_next($self, -1, $event); + } + + return 1; +} + + +sub on_button_press { + my ($self, $event) = @_; + + my $mask = $self->ModLevel3Mask | $self->ModMetaMask | + urxvt::ShiftMask | urxvt::ControlMask; + + if ($event->{button} == $self->{button} && ($event->{state} & $mask) == $self->{state}) { + my $col = $event->{col}; + my $row = $event->{row}; + my $line = $self->line($row); + my $text = $line->t; + + for my $pattern (@{$self->{pattern}}) { + while ($text =~ /$pattern/g) { + my ($url, $beg, $end) = ($&, $-[0], $+[0]); + --$end if $url =~ s/["')]$//; + + if ($col >= $beg && $col <= $end) { + $self->{button_pressed} = 1; + $self->{button_col} = $col; + $self->{button_row} = $row; + $self->{button_url} = $url; + return 1; + } + } + } + } + + () +} + +sub on_button_release { + my ($self, $event) = @_; + + if ($self->{button_pressed} && $event->{button} == $self->{button}) { + my $col = $event->{col}; + my $row = $event->{row}; + + $self->{button_pressed} = 0; + + if ($col == $self->{button_col} && $row == $self->{button_row}) { + $self->exec_async(@{$self->{browser}}, $self->{button_url}); + return 1; + } + } + + () +} + + +sub select_next { + # $dir < 0: up, > 0: down + my ($self, $dir, $event) = @_; + my $row = $self->{row}; + + if (($dir < 0 && $self->{n} > 0) || + ($dir > 0 && $self->{n} < $#{ $self->{found} })) { + # another url on current line + $self->{n} += $dir; + hilight($self); + if ($self->{autocopy}) { + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + } + return; + } + + while (($dir < 0 && $row > $self->top_row) || + ($dir > 0 && $row < $self->nrow - 1)) { + my $line = $self->line($row); + $row = ($dir < 0 ? $line->beg : $line->end) + $dir; + $line = $self->line($row); + my $text = $line->t; + + for my $pattern (@{$self->{pattern}}) { + if ($text =~ /$pattern/g) { + delete $self->{found}; + + do { + my ($beg, $end) = ($-[0], $+[0]); + push @{$self->{found}}, [$line->coord_of($beg), + $line->coord_of($end), substr($text, $beg, $end - $beg)]; + } while ($text =~ /$pattern/g); + + $self->{row} = $row; + $self->{n} = $dir < 0 ? $#{$self->{found}} : 0; + hilight($self); + if ($self->{autocopy}) { + my $found = $self->{found}[$self->{n}]; + $self->selection_beg(${$found}[0], ${$found}[1]); + $self->selection_end(${$found}[2], ${$found}[3]); + $self->selection_make($event->{time}); + $self->selection_beg(1, 0); + $self->selection_end(1, 0); + } + return; + } + } + } + + deactivate($self) unless $self->{found}; + + () +} + + +sub hilight { + my ($self) = @_; + + if ($self->{found}) { + if ($self->{row} < $self->view_start() || + $self->{row} >= $self->view_start() + $self->nrow) { + # scroll selected url into visible area + my $top = $self->{row} - ($self->nrow >> 1); + $self->view_start($top < 0 ? $top : 0); + } + + status_area($self); + $self->want_refresh(); + } + + () +} + + +sub refresh { + my ($self) = @_; + + if ($self->{found}) { + if ($self->x_resource('highlightColor')) { + $self->scr_xor_span(@{$self->{found}[$self->{n}]}[0 .. 3], urxvt::RS_Sel); + } else { + $self->scr_xor_span(@{$self->{found}[$self->{n}]}[0 .. 3], urxvt::RS_RVid); + } + } + + () +} + + +sub status_area { + my ($self) = @_; + + my $row = $self->{row} < 0 ? + $self->{row} - $self->top_row : abs($self->top_row) + $self->{row}; + my $text = sprintf("%d,%d ", $row + 1, $self->{n} + 1); + + if ($self->top_row == 0) { + $text .= "All"; + } elsif ($self->view_start() == $self->top_row) { + $text .= "Top"; + } elsif ($self->view_start() == 0) { + $text .= "Bot"; + } else { + $text .= sprintf("%2d%", + ($self->top_row - $self->view_start) * 100 / $self->top_row); + } + + my $text_len = length($text); + + if ($self->{overlay_len} != $text_len) { + delete $self->{overlay} if $self->{overlay}; + $self->{overlay} = $self->overlay(-1, -1, $text_len, 1, + urxvt::OVERLAY_RSTYLE, 0); + $self->{overlay_len} = $text_len; + } + + $self->{overlay}->set(0, 0, $self->special_encode($text)); + $self->{overlay}->show(); + + () +} + + +sub tt_write { + return 1; +} + + +sub activate { + my ($self) = @_; + + $self->{active} = 1; + + $self->{row} = $self->view_start() + $self->nrow; + $self->{n} = 0; + $self->{overlay_len} = 0; + $self->{button_pressed} = 0; + + $self->{view_start} = $self->view_start(); + $self->{pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE); + + $self->enable( + key_press => \&key_press, + refresh_begin => \&refresh, + refresh_end => \&refresh, + tt_write => \&tt_write, + ); + + () +} + + +sub deactivate { + my ($self) = @_; + + $self->disable("key_press", "refresh_begin", "refresh_end", "tt_write"); + $self->view_start($self->{view_start}); + $self->pty_ev_events($self->{pty_ev_events}); + + delete $self->{overlay} if $self->{overlay}; + delete $self->{found} if $self->{found}; + + $self->want_refresh(); + + $self->{active} = 0; + + () +} diff --git a/.config/vale/vale.ini b/.config/vale/vale.ini index 2eb8def..3f52cff 100644 --- a/.config/vale/vale.ini +++ b/.config/vale/vale.ini @@ -1,9 +1,12 @@ -StylesPath = /home/thedro/.config/vale/styles MinAlertLevel = suggestion +StylesPath = /home/thedro/.config/vale/styles [*.{md,txt}] #BasedOnStyles = google +#BasedOnStyles = hemingway #BasedOnStyles = joblint #BasedOnStyles = microsoft #BasedOnStyles = proselint -BasedOnStyles = write-good +BasedOnStyles = thedro +BasedOnStyles = technical +BasedOnStyles = write-good diff --git a/.config/xbindkeysrc b/.config/xbindkeysrc deleted file mode 100644 index ae7f564..0000000 --- a/.config/xbindkeysrc +++ /dev/null @@ -1,103 +0,0 @@ -########################### -# xbindkeys configuration # -########################### - -# App Launcher -"$HOME/.local/bin/scripts/app-launcher" - Mod4 + r - -# Priv App Launcher -"$HOME/.local/bin/scripts/app-launcher-priv" - Mod4 + e - -# Terminal App Launcher -"$HOME/.local/bin/scripts/app-launcher-terminal" - Mod4 + w - -# Zoom Application -"sh -c 'notify-send Zoom && boomer'" - Mod4 + x - -# Close active window -"wmctrl -c :ACTIVE:" - Mod4 + Shift + c - -# Toggle fullscreen active window -"wmctrl -r :ACTIVE: -b toggle,fullscreen" - Mod4 + f - -# Toggle ontop active window -"wmctrl -r :ACTIVE: -b toggle,above" - Mod4 + t - -# Copyq Toggle -"$HOME/.local/bin/scripts/clipboard" - Mod4 + z - -# Text plumber -"$HOME/.local/bin/plumber-dmenu" - Mod4 + i - -# File Search -"$HOME/.local/bin/scripts/file-search" - Mod4 + p - -# Window Switcher -"$HOME/.local/bin/scripts/window-switcher" - Alt + Tab - -# Window Overview -"$HOME/.local/bin/scripts/window-overview" - Mod4 + Tab - -# File Search -"$HOME/.local/bin/scripts/internet-search" - Mod4 + a - -# Volume Up -"$HOME/.local/bin/scripts/volume-up" - XF86AudioRaiseVolume - -# Volume Down -"$HOME/.local/bin/scripts/volume-down" - XF86AudioLowerVolume - -# Volume Mute -"$HOME/.local/bin/scripts/volume-mute" - XF86AudioMute - -# Lock Screen -"$HOME/.local/bin/scripts/lockscreen" - XF86ScreenSaver - -# Snipping Tool -"$HOME/.local/bin/scripts/snipping-tool" - Print - -# Switch Monitor -"$HOME/.local/bin/scripts/switch-monitor" - XF86Display - -# Screen Record -"peek" - Alt + Print - -# Flameshot Screenshots -"flameshot gui" - Control + Print - -# Shortcut Key Check -"urxvt -hold -e xbindkeys --multikey -f $HOME/.config/xbindkeysrc" - Shift + Mod4 + b - -# Terminal -"urxvt" - Mod4 + Return - -# Terminal Tabbed -"urxvt -pe tabbed" - Alt + Mod4 + Return - -# Terminal Multiplexer -"urxvt -e tmux attach" - Control + Mod4 + Return diff --git a/.festivalrc b/.festivalrc deleted file mode 100644 index 51fc727..0000000 --- a/.festivalrc +++ /dev/null @@ -1,6 +0,0 @@ -;; Linux: can't open /dev/dsp error fix -(Parameter.set 'Audio_Method 'Audio_Command) -(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE") - -;; set default voice -(set! voice_default voice_nitech_us_rms_arctic_hts) diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..da0e6ab --- /dev/null +++ b/.gitmodules @@ -0,0 +1,15 @@ +[submodule ".vim/pack/plugins/start/fzf.vim"] + path = .vim/pack/plugins/start/fzf.vim + url = https://github.com/junegunn/fzf.vim +[submodule ".vim/pack/plugins/start/gundo.vim"] + path = .vim/pack/plugins/start/gundo.vim + url = https://github.com/sjl/gundo.vim +[submodule ".vim/pack/plugins/start/nnn.vim"] + path = .vim/pack/plugins/start/nnn.vim + url = https://github.com/mcchrish/nnn.vim +[submodule ".vim/pack/plugins/start/vim-elixir"] + path = .vim/pack/plugins/start/vim-elixir + url = https://github.com/elixir-editors/vim-elixir +[submodule ".vim/pack/plugins/start/vim-HiLinkTrace"] + path = .vim/pack/plugins/start/vim-HiLinkTrace + url = https://github.com/gerw/vim-HiLinkTrace diff --git a/.local/bin/, b/.local/bin/, index c9e6545..2fb22e8 100755 --- a/.local/bin/, +++ b/.local/bin/, @@ -4,9 +4,8 @@ program=$(basename "$0") requires="$(command -V nix-index nix-locate nix-shell fzf | awk '{ print $1, $3 }' | column -t)" -[ "${1:-}" = "--check" ] && printf '%s\n' "$requires" && exit; - -{ [ "${1:-}" = "--help" ] || [ "$#" = 0 ]; } && printf \ +help() { +printf \ " Usage: %s [FLAGS]... [ARGUMENT]... @@ -15,19 +14,90 @@ packages for a file and set up a nix shell for the program that contains that file. The shell prints all binaries in the package upon invocation. +Create and update the file database by running +the nix-index command. Warning: This command uses +up a large amount of memory. + +nix-index --nixpkgs https://github.com/NixOS/nixpkgs/archive/master.tar.gz + Command List: $program [ARGUMENT]... Search for packages using file name argument. $program --help Show this help menu. $program --check Check dependencies. -" "$program" && exit; +" "$program" +} + +[ "${1:-}" = "--check" ] && printf '%s\n' "$requires" && exit + +{ [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ] || [ "$#" = 0 ]; } && help && exit + +databasePath=${XDG_DATA_HOME:-~/.cache}/nix-index +nixLocate='nix-locate --db '"$databasePath"' --no-group --regex -- '"${1:-}" +attributes=$($nixLocate | awk '{ print $1, $4 }' | sed 's|/nix/store/.[^-]*-||g') + +[ -z "$attributes" ] && printf "No files found containing '%s'\n" "${1:-}" && exit + +option=$(printf '%s' "$attributes" | column --table | fzf) +attribute=${option%% *} +file=${option#*/} + +[ -z "$attribute" ] && exit + +printf '\nsetting up shell with %s path...\n' "$attribute" +printf '\n$OUT/%s\n' "$file" -databasePath=${XDG_DATA_HOME:-~/.local/share}/nix-index -nixLocate='nix-locate --db '"$databasePath"' --top-level --minimal --whole-name '"${1:-}" -attributes=$($nixLocate | while read -r attribute; do - attributeName=${attribute%.*}; - printf '%s\n' "$attributeName"; -done) +nix-shell --option substituters 'https://cache.nixos.org' --packages "$attribute" fish bat toybox --command \ +' + home=$TMPDIR/nix-shell-tmp-home.r2np9PHrby + program=$(printf "%s" "$buildInputs" | cut --delimiter=" " --fields=1) + path=$(IFS=" " && for buildInput in $buildInputs; do printf "%s/bin " "$buildInput"; done | sed "s/ /:/g") + printf "\n"; + { [ -d "$program/bin" ] && ls "$program/bin"; } || printf "%s\n" "$program"; + printf "\n"; + tree -L 1 "$program"; + printf "\n"; -attribute=$(printf '%s' "$attributes" | fzf) -nix-shell --packages "$attribute" --command 'printf "$buildInputs\n"; ls $buildInputs/bin; return'; + /usr/bin/env --ignore-environment /bin/sh -c \ + " + export PATH=$path + export DISPLAY=$DISPLAY + export XAUTHORITY=$XAUTHORITY + export TERM=$TERM + export TERMINFO=$TERMINFO + export TERMINFO_DIRS=$TERMINFO_DIRS + export HOME=$home + export OUT=$program + export fish_greeting= + mkdir --parents $home + cd || exit 1 + fish --init-command=\" + function fish_prompt; printf '"'nix-shell@$attribute $ '"'; end + set -U fish_color_normal B3B1AD + set -U fish_color_command 39BAE6 + set -U fish_color_quote C2D94C + set -U fish_color_redirection FFEE99 + set -U fish_color_end F29668 + set -U fish_color_error FF3333 + set -U fish_color_param 39BAE6 + set -U fish_color_comment 626A73 + set -U fish_color_match F07178 + set -U fish_color_selection E6B450 + set -U fish_color_search_match E6B450 + set -U fish_color_history_current --bold + set -U fish_color_operator E6B450 + set -U fish_color_escape 95E6CB + set -U fish_color_cwd 59C2FF + set -U fish_color_cwd_root red + set -U fish_color_valid_path --underline + set -U fish_color_autosuggestion aaaaaa + set -U fish_color_user brgreen + set -U fish_color_host normal + set -U fish_color_cancel -r + set -U fish_pager_color_completion normal + set -U fish_pager_color_description B3A06D yellow + set -U fish_pager_color_prefix white --bold --underline + set -U fish_pager_color_progress brwhite --background=cyan + \" + " +'; diff --git a/.local/bin/audiorecord b/.local/bin/audiorecord new file mode 100755 index 0000000..17f7e46 --- /dev/null +++ b/.local/bin/audiorecord @@ -0,0 +1,5 @@ +#!/bin/sh -eu +directory=$HOME/Desktop/audio-recordings +file="$(date +%I:%M:%S-%p-%A-%d-%B-%Y).mp3" +mkdir --parents "$directory" +ffmpeg -f alsa -i default -f alsa -i default "$directory/$file" diff --git a/.local/bin/bashhistory b/.local/bin/bashhistory new file mode 100755 index 0000000..98f1d33 --- /dev/null +++ b/.local/bin/bashhistory @@ -0,0 +1,37 @@ +#!/bin/sh -eu + +directory="$XDG_DATA_HOME/bash" +persist="$directory/history" +default="$HOME/.bash_history" +current="$HISTFILE" +lockfile='/tmp/bashhistory_Ri5ki9ei.lock' + +_prune() { + sed --in-place '/^#/d;/^ /d;/^\t/d;/.........../!d' "$1" && # Remove all timestamps, lines beginning with tabs/spaces, and commands less than 11 characters + sort --unique "$1" > "$1.tmp" && # Remove all duplicate entries. + mv --force "$1.tmp" "$1" > /dev/null 2>&1 +} + +_migrate() { + [ -f "$default" ] && + cat "$default" >>"$persist" && + _prune "$persist" && + rm "$default" +} + +_store() { + cat "$current" >> "$persist" && + cat "$current" >> "$persist.bak" && + _prune "$persist" && + true > "$current" +} + +[ -f "$lockfile" ] && exit; + +mkdir --parents "$directory" +touch "$current" "$lockfile" + +trap 'rm "$lockfile" > /dev/null 2>&1; trap - EXIT; exit' EXIT INT HUP + +_migrate || true +_store diff --git a/.local/bin/bookmarks b/.local/bin/bookmarks new file mode 100755 index 0000000..58ad8f5 --- /dev/null +++ b/.local/bin/bookmarks @@ -0,0 +1,69 @@ +#!/bin/sh -eu + +date=$(date +%s) +program=$(basename "$0") +key="QdUEdQBncNzJgIJqTA30" +hxnormalize="hxnormalize -l 99999999 -x" +items=/tmp/bookmarks_items_$key +titles=/tmp/bookmarks_titles_$key +anchors=/tmp/bookmarks_anchors_$key +dependencies="$(command -V xmlstarlet hxnormalize paste \ + hxselect hxincl xdg-open rofi basename \ + | awk '{ print $1, $3 }' | column -t)" +base=\ +"<!DOCTYPE NETSCAPE-Bookmark-file-1> +<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"> +<title>Bookmarks</title> +<h1>Bookmarks</h1> +<dl> +<!-- include $items --></dl> +" + +bookmarks_help() { +{ [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ] || [ "$#" = 0 ]; } && printf \ +" +Usage: %s [FLAGS]... [ARGUMENTS]... + +The program $program shall execute basic operations +on Netscape Bookmark HTML files. + + Command List: + + $program compile [FILES]... Combine two or more bookmark.html files. + $program show [FILE] Show list of bookmarks. + $program check Check dependencies. + $program -h --help Show this help menu. +" "$program" && exit; +printf "Error: Unknown argument '%s'.\n" "$@" && exit 1; +} + +bookmarks_combine () { + for file in "$@" + do $hxnormalize "$file" | sed 's/&/&/g' \ + | xmlstarlet edit -S \ + --delete '//a/@add_date' \ + --delete '//a/@icon' \ + --delete '//a/@icon_uri' \ + --delete '//a/@last_charset' \ + --delete '//a/@last_modified' \ + --delete '//a/@last_modified' \ + --delete '//a/@tags' \ + | $hxnormalize | hxselect -i -s '\n' dt; + done | sort | awk '!removeDuplicates[$0]++' >> "$items"; + printf "%s" "$base" | hxincl -f -x > "bookmarks-$date.html"; + realpath "bookmarks-$date.html"; +} + +bookmarks_show () { + $hxnormalize "${1:-}" | hxselect -c -i -s '\n' 'a::attr(href)' > "$anchors" + $hxnormalize "${1:-}" | hxselect -c -i -s '\n' 'a' > "$titles" + xdg-open "$(paste -d' ' "$anchors" "$titles" \ + | rofi -font "sans 12" -matching regex -padding 20 -dmenu -i -p 'Bookmarks' \ + | awk '{ print $1 }')"; +} + +[ "${1:-}" = "show" ] && shift 1 && bookmarks_show "$@" && exit; +[ "${1:-}" = "combine" ] && shift 1 && bookmarks_combine "$@" && exit; +[ "${1:-}" = "check" ] && shift 1 && printf '%s\n' "$dependencies" && exit; + +bookmarks_help "$@"; diff --git a/.local/bin/broken-links b/.local/bin/broken-links index 843f0ff..02db6a0 100755 --- a/.local/bin/broken-links +++ b/.local/bin/broken-links @@ -1,3 +1,33 @@ #!/bin/sh -eu -wget --spider --recursive --level 3 --no-verbose \ - --no-directories --delete-after "$1" 2>&1 | grep -v -E 'URL:|unlink:' + +lynx \ + -nocolor \ + -dump \ + -listonly \ + "${1:-https://example.com}" | + grep \ + --color="never" \ + "\." | + while read -r line; do + url=${line#*. } + head=$(wget \ + --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36" \ + --timeout=1 \ + --wait=1 \ + --waitretry=1 \ + --random-wait \ + --no-cache \ + --no-dns-cache \ + --method=HEAD "$url" 2>&1 | + grep --color="never" -E 'HTTP') + response=$(printf '%s' "${head#*... }" | head --lines=1) + printf '%s %s\n' "$url" "$response" + printf '%s %s\n' "$url" "$response" >&2 + done | + awk '{ print $1, $2, $3}' | + column \ + --output-width 80 \ + --table \ + --table-columns URL,STATUS,MESSAGE \ + --table-truncate URL | + sort --reverse --key=2 diff --git a/.local/bin/browser b/.local/bin/browser new file mode 100755 index 0000000..dd9818c --- /dev/null +++ b/.local/bin/browser @@ -0,0 +1,2 @@ +#!/bin/sh -eu +BROWSER=chromium; $BROWSER "$@" diff --git a/.local/bin/browser-refresh b/.local/bin/browser-refresh index c1410c4..a882f9d 100755 --- a/.local/bin/browser-refresh +++ b/.local/bin/browser-refresh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -# set keyboard -keyboard=10 - # set target browser and title browser=$1 title=$2 @@ -37,9 +34,6 @@ xdotool windowactivate $target_window; # declare the variable i as an interger declare -i i=0; -# disable keyboard at the start of search -xinput --disable $keyboard; - while true; do # bail out if there are too many searches @@ -96,7 +90,4 @@ while true; do done -# enable keyboard at the end of the search -xinput --enable $keyboard; - exit 0; diff --git a/.local/bin/camera-gstream b/.local/bin/camera-gstream new file mode 100755 index 0000000..3b54380 --- /dev/null +++ b/.local/bin/camera-gstream @@ -0,0 +1,2 @@ +#!/bin/sh -eu +gst-launch-1.0 -v v4l2src device=/dev/video0 ! glimagesink diff --git a/.local/bin/camera-mplayer b/.local/bin/camera-mplayer new file mode 100755 index 0000000..73f592f --- /dev/null +++ b/.local/bin/camera-mplayer @@ -0,0 +1,28 @@ +#!/bin/sh -eu + +program=$(basename "$0") +option=${1:-0@9} +real=${option%%@*} +virtual=${option#*@} + +{ + [ "$option" = "help" ] || + [ "$option" = "-help" ] || + [ "$option" = "--help" ] +} && + printf '%s 0@9\n# /dev/video0 -> /dev/video9\n' "$program" && + exit + +{ + [ "$option" = "kill" ] || + [ "$option" = "-kill" ] || + [ "$option" = "--kill" ] +} && + killall mplayer && + killall mplayer && + killall ffmpeg && + exit + +ffmpeg -i "/dev/video$real" -f v4l2 -vcodec rawvideo -pix_fmt rgb24 "/dev/video$virtual" & +sleep 2 +mplayer tv:// -tv "driver=v4l2:device=/dev/video$virtual" -fps 15 diff --git a/.local/bin/clipboard b/.local/bin/clipboard new file mode 100755 index 0000000..298d1e3 --- /dev/null +++ b/.local/bin/clipboard @@ -0,0 +1,4 @@ +#!/bin/sh -eu + +pgrep --full "scratchpad.md" && pkill --oldest --full "scratchpad.md" && exit +$TERMINAL -e vim ~/Documents/notes/scratchpad.md diff --git a/.local/bin/dmenu_run_history b/.local/bin/dmenu_run_history index c6a7372..ba9b2af 100755 --- a/.local/bin/dmenu_run_history +++ b/.local/bin/dmenu_run_history @@ -1,27 +1,31 @@ #!/bin/sh -[ "$1" = "privilege" ] && export cmd_prefix='sudo -A ' && export dmenu_args='-p Privilege -sb red' && shift 1; -[ "$1" = "terminal" ] && export cmd_prefix='urxvt -hold -e ' && export dmenu_args='-p Terminal -sb gray' && shift 1; - # https://tools.suckless.org/dmenu/scripts/ +[ "$1" = "privilege" ] && + export cmd_prefix='rofi-askpass ' && + export dmenu_args='-nhf #ff7070 -sf #ff7070 -p ⠀:::⠀privilege⠀:::' && + shift 1 + +[ "$1" = "terminal" ] && + export cmd_prefix='urxvt -hold -e ' && + export dmenu_args='-nhf #9e9e9e -sf #9e9e9e -p ⠀:::⠀terminal⠀:::' && + shift 1 + cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} -if [ -d "$cachedir" ]; then - cache=$cachedir/dmenu_run - historyfile=$XDG_DATA_HOME/dmenu_history -else - cache=$HOME/.dmenu_cache - historyfile=$HOME/.dmenu_history -fi - -if [ "$1" = "update" ] || [ ! -f "$cache" ]; then - IFS=: - stest -dqr -n "$cache" $PATH && stest -flx $PATH | sort -u > "$cache"; - unset IFS; - exit; -fi - -awk -v histfile=$historyfile ' +cache=$cachedir/dmenu_run +historyfile=$XDG_DATA_HOME/dmenu_history +mkdir --parents "$cachedir" + +update() { + IFS=: + stest -flx $PATH | sort -u >"$cache" + unset IFS +} + +[ ! -f "$cache" ] && update + +awk -v histfile="$historyfile" ' BEGIN { while( (getline < histfile) > 0 ) { sub("^[0-9]+\t","") @@ -29,8 +33,8 @@ awk -v histfile=$historyfile ' x[$0]=1 } } !x[$0]++ ' "$cache" \ - | dmenu -b ${dmenu_args:--p Launch} "$@" \ - | awk -v histfile=$historyfile ' + | dmenu -i -b ${dmenu_args:--p ⠀:::⠀execute⠀:::} "$@" \ + | awk -v histfile="$historyfile" ' BEGIN { FS=OFS="\t" while ( (getline < histfile) > 0 ) { @@ -52,5 +56,6 @@ awk -v histfile=$historyfile ' for (f in history) print history[f],f | "sort -t '\t' -k1rn >" histfile } - ' \ - | while read -r cmd; do ${SHELL:-"/bin/sh"} -c "$cmd_prefix $cmd" & done + ' | while read -r cmd; do ${SHELL:-"/bin/sh"} -c "$cmd_prefix $cmd" & done + +update diff --git a/.local/bin/dropdown-terminal b/.local/bin/dropdown-terminal new file mode 100755 index 0000000..46f83ea --- /dev/null +++ b/.local/bin/dropdown-terminal @@ -0,0 +1,22 @@ +#!/bin/sh -eu +name=dropdown-terminal +state=/tmp/"$name"_lQ5GnvRpQ6 +terminal="urxvt -pe tabbed -geometry 150x20 -title $name" + +[ ! -f $state ] && { + $terminal && sed --in-place '1s/.*/1/' "$state" & + touch $state && exit; +} + +options=$(grep --count . $state || true) +[ "$options" != "1" ] && { printf '1\n' > $state; } + +pid=$(pgrep --full "title $name" | head --lines 1) +[ -z "$pid" ] && rm $state && "$0" && exit; + +window=$(wmctrl -lpGx | awk "/$pid/"'{ print $1 }') +[ -z "$window" ] && rm "$state" && "$0" && exit; + +visible=$(awk 'NR==1 { print; exit }' $state) +[ "$visible" = 0 ] && wmctrl -i -u -R "$window" && wmctrl -i -u -r "$window" -b add,above && sed --in-place '1s/.*/1/' "$state" && exit; +[ "$visible" = 1 ] && xdotool mousemove_relative 0 1 && wmctrl -i -u -r "$window" -b add,skip_taskbar,hidden && sed --in-place '1s/.*/0/' "$state" && exit; diff --git a/.local/bin/events-idle b/.local/bin/events-idle new file mode 100755 index 0000000..ff489eb --- /dev/null +++ b/.local/bin/events-idle @@ -0,0 +1,3 @@ +#!/bin/sh -eux + +file-search update diff --git a/.local/bin/scripts/events-resume b/.local/bin/events-resume index 50ffd2c..50ffd2c 100755 --- a/.local/bin/scripts/events-resume +++ b/.local/bin/events-resume diff --git a/.local/bin/events-usb b/.local/bin/events-usb new file mode 100755 index 0000000..32d5823 --- /dev/null +++ b/.local/bin/events-usb @@ -0,0 +1,6 @@ +#!/bin/sh -eux + +xmodmap "$HOME/.config/X11/Xmodmap" +xset r rate 200 60 +[ "$(xset -q | awk '/Caps Lock/ { print $4 }')" = "on" ] \ + && xdotool key Caps_Lock diff --git a/.local/bin/scripts/file-search b/.local/bin/file-search index 130b90c..130b90c 100755 --- a/.local/bin/scripts/file-search +++ b/.local/bin/file-search diff --git a/.local/bin/fzf-doc b/.local/bin/fzf-doc deleted file mode 100755 index 6f51c08..0000000 --- a/.local/bin/fzf-doc +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -eu - -cache=$HOME/.cache/fzf-doc -documentation=/etc/documentation - -fzf_doc_preview() { - file=$1 - extension=${file##*.} - case "$extension" in - md) mdcat -l "$file" ;; - html) w3m -dump "$file" ;; - pdf) pdftotext "$file" - ;; - *) grep -hi -B 10 -A 10 . "${file}" ;; - esac -} - -if [ ! -f "$cache" ] || test "$cache" -ot "$documentation"; then - grep -lRi \ - --include=*.md \ - --include=*.txt \ - --include=*.pdf \ - --include=*.html \ - --include=*.yml \ - --include=*.yaml \ - . /etc/documentation > "$cache"; -fi - -[ "${1-}" = "--preview" ] && fzf_doc_preview "${2-}" && exit; - -grep -i "${1-.}" "$cache" \ - | fzf --preview "fzf-doc --preview {}" \ - | while read -r file - -do - extension=${file##*.} - case "$extension" in - md) mdcat -cl "$file" | vim - ;; - html) w3m -dump "$file" | vim - ;; - pdf) pdftotext "$file" - | vim - ;; - yml) vim "$file" ;; - yaml) vim "$file" ;; - *) vim "$file" ;; - esac -done diff --git a/.local/bin/fzf-file b/.local/bin/fzf-file index c09e155..a4427f4 100755 --- a/.local/bin/fzf-file +++ b/.local/bin/fzf-file @@ -1,2 +1,3 @@ #!/bin/sh -eu +[ ! -f "$FZF_FILE_MARKS" ] && mkdir -p "$(dirname "$FZF_FILE_MARKS")" && touch "$FZF_FILE_MARKS" fzf < "$FZF_FILE_MARKS" | xargs -o -I{} sh -c "vim {}"; diff --git a/.local/bin/fzf-file-mark b/.local/bin/fzf-file-mark index 94c2bf8..9f6efad 100755 --- a/.local/bin/fzf-file-mark +++ b/.local/bin/fzf-file-mark @@ -1,11 +1,9 @@ -#!/bin/sh +#!/bin/sh -eu + file=$FZF_FILE_MARKS -temp=/tmp/.fzf-fmarks.tmp +temp=/tmp/fzf-fmarks-Ei0Ohcah.tmp realpath "$1" && realpath "$1" >> "$file"; sed -i "s|$HOME|~|g" "$file"; -awk '!visited[$0]++' "$file" > "$temp" \ - && sort "$temp" > "$file"; - -rm -f "$temp"; +awk '!visited[$0]++' "$file" > "$temp" && sort "$temp" > "$file"; diff --git a/.local/bin/gtk-debug b/.local/bin/gtk-debug new file mode 100755 index 0000000..0005bcd --- /dev/null +++ b/.local/bin/gtk-debug @@ -0,0 +1,8 @@ +#!/bin/sh -eu +program=$(basename "$0") + +{ [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ] || [ "$#" = 0 ]; } && + printf "Usage: %s [COMMAND]...\n" "$program" && + exit + +GTK_DEBUG=interactive $1 diff --git a/.local/bin/hexmime b/.local/bin/hexmime new file mode 100755 index 0000000..ac808fa --- /dev/null +++ b/.local/bin/hexmime @@ -0,0 +1,2 @@ +#!/bin/sh -eu +mimeo --mimetype "$1" && hexyl --length 196 "$1" && cat diff --git a/.local/bin/internet-search b/.local/bin/internet-search new file mode 100755 index 0000000..0a3d0cd --- /dev/null +++ b/.local/bin/internet-search @@ -0,0 +1,2 @@ +#!/bin/sh -eu +rofi -dmenu -i -font "ubuntu 16" -theme-str 'listview { lines: 0; }' -p " " | xargs -r surfraw duckduckgo diff --git a/.local/bin/latex-compile b/.local/bin/latex-compile index 9717db0..25f92b6 100755 --- a/.local/bin/latex-compile +++ b/.local/bin/latex-compile @@ -1,8 +1,8 @@ #!/bin/sh -eu if ! { - pdflatex -halt-on-error "$1" \ - || xelatex -halt-on-error "$1"; - } -then cat + pdflatex -shell-escape -halt-on-error "$1" || + xelatex -shell-escape -halt-on-error "$1" +}; then + cat fi diff --git a/.local/bin/scripts/lockscreen b/.local/bin/lockscreen index bd456c2..bd456c2 100755 --- a/.local/bin/scripts/lockscreen +++ b/.local/bin/lockscreen diff --git a/.local/bin/lxc-build b/.local/bin/lxc-build new file mode 100755 index 0000000..9e6b5eb --- /dev/null +++ b/.local/bin/lxc-build @@ -0,0 +1,83 @@ +#!/usr/bin/env runhaskell + +import System.Console.GetOpt +import System.Environment +import System.Exit +import System.Process + +version :: Fractional p => p +version = 0.01 + +help :: [Char] +help = unlines + [ "" + , "NAME" + , "" + , " lxc-build" + , "" + , "SYNOPSIS" + , "" + , " Replace a container of the same name with the new build" + , "" + , " lxc-build --replace --name rockylinux rockylinux8.dockerfile" + , "" + , "DESCRIPTION" + , "" + , " Builds a lxc container from a Dockerfile" + , "" + , "COMMANDS" + , "" + , " -h, -help, --help Shows this help menu" + , " -r, -replace, --replace Replace container with new build" + , " -v, -version, --version Prints program version" + ] + +display = putStrLn + +main = do + arguments <- getArgs + case arguments of + ["--replace", "--name", name, dockerfile] -> do + callCommand ("\\lxc-destroy --force --name " ++ name ++ " |& \\true") + callCommand + ( "\\lxc-create --name " + ++ name + ++ " --template=none && \\mkdir ~/.local/share/lxc/" + ++ name + ++ "/rootfs" + ) + callCommand ("\\docker build --file " ++ dockerfile) + callCommand + ( "id=$(\\docker run --detach \"$(\\docker build --file " + ++ dockerfile + ++ " | tail --lines=1)\" /bin/true) && \\docker export \"$id\" | \\tar --extract --directory ~/.local/share/lxc/" + ++ name + ++ "/rootfs && \\docker container rm \"$id\"" + ) + callCommand + ( "\\printf 'doas chown --recursive 200000:200000 ~/.local/share/lxc/" + ++ name + ++ "/rootfs\n'" + ) + callCommand + ( "\\doas chown --recursive 200000:200000 ~/.local/share/lxc/" + ++ name + ++ "/rootfs" + ) + callCommand + ( "\\printf 'lxc.uts.name = " + ++ name + ++ "\n' >> ~/.local/share/lxc/" + ++ name + ++ "/config" + ) + callCommand + ( "\\printf \"lxc.rootfs.path = dir:$HOME/.local/share/lxc/" + ++ name + ++ "/rootfs\n\" >> ~/.local/share/lxc/" + ++ name + ++ "/config" + ) + callCommand ("\\lxc-start --name " ++ name) + _ -> do + die help diff --git a/.local/bin/manpdf b/.local/bin/manpdf index 349f9b4..6fefd44 100755 --- a/.local/bin/manpdf +++ b/.local/bin/manpdf @@ -1,2 +1,7 @@ -#!/bin/sh -man -k . | dmenu -b | awk '{ print $1 }' | xargs -r man -Tpdf | zathura - +#!/bin/sh -eu + +man -k . | + rofi -font "ubuntu 12" -matching regex -padding 20 -dmenu -i -p 'Manuals' | + awk '{ print $1 }' | + xargs -r man -Tpdf | + zathura - diff --git a/.local/bin/mplayer-wrapper b/.local/bin/mplayer-wrapper deleted file mode 100755 index 359a4f1..0000000 --- a/.local/bin/mplayer-wrapper +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eu -export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer" -mplayer "$@" diff --git a/.local/bin/scripts/nix-xorg-conf b/.local/bin/nix-xorg-conf index 7fabd3a..7fabd3a 100755 --- a/.local/bin/scripts/nix-xorg-conf +++ b/.local/bin/nix-xorg-conf diff --git a/.local/bin/nixos-test b/.local/bin/nixos-test new file mode 100755 index 0000000..1fedf89 --- /dev/null +++ b/.local/bin/nixos-test @@ -0,0 +1,35 @@ +#!/bin/sh -eu + +# nix-shell -i dash -p dash gawk moreutils nixos-rebuild nixfmt + +{ [ "${1:-}" = "-h" ] || + [ "${1:-}" = "--help" ] || + [ "$#" = 0 ]; } && + printf "nixos-test [FILE]...\n" && + exit + +for configuration in "$@"; do + + [ -f "$configuration" ] || { printf "Error: File '%s' not found\n" "$configuration" && exit; } + + cp "$configuration" "$configuration.bak" + + trap 'for configuration in "$@"; do mv "$configuration.bak" "$configuration"; done; trap - EXIT; exit' EXIT INT HUP + + nixfmt "$configuration" + + awk '!s {s=sub("^{$","{ boot.isContainer = true;")}{ print $0 }' "$configuration" | sponge "$configuration" + awk '!s {s=sub("}: {","}: { boot.isContainer = true;")}{ print $0 }' "$configuration" | sponge "$configuration" + awk '!s {s=sub("^in {$","in { boot.isContainer = true;")}{ print $0 }' "$configuration" | sponge "$configuration" + + printf '%s ' "$configuration"; + + NIXOS_CONFIG=$(realpath "$configuration") + + export NIXOS_CONFIG \ + NIXPKGS_ALLOW_UNFREE=1 \ + NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 + + nixos-rebuild --fast --option substituters 'https://cache.nixos.org' --option builders '' dry-build + +done; diff --git a/.local/bin/pass-import-csv b/.local/bin/pass-import-csv new file mode 100755 index 0000000..7682657 --- /dev/null +++ b/.local/bin/pass-import-csv @@ -0,0 +1,14 @@ +#!/bin/sh -eu + +csv_file="$HOME/.cache/k.csv" +import_directory="$HOME/.config/pass"; +target_directory="$import_directory/secrets"; + +{ [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ] || [ "$#" = 0 ]; } && printf 'Usage: %s /path/to/keepassxc/database\n' "$(basename "$0")" && exit + +keepassxc-cli export --format csv "$1" > "$csv_file" +rm --recursive --force "${import_directory:?}"/*; +pass import "$csv_file"; +rsync --verbose --archive "$target_directory/" "$import_directory"; +rm --recursive "$target_directory"; +rm --verbose "$csv_file"; diff --git a/.local/bin/pass-menu b/.local/bin/pass-menu new file mode 100755 index 0000000..7f0a306 --- /dev/null +++ b/.local/bin/pass-menu @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# LICENSE: GPLv2+ +# https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu + +set -eo pipefail +shopt -s nullglob globstar + +printf "\n" | $copy + +copy='xsel --input --primary' +menu='dmenu -f -i -b -nhf #ffeb3b -sf #ffeb3b -p ⠀:::⠀passwords⠀:::' +_paste () { xdotool type "$(xsel --output --primary)"; } + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=("$prefix"/**/*.gpg ) +password_files=("${password_files[@]#"$prefix"/}") +password_files=("${password_files[@]%.gpg}") +password=$(printf '%s\n' "${password_files[@]}" | $menu) + +[ -n "$password" ] || exit + +{ pass show "$password" 2>/dev/null | $copy && _paste; } || +{ notify-send --urgency=critical --expire-time=5000 "Failed to copy $password to primary clipboard." && exit 1; } + +printf "\n" | $copy + +notify-send "Copied $password to primary clipboard." diff --git a/.local/bin/pdfmted-editor b/.local/bin/pdfmted-editor deleted file mode 100755 index e9274e4..0000000 --- a/.local/bin/pdfmted-editor +++ /dev/null @@ -1,740 +0,0 @@ -#!/usr/bin/env bash - -# NAME: PDFMtEd – Editor -# VERSION: 0.1 -# AUTHOR: (c) 2014 Glutanimate -# DEPENDENCIES: yad exiftool python2.7 (sejda-pdf) (qpdf) -# -# DESCRIPTION: View and edit PDF metadata using exiftool. -# -# LICENSE: GNU GPLv3 (http://www.gnu.de/documents/gpl-3.0.en.html) -# -# NOTICE: THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -# EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -# PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR -# IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -# PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, -# YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -# -# IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY -# COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS -# PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, -# INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE -# THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED -# INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE -# PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -# PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# USAGE: pdfmted_editor [-r|-u] <file(s) or directory(ies)> - -################ GLOBVAR ################# - -EXECUTABLE="$(readlink -f "$0")" -PROGDIR="${EXECUTABLE%/*}" -THUMBNAILER="$PROGDIR/pdfmted-thumbnailer.py" -TMPDIR="/tmp/${0##*/}" - -############### SETTINGS ################# - -# Supply password for protected PDF files -PASSWORD="" -# Rename modified files by default? -RENAME_OPT="FALSE" - -############## DIALOGS ################# - -# Usage message - -USAGE=" -Usage: $(basename "$0") [-r|-u|-h] <PDF Files/Directories> - - Title: PDFMtEd – Editor - Author: (c) 2014 Glutanimate - Description: View and edit PDF metadata - Arguments: This script accepts multiple PDF files and - directories as input. - -Available options: - -r rename files by default - -u arguments are URIs - -h display this help message\ -" - -# General settings - -YAD_TITLE="PDFMtEd – Editor" -WMCLASS="pdfmtededitor" -ICON="application-pdf" -WIDTH="800" -HEIGHT="650" -PROGWIDTH="400" -PROGHEIGHT="100" - -# Descriptions and tooltips - -TEXT_INFO_DEPERR="Error: Missing dependencies. Please install the \ -following:" - -TEXT_MAIN_DESCRP="\ -<b>Important note</b>: - -Empty fields will <b>delete</b> the associated metadata. \ -However, modifications performed by exiftool are <b>reversible</b>. \ -To purge the file of all metadata please use PDFMtEd – Inspector -" - -TEXT_CHCK_SAVECH="Save changes, file will be skipped if unchecked" -TEXT_CHCK_RENMFL="Rename based on tags" -TEXT_CHCK_DUPLIC="Copy tags over to next/previous file" - -TEXT_HOVR_CANCEL="Cancel and exit" -TEXT_HOVR_FNNISH="Save (if option selected) and exit" -TEXT_HOVR_PREVIT="Move back to previous document" -TEXT_HOVR_NEXTIT="Move to next document in line" - -TEXT_BTTN_PDFVWR="_Open in PDF viewer" -TEXT_HOVR_PDFVWR="Open document with default PDF viewer" - -TEXT_BTTN_SHWFLD="Show in parent _directory" -TEXT_HOVR_SHWFLD="Open parent directory with default file manager" - -TEXT_BTTN_CLRALL="C_lear all" -TEXT_HOVR_CLRALL="Clear all fields" - -TEXT_INFO_WARNG1="Something went wrong while writing the metadata. Processing the document with \ -sejda (recommended) or linearizing it with qpdf helps in these cases. Want to proceed?" -TEXT_NOTI_SUCCE1="Metadata succesfully updated." -TEXT_NOTI_ERROR1="Post-processing failed." - -############## FUNCTIONS ################# - -# dependencies - -check_deps() { - for i in "$@"; do - type "$i" > /dev/null 2>&1 - if [[ "$?" != "0" ]]; then - MISSINGDEPS+=" $i" - fi - done -} - -gui_check_deps(){ - check_deps yad exiftool python2.7 - if [[ -n "$MISSINGDEPS" ]]; then - gui_show_error "${TEXT_INFO_DEPERR} - ${MISSINGDEPS}" - exit 1 - fi -} - -# cleanup - -var_unset(){ - unset -v KEYWORDS SUBJECT AUTHOR TITLE_FN UPDATED_NAME -} - -cleanup(){ - [[ -n "$TMPDIR" && -d "$TMPDIR" ]] && rm -r "$TMPDIR" -} - -# evaluate and check arguments - -arg_evaluate_options(){ - # grab options if present - while getopts "ruh" OPTIONS; do - case $OPTIONS in - r ) RENAME_OPT="TRUE" - ;; - u ) URI_OPT="TRUE" - ;; - h ) echo "$USAGE" - exit 0 - ;; - \? ) echo "$USAGE" - exit 1 - ;; - esac - done -} - -arg_check_correct(){ - # check if arguments aside from options given - if [[ "$#" = "0" ]] - then - error_log 1 - fi - - # check if arguments are files or folders - for ITEM in "$@"; do - if [[ ! -d "$ITEM" && ! -f "$ITEM" ]] - then - error_log 3 - fi - done - - # notify user and exit - if [[ "$ARGERROR" = "1" ]] - then - gui_show_error "ERROR: No files/folder selected." - echo "Exiting..." - exit 1 - fi -} - -arg_uri_to_path(){ - # handle cases where we have to use "pseudo-uris" - cnt=0 - FILEARGS=() - for URI in "$@"; do - # only handles file:// prefix - # for other uri-specific substitutions we would have to - # use python+gio-bindings - FILEARGS[$cnt]="$(echo "$URI" | sed "s/^file:\/\///g")" - ((cnt++)) - done -} - -arg_compose_filearray(){ - # recursively add pdf files and folders in given arguments to array - unset ARGS - ARGID="1" # start array at 1 - while IFS= read -r -d $'\0' FILE; do - if [[ ! "$(file -ib "$FILE")" == *application/pdf* ]] - then - echo "Error: '$FILE' is not a pdf file. Ignoring." - continue - fi - ARGS[ARGID++]="$FILE" - done < <(find "$@" -type f -name '*.pdf' -print0 | sort -z --version-sort) - # numerical-composite (e.g. 1.1<1.2), zero-delimited sorting - ARGSTOTAL="${#ARGS[@]}" - ARGID="1" - if [[ "$ARGSTOTAL" = "0" ]]; then - gui_show_error "ERROR: No PDF files found." - echo "Exiting..." - exit 1 - fi -} - -# Error handling - -error_log(){ - if [[ "$1" = "1" ]]; then - ARGERROR="1" - echo "ARG ERROR: insufficient arguments given." - elif [[ "$1" = "2" ]]; then - ARGERROR="1" - echo "ARG ERROR: illegal arguments ('$ITEM' is not a file or directory.)" - elif [[ "$1" = "3" ]]; then - WRITEERROR="1" - echo "WRITE ERROR: File not updated. Likely an issue with exiftool" - elif [[ "$1" = "5" ]]; then - PSTPRCERROR="1" - echo "POST PROCESSING ERROR: qpdf/sejda failed." - fi -} - -# Set up environment - -setup_filevars(){ - FILE="$(readlink -f "$1")" - FILE_ESCAPED="${FILE//%/%%}" - FILENAME="${FILE##*/}" - BASENAME="${FILENAME%.*}" - DIRNAME="${FILE%/*}" - DIRNAME_ESCAPED="${FILE_ESCAPED%/*}" - PREV_FILE="${ARGS[$ARGID-1]}" - NEXT_FILE="${ARGS[$ARGID+1]}" - PREV_FILENAME="${PREV_FILE##*/}" - NEXT_FILENAME="${NEXT_FILE##*/}" -} - -# Set up GUI - -setup_geometry(){ - GEOMETRYOPTS=("--center" "--height=$HEIGHT" "--width=$WIDTH") - PROGGEO=("--center" "--height=$PROGHEIGHT" "--width=$PROGWIDTH") -} - -setup_gui(){ - MULTIDOC_TITLE="$YAD_TITLE ($ARGID/$ARGSTOTAL)" - # we are using arrays to construct and modify YAD dialogs - # multiple documents - show all elements - if [[ "$MULTIDOC" = "middle" ]] - then - MULTIDOC_FIELDS=(\ - --field="$TEXT_CHCK_DUPLIC":CHK "FALSE" \ - --field="<b>Previous Document</b>:":RO "$PREV_FILENAME" \ - --field="<b>Next Document</b>:":RO "$NEXT_FILENAME") - MULTIDOC_BUTTONS=(--button="_Previous!go-previous!$TEXT_HOVR_PREVIT:1" \ - --button="_Next!go-next!$TEXT_HOVR_NEXTIT:2") - # multiple documents, first doc - hide previous - elif [[ "$MULTIDOC" = "first" ]] - then - MULTIDOC_FIELDS=(\ - --field="$TEXT_CHCK_DUPLIC":CHK "FALSE" \ - --field="<b>Next Document</b>:":RO "$NEXT_FILENAME" ) - MULTIDOC_BUTTONS=(--button="_Next!go-next!$TEXT_HOVR_NEXTIT:2") - # multiple documents, last doc - hide next - elif [[ "$MULTIDOC" = "last" ]] - then - MULTIDOC_FIELDS=(\ - --field="$TEXT_CHCK_DUPLIC":CHK "FALSE" \ - --field="<b>Previous Document</b>:":RO "$PREV_FILENAME") - MULTIDOC_BUTTONS=(--button="_Previous!go-previous!$TEXT_HOVR_PREVIT:1") - # single document - hide all elements - elif [[ "$MULTIDOC" = "single" ]] - then - HEIGHT="620" - MULTIDOC_FIELDS=() - MULTIDOC_BUTTONS=() - fi - setup_geometry -} - -# GUIs - -gui_notify(){ - notify-send -i "$NOTIFY_ICON" "$YAD_TITLE" "$1" -} - -gui_progress(){ - # ampersands in gui elements cause issues in gtk/pango markup - BASENAME_PANGO="$(echo "$BASENAME" | sed 's/\&/\&/g')" - yad --progress --pulsate --auto-close \ - "${PROGGEO[@]}" \ - --image="$ICON" --window-icon="$ICON" \ - --class="$WMCLASS" \ - --title="$YAD_TITLE" \ - --text="Processing <b>$BASENAME_PANGO</b> ..." \ - --button='_Cancel!gtk-cancel!':1 \ - 2> /dev/null - PROG_RET="$?" - if [[ "$PROG_RET" != "0" ]] - then - kill -s TERM "$TOP_PID" - fi -} - -gui_show_error(){ - yad --title="$YAD_TITLE" \ - --center --width="400" --height="100" \ - --image=dialog-error \ - --window-icon=dialog-error \ - --class="$WMCLASS" \ - --text="$1" \ - --button="OK":0 2> /dev/null - echo "$1" -} - -gui_metadata_entry_multi(){ - NEW_METADATA="$( \ - yad --form --scroll \ - --always-print-result \ - "${GEOMETRYOPTS[@]}" \ - --image="$IMAGE" --window-icon="$ICON" \ - --class="$WMCLASS" \ - --title="$MULTIDOC_TITLE" \ - --buttons-layout=end \ - --button="_Cancel!gtk-cancel!$TEXT_HOVR_CANCEL:33" \ - "${MULTIDOC_BUTTONS[@]}" \ - --button="_Finish!gtk-ok!$TEXT_HOVR_FNNISH:3" \ - --field="<b>Current Document</b>:":RO "$FILENAME"\ - --field="":LBL "" \ - --field="$TEXT_MAIN_DESCRP":LBL "" \ - --field="Author:" "$AUTHOR_ORIGINAL" \ - --field="Title:" "$TITLE_ORIGINAL" \ - --field="Year:":NUM "$YEAR_ORIGINAL[!0..3000[!1]]" \ - --field="Keywords:" "$KEYWORDS_ORIGINAL" \ - --field="Subject:" "$SUBJECT_ORIGINAL" \ - --field "$TEXT_BTTN_CLRALL!gtk-clear!$TEXT_HOVR_CLRALL":FBTN \ - "@bash -c gui_clear_fields" \ - --field="":LBL "" \ - --field="$TEXT_BTTN_PDFVWR!application-pdf!$TEXT_HOVR_PDFVWR:FBTN" \ - "bash -c \"gui_open '$FILE_ESCAPED'\"" \ - --field="$TEXT_BTTN_SHWFLD!folder!$TEXT_HOVR_SHWFLD:FBTN" \ - "bash -c \"gui_open '$DIRNAME_ESCAPED'\"" \ - --field="":LBL "" \ - --field="$TEXT_CHCK_SAVECH":CHK "TRUE" \ - --field="$TEXT_CHCK_RENMFL":CHK "$RENAME_OPT" \ - "${MULTIDOC_FIELDS[@]}" \ - 2> /dev/null)" - RET_MAIN=$? - if [[ "$RET_MAIN" = 1 ]] - then - PROGRESSION="PREVIOUS" - elif [[ "$RET_MAIN" = 2 ]] - then - PROGRESSION="NEXT" - elif [[ "$RET_MAIN" = 3 ]] - then - PROGRESSION="FINISH" - else - echo "Aborted." - exit 1 - fi -} - -gui_postprocess_pdf(){ - yad --title="$YAD_TITLE" \ - --center --width="400" --height="100" \ - --image=dialog-error \ - --window-icon=dialog-error \ - --class="$WMCLASS" \ - --text="$TEXT_INFO_WARNG1" \ - --button="_Process with Sejda!gtk-ok!$TEXT_HOVR_PSTPRC_SEJ:0" \ - --button="_Linearize!gtk-ok!$TEXT_HOVR_PSTPRC_LIN:2" \ - --button="_Cancel!gtk-cancel!$TEXT_HOVR_PSTPRC_CANCEL:1" - RET_PSTPRC="$?" - if [[ "$RET_PSTPRC" = "0" ]]; then - if ! type sejda-console > /dev/null 2>&1; then - gui_show_error "Error: Sejda not installed." - gui_postprocess_pdf - return - fi - sejda_process_pdf | gui_progress - check_modify_success - error_recheck_write - elif [[ "$RET_PSTPRC" = "2" ]]; then - if ! type qpdf > /dev/null 2>&1; then - gui_show_error "Error: qpdf not installed." - gui_postprocess_pdf - return - fi - linearize_pdf | gui_progress - check_modify_success - error_recheck_write - else - return 1 - fi -} - - -# GUI extensions - -# create thumbnail -gui_thumbnail_generate() { - if [[ -f "$THUMBNAILER" ]]; then - echo "#Generating preview..." - $THUMBNAILER "$FILE" > /dev/null 2>&1 - fi -} - -# assign thumbnail -gui_thumbnail_assign(){ - - PREVIEWIMG="$(python2.7 -c "import gio; import sys; \ - print gio.File(sys.argv[1]).query_info('*').get_attribute_byte_string \ - ('''thumbnail::path''')" "$FILE")" - - if [[ "$(file -ib "$FILE" | cut -d';' -f1)" != "application/pdf" || ! -f "$PREVIEWIMG" ]] - then - PREVIEWIMG="$ICON" - fi - - IMAGE="$PREVIEWIMG" - NOTIFY_ICON="$PREVIEWIMG" -} - -# generic yad xdg-open function -gui_open(){ - PATH_ESCAPED="${1//%/%25}" - xdg-open "$PATH_ESCAPED" > /dev/null 2>&1 & -} - -# clear yad fields -gui_clear_fields(){ - for FIELDNR in {4..8}; do - echo "$FIELDNR:" - done -} - -# preserve metadata for next document in line -duplicate_metadata () { - AUTHOR_ORIGINAL="$AUTHOR" - TITLE_ORIGINAL="$TITLE" - YEAR_ORIGINAL="$YEAR" - SUBJECT_ORIGINAL="$SUBJECT" - KEYWORDS_ORIGINAL="$KEYWORDS" -} - - -process_yad_formchoices(){ - echo "$NEW_METADATA" - AUTHOR="$(echo "$NEW_METADATA" | cut -d '|' -f4)" - TITLE="$(echo "$NEW_METADATA" | cut -d '|' -f5)" - YEAR="$(echo "$NEW_METADATA" | cut -d '|' -f6 | cut -d ',' -f1 | cut -d '.' -f1)" - KEYWORDS="$(echo "$NEW_METADATA" | cut -d '|' -f7)" - SUBJECT="$(echo "$NEW_METADATA" | cut -d '|' -f8)" - SAVECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f14)" - RENAMECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f15)" - DUPLICATECHOICE="$(echo "$NEW_METADATA" | cut -d '|' -f16)" - MODIFYDATE="$(date +"%Y:%m:%d %H:%M:%S")" - if [[ "$YEAR" = "0" ]]; then - CREATEDATE="" - else - CREATEDATE="$(printf "%04d" "$YEAR"):01:01 00:00:00" - fi -} - -# Metadata input - -read_metadata() { - echo "#Reading embedded metadata..." - exiftool -e -S -sep ";" -PDF:Title -PDF:Author -PDF:Subject \ - -PDF:Keywords -PDF:CreateDate -PDF:ModifyDate \ - "$FILE" > "$PROGPIPE" -} - -print_original_metadata() { - echo "###Original metadata:" - echo "" - echo "Author: $AUTHOR_ORIGINAL" - echo "Title: $TITLE_ORIGINAL" - echo "Year: $YEAR_ORIGINAL" - echo "Creation date: $CREATEDATE_ORIGINAL" - echo "Modification date: $MODIFYDATE_ORIGINAL" - echo "Subject: $SUBJECT_ORIGINAL" - echo "Keywords: $KEYWORDS_ORIGINAL" -} - -evaluate_original_metadata() { - METADATA_PDF="$( [[ -f "$PROGPIPE" ]] && cat "$PROGPIPE")" - AUTHOR_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Author: //p')" - TITLE_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Title: //p')" - CREATEDATE_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/CreateDate: //p')" - YEAR_ORIGINAL="${CREATEDATE_ORIGINAL:0:4}" - MODIFYDATE_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/ModifyDate: //p')" - SUBJECT_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Subject: //p')" - KEYWORDS_ORIGINAL="$(echo "$METADATA_PDF" | sed -n 's/Keywords: //p')" -} - -# Metadata output - -delete_metadata(){ - echo "#Deleting existing metadata" - exiftool -e -overwrite_original -all:all="" "$FILE" -} - -write_metadata(){ - echo "#Writing new metadata" - exiftool -e -overwrite_original -password "$PASSWORD" -sep ";" \ - -PDF:Title="$TITLE" -PDF:Author="$AUTHOR" \ - -PDF:Subject="$SUBJECT" -PDF:Keywords="$KEYWORDS" \ - -PDF:ModifyDate="$MODIFYDATE" -PDF:CreateDate="$CREATEDATE" \ - -XMP-dc:Subject="$KEYWORDS" -XMP-dc:Description="$SUBJECT" -XMP-dc:Title="$TITLE" \ - -XMP-dc:Creator="$AUTHOR" -XMP-dc:Date="$CREATEDATE" \ - "$FILE" - echo "$?" > "$ERRORPIPE1" -} - -update_metadata(){ - delete_metadata; write_metadata - check_modify_success - error_check_write -} - -print_updated_metadata() { - echo "###Updated metadata:" - echo "" - echo "Author: $AUTHOR" - echo "Title: $TITLE" - echo "Year: $YEAR" - echo "Creation date: $CREATEDATE" - echo "Modificaiton date: $MODIFYDATE" - echo "Subject: $SUBJECT" - echo "Keywords: $KEYWORDS" -} - -update_filename(){ - TARGETFOLDER="$DIRNAME" - # replace characters in title that might cause issues on some file systems - TITLE_FN="$(echo "$TITLE" | sed -e 's/\:/\;/g' -e 's/\&/and/g')" - # Modify the following lines to change the naming scheme: - # (default naming scheme: ${AUTHOR} - ${TITLE_FN} - ${YEAR}) - if [[ -n "$AUTHOR" ]]; then - UPDATED_NAME="$AUTHOR" - fi - if [[ -n "$TITLE" ]]; then - if [[ -n "$UPDATED_NAME" ]]; then - UPDATED_NAME+=" - $TITLE_FN" - else - UPDATED_NAME="$TITLE" - fi - fi - if [[ -n "$YEAR" && "$YEAR" != "0" ]]; then - if [[ -n "$UPDATED_NAME" ]]; then - UPDATED_NAME+=" - $YEAR" - else - UPDATED_NAME="$YEAR" - fi - fi - echo "Updating file name..." - mv "$FILE" "$TARGETFOLDER/$UPDATED_NAME.pdf" - ARGS[$ARGID]="$TARGETFOLDER/$UPDATED_NAME.pdf" # make sure to update file array with - # new location -} - -# Error checks and workarounds - -# check if modification was successful -check_modify_success(){ - # if the PDF ModifyDate hasn't been altered we can assume - # that the exiftool tagging failed - MODDATE_CHECK="$(exiftool -e -S -sep ";" -PDF:ModifyDate "$FILE"\ - | sed -n 's/ModifyDate: //p')" - if [[ "$MODDATE_CHECK" != "$MODIFYDATE" ]] - then - error_log 3 - fi -} - -error_check_write(){ - WRITE_RETURNCODE="$(cat "$ERRORPIPE1")" - if [[ "$WRITE_RETURNCODE" != "0" || "$WRITEERROR" = "1" ]] - then - WRITEERROR="0" - echo "$TEXT_INFO_WARNG1" - gui_postprocess_pdf - else - gui_notify "$TEXT_NOTI_SUCCE1" - echo "Success." - fi -} - -error_recheck_write(){ - PSTPRC_RETURNCODE="$(cat "$ERRORPIPE2")" - if [[ "$PSTPRC_RETURNCODE" != "0" || "$WRITEERROR" = "1" ]] - then - error_log 4 - echo "$TEXT_NOTI_ERROR1" - gui_notify "$TEXT_NOTI_ERROR1" - else - gui_notify "$TEXT_NOTI_SUCCE1" - echo "Success." - fi -} - -sejda_process_pdf(){ - # Sejda does not preserve any document metadata - # so we have to perform the exiftool actions again; - # we use delete_metadata() in order to remove sejda-related metadata - echo "#Running Sejda on $FILENAME..." - TEMPFILE="$DIRNAME/${BASENAME}_sejda.pdf" - sejda-console merge --compressed -v 7 -f "$FILE" -o "$TEMPFILE" - RET_POSTPROC="$?" - if [[ "$RET_POSTPROC" = "0" ]]; then - mv "$TEMPFILE" "$DIRNAME/${BASENAME}.pdf" - delete_metadata - write_metadata - fi - echo "$RET_POSTPROC" > "$ERRORPIPE2" -} - -linearize_pdf(){ - # qpdf only preserves metadata that is not marked as - # obsolete by exiftool; to purge all existing (and potentially - # corrupted metadata entries) we first delete all metadata, - # linearize with qpdf, and then rewrite the metadata - echo "#Linearizing $FILENAME..." - delete_metadata - TEMPFILE="$DIRNAME/${BASENAME}_linearized.pdf" - qpdf --linearize "$FILE" "$TEMPFILE" - RET_QPDF="$?" - if [[ "$RET_QPDF" = "0" ]]; then - mv "$TEMPFILE" "$DIRNAME/${BASENAME}.pdf" - write_metadata - fi - echo "$RET_QPDF" > "$ERRORPIPE2" -} - -# Main - -main_check_argid(){ - echo "Processing $ARGID of $ARGSTOTAL" - if [[ "$ARGSTOTAL" = "1" ]] - then - MULTIDOC="single" - elif [[ "$ARGID" = "1" ]] - then - MULTIDOC="first" - elif [[ "$ARGID" = "$ARGSTOTAL" ]] - then - MULTIDOC="last" - else - MULTIDOC="middle" - fi -} - -main_iteration(){ - var_unset - setup_filevars "$1" - setup_gui - gui_thumbnail_generate; read_metadata - gui_thumbnail_assign - evaluate_original_metadata - [[ "$DUPLICATECHOICE" = "TRUE" ]] && duplicate_metadata - print_original_metadata - gui_metadata_entry_multi - process_yad_formchoices - print_updated_metadata - [[ "$SAVECHOICE" = "TRUE" ]] && update_metadata - [[ "$SAVECHOICE" = "TRUE" && "$RENAMECHOICE" = "TRUE" ]] && update_filename -} - -main_check_progression(){ - if [[ "$PROGRESSION" = "NEXT" ]] - then - ARGID="$((ARGID+1))" - main - elif [[ "$PROGRESSION" = "PREVIOUS" ]] - then - ARGID="$((ARGID-1))" - main - elif [[ "$PROGRESSION" = "FINISH" ]] - then - echo "Finished." - exit 0 - fi -} - -main(){ - main_check_argid - main_iteration "${ARGS[$ARGID]}" - main_check_progression -} - -############## FCT EXPORT ################ - -# functions assigned to yad buttons need to be exported - -export -f gui_clear_fields -export -f gui_open - -############### CLEANUP ################## - -trap "cleanup; exit" EXIT - -############## PREPWORK ################### - -TOP_PID="$$" -mkdir -p "$TMPDIR" -PROGPIPE="$(mktemp -u --tmpdir="$TMPDIR" XXXXXXXX)" -ERRORPIPE1="$(mktemp -u --tmpdir="$TMPDIR" XXXXXXXX)" -ERRORPIPE2="$(mktemp -u --tmpdir="$TMPDIR" XXXXXXXX)" - -############## USGCHECKS ################# - -gui_check_deps -arg_evaluate_options "$@" -shift $((OPTIND-1)) -FILEARGS=("$@") -[[ "$URI_OPT" = "TRUE" ]] && arg_uri_to_path "${FILEARGS[@]}" -arg_check_correct "${FILEARGS[@]}" -arg_compose_filearray "${FILEARGS[@]}" - -################ MAIN #################### - -main diff --git a/.local/bin/picospeaker b/.local/bin/picospeaker deleted file mode 100755 index 22b0210..0000000 --- a/.local/bin/picospeaker +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -eu -audio=$(mktemp --suffix -picospeaker.wav) -text=${1:-The text argument is absent.} - -rm -f /tmp/*-picospeaker.wav; - -[ "${1-}" = "echo" ] && picospeaker "${2-}" "${1-}" && exit; - -pico2wave -w "$audio" "$text"; -[ "${2-}" = "echo" ] && ffmpeg -y -i "$audio" -map 0 -c:v copy -af aecho=1:1:50:0.5 "$audio"; -mplayer "$audio"; diff --git a/.local/bin/plumber b/.local/bin/plumber index b791adc..88aa80c 100755 --- a/.local/bin/plumber +++ b/.local/bin/plumber @@ -1,39 +1,131 @@ #! /usr/bin/env elixir +defmodule Settings do + def terminal do + System.get_env("TERMINAL") + end +end + defmodule ArgParser do def parse do {opts, _} = System.argv() |> OptionParser.parse!(strict: [option: :string, text: :string]) + options = [ + camelize: "text->camelize", + case_lower: "case->lower", + case_title: "case->title", + case_titleize: "case->titleize", + case_upper: "case->upper", + date8601: "text->date8601", + dictionary: "word->dictionary", + jumbleize: "text->jumbleize", + kjv: "verse->kjv", + letterize: "text->letterize", + lorem_paragraph: "lorem->paragraph", + lorem_title: "lorem->title", + reverse_letters: "reverse->letters", + reverse_words: "reverse->words", + singleline: "text->singleline", + slugize: "text->slugize", + urlize: "text->urlize", + ] + cond do - opts[:option] == "First letter of each word in sentence" -> - TextPlumber.firstLetterOfWordsIn(opts[:text]) |> IO.binwrite() + opts[:option] == options[:letterize] -> + TextPlumber.firstLetterOfWordsIn(opts[:text]) |> IO.puts() + + opts[:option] == options[:urlize] -> + URI.encode(opts[:text]) |> IO.puts() + + opts[:option] == options[:slugize] -> + opts[:text] + |> String.normalize(:nfd) + |> String.replace(~r/[[:space:]]+/, " ") + |> String.replace(~r/[[:punct:]]+/, " ") + |> Macro.underscore() + |> String.replace(~r/[[:space:]]+/, "-") + |> String.replace(~r/[[:punct:]]+/, "-") + |> String.trim("-") + |> IO.puts() + + opts[:option] == options[:camelize] -> + opts[:text] + |> String.normalize(:nfd) + |> String.replace(~r/[[:space:]]+/, "_") + |> String.replace(~r/[[:punct:]]+/, "_") + |> Macro.camelize() + |> String.replace(~r/[[:space:]]+/, "") + |> String.replace(~r/[[:punct:]]+/, "") + |> IO.puts() + + opts[:option] == options[:singleline] -> + TextPlumber.singleLineOf(opts[:text]) |> IO.puts() + + opts[:option] == options[:jumbleize] -> + String.split(opts[:text] |> String.replace(~r/[[:punct:]]+/, "")) + |> Enum.map(&String.codepoints/1) + |> Enum.map(&TextPlumber.jumble/1) + |> Enum.map(&Enum.join/1) + |> Enum.join(" ") + |> IO.puts() + + opts[:option] == options[:reverse_words] -> + TextPlumber.reverse(opts[:text]) |> IO.puts() + + opts[:option] == options[:reverse_letters] -> + String.split(opts[:text]) + |> Enum.map(&String.codepoints/1) + |> Enum.map(&Enum.reverse/1) + |> Enum.join(" ") + |> IO.puts() + + opts[:option] == options[:dictionary] -> + TextPlumber.dictionOfFirstWordIn(opts[:text]) + TextPlumber.firstWordOf(opts[:text]) |> IO.puts() + + opts[:option] == options[:case_title] -> + opts[:text] |> to_string |> TextPlumber.titleCaseOf() |> IO.puts() + + opts[:option] == options[:case_titleize] -> + String.downcase(opts[:text]) |> TextPlumber.titleCaseOf() |> IO.puts() + + opts[:option] == options[:case_lower] -> + String.downcase(opts[:text]) |> IO.puts() + + opts[:option] == options[:case_upper] -> + String.upcase(opts[:text]) |> IO.puts() + + opts[:option] == options[:lorem_title] -> + TextPlumber.loremTitle() - opts[:option] == "Single line of text" -> - TextPlumber.singleLineOf(opts[:text]) |> IO.binwrite() + opts[:option] == options[:lorem_paragraph] -> + TextPlumber.loremParagraph() - opts[:option] == "Thesaurus" -> - TextPlumber.synonymOfFirstWordIn(opts[:text]) - TextPlumber.firstWordOf(opts[:text]) |> IO.binwrite() + opts[:option] == options[:date8601] -> + TextPlumber.date8601() - opts[:option] == "KJV Verse Lookup" -> - System.cmd("urxvt", ["-e", "sh", "-c", "kjv #{TextPlumber.singleLineOf(opts[:text])}"]) - TextPlumber.singleLineOf(opts[:text]) |> IO.binwrite() + opts[:option] == options[:kjv] -> + System.cmd(Settings.terminal(), [ + "-e", + "sh", + "-c", + "kjv #{TextPlumber.singleLineOf(opts[:text])}" + ]) - opts[:option] == "Title Case" -> - TextPlumber.titleCaseOf(opts[:text]) |> IO.binwrite() + TextPlumber.singleLineOf(opts[:text]) |> IO.puts() true -> - "No plumber #{opts[:option] || "specified"}." |> IO.puts() + Enum.each(options, fn {_, value} -> IO.puts(value) end) end end end defmodule TextPlumber do def firstLetterOfWordsIn(text) do - String.replace(text, ~r/(\w)\w*/, "\\1", global: true) - |> String.replace(~r/\s\s+/, " ", global: true) + String.replace(text, ~r/(\w)\w*/u, "\\1", global: true) + |> String.replace(~r/\s\s+/u, " ", global: true) end def singleLineOf(text) do @@ -45,12 +137,67 @@ defmodule TextPlumber do String.split(text) |> List.first() end + def reverse(text) do + String.split(text) |> Enum.reverse |> Enum.join(" ") + end + def titleCaseOf(text) do text |> String.split() |> Enum.map(fn word -> :string.titlecase(word) end) |> Enum.join(" ") end - def synonymOfFirstWordIn(text) do - System.cmd("urxvt", ["-e", "sh", "-c", "dict #{TextPlumber.firstWordOf(text)} | vim -"]) + def loremParagraph() do + {string, _return} = + System.cmd("sh", [ + "-c", + "perl -e 'use Text::Lorem; use Text::Wrap; $Text::Wrap::columns = 80; print wrap(\"\", \"\", Text::Lorem->new()->sentences(5));'" + ]) + + IO.puts(string) + end + + def loremTitle() do + {string, _return} = + System.cmd("sh", [ + "-c", + "perl -e 'use Text::Lorem; print Text::Lorem->new()->words(4)';" + ]) + + IO.puts(string) + end + + def dictionOfFirstWordIn(text) do + System.cmd(Settings.terminal(), [ + "-e", + "sh", + "-c", + "dict -h localhost #{TextPlumber.firstWordOf(text)} 2>&1 | vim -" + ]) + end + + def jumble(list) do + if length(list) == 1 do + list + else + head = Enum.take(list, 1) + tail = Enum.take(list, -1) + list = list |> Enum.drop(-1) |> Enum.drop(1) + + if length(list) == 2 do + head ++ (list |> Enum.reverse()) ++ tail + else + head ++ (list |> Enum.shuffle()) ++ tail + end + end + end + + def date8601() do + {string, _return} = + System.cmd("date", [ + "--universal", + "--iso-8601=seconds" + ]) + + IO.puts(string) end end diff --git a/.local/bin/plumber-dmenu b/.local/bin/plumber-dmenu index bdfe28e..ea141c2 100755 --- a/.local/bin/plumber-dmenu +++ b/.local/bin/plumber-dmenu @@ -1,15 +1,32 @@ #!/bin/sh -eu -options="First letter of each word in sentence -Single line of text -Thesaurus -KJV Verse Lookup -Title Case + +options="\ +case->lower +case->title +case->titleize +case->upper +lorem->paragraph +lorem->title +reverse->letters +reverse->words +text->camelize +text->date8601 +text->jumbleize +text->letterize +text->singleline +text->slugize +text->urlize +verse->kjv +word->dictionary " -printf "%s" "$options" \ - | dmenu -i -b -p Plumb \ - | while read -r option - do - text=$(plumber --option "$option" --text "$(xsel -o)") - { notify-send "$text" && printf "%s" "$text" | xsel -ib; } \ - || notify-send "Plumber: Clipboard selection is empty" - done + +selection=$( + printf "%s" "$options" | dmenu -i -b -p ⠀:::⠀plumber⠀::: || + { [ "$?" = 127 ] && kill -15 "$$" && "$0"; } +) + +printf "%s\n" "$selection" | while read -r option; do + text=$(plumber --option "$option" --text "$(xsel -o)") + { notify-send "$text" && printf "%s" "$text" | xsel -ib; } || + notify-send "Plumber: Clipboard selection is empty" +done diff --git a/.local/bin/portmanteau b/.local/bin/portmanteau new file mode 100755 index 0000000..9ce9dc3 --- /dev/null +++ b/.local/bin/portmanteau @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -eu + +minimum=4 +words=$(diceware --no-caps --num 2 --delimiter " ") +first=${words%??? *} +second=${words#* ???} + +[ ${#first} -lt $minimum ] && "$0" && exit +[ ${#second} -lt $minimum ] && "$0" && exit + +vowels="a e i o u" +sounds="h r w y" +consonants="b c d f g j k l m n p q s t v x z" +suffix=${first: -1:1} +prefix=${second: 0:1} +digraph="$suffix$prefix" +compressed="${first: 0:-1}${second: 1}" + +printf 'words: %s\n' "$words" +printf 'digraph: %s\n' "$digraph" +printf 'merge: %s%s\n' "$first" "$second" +printf 'compressed: %s\n\n' "$compressed" + +Grammar() { + for left in $consonants; do + [ "$suffix" = "$left" ] && + { + for right in $consonants; do + [ "$prefix" = "$right" ] && + printf '%s\n' "$compressed" && + exit + done + } + done || printf '%s%s\n' "$first" "$second" +} + +Grammar diff --git a/.local/bin/powerdialog b/.local/bin/powerdialog index 43c2250..52e3330 100755 --- a/.local/bin/powerdialog +++ b/.local/bin/powerdialog @@ -1,16 +1,16 @@ #!/bin/sh -eu -ACTION=$(zenity --width=90 \ +ACTION=$(yad --width=90 \ --height=210 --list --radiolist --text="Select Action" \ --title="Logout" --column "Choice" --column "Action" \ FALSE Shutdown FALSE Reboot TRUE Suspend FALSE Lock FALSE Blank) if [ -n "${ACTION}" ]; then case $ACTION in - Shutdown) zenity --question --text "Are you sure you want to halt?" && sudo -A 'systemctl poweroff' ;; - Reboot) zenity --question --text "Are you sure you want to reboot?" && sudo -A 'systemctl reboot' ;; - Suspend) systemctl suspend ;; - Lock) i3lock-fancy ;; - Blank) sleep 1; xset dpms force off ;; + 'TRUE|Shutdown|') yad --question --text "Are you sure you want to halt?" && sudo -A 'systemctl poweroff' ;; + 'TRUE|Reboot|') yad --question --text "Are you sure you want to reboot?" && sudo -A 'systemctl reboot' ;; + 'TRUE|Suspend|') systemctl suspend ;; + 'TRUE|Lock|') i3lock-fancy ;; + 'TRUE|Blank|') sleep 1; xset dpms force off ;; esac fi diff --git a/.local/bin/rofi-askpass b/.local/bin/rofi-askpass index f19a68c..612a819 100755 --- a/.local/bin/rofi-askpass +++ b/.local/bin/rofi-askpass @@ -1,2 +1,12 @@ #!/bin/sh -eu -rofi -dmenu -password -i -no-fixed-num-lines -padding 15 -p "Password"; + +program=doas +password=$(rofi -dmenu -password -i -no-fixed-num-lines -padding 15 -p "Password";) + +expect <<EOF + set timeout -1 + spawn "$program" "$@" + expect "assword:" + send -- "$password\r" + expect eof +EOF diff --git a/.local/bin/say b/.local/bin/say new file mode 100755 index 0000000..4537669 --- /dev/null +++ b/.local/bin/say @@ -0,0 +1,23 @@ +#!/bin/sh -eu + +audio=/tmp/speak-jfgOUcZdWu.wav +text=${1:-Nothing to say.} + +[ "${1-}" = "echo" ] && $0 "${2-}" "${1-}" && exit; + +printf '%s' "$text" | + piper \ + --model "$HOME/.local/share/piper/voices/en_GB-jenny_dioco-medium.onnx" \ + --output_file $audio + +[ "${2-}" = "echo" ] && + ffmpeg \ + -y \ + -i "$audio" \ + -map 0 \ + -c:v copy \ + -af aecho=1:1:50:0.5,atempo=0.85 "$audio.mp3" && + mplayer -really-quiet "$audio.mp3" && + exit; + +mplayer -really-quiet "$audio"; diff --git a/.local/bin/screenrecord b/.local/bin/screenrecord new file mode 100755 index 0000000..7702243 --- /dev/null +++ b/.local/bin/screenrecord @@ -0,0 +1,17 @@ +#!/bin/sh -eu + +process=x11grab +directory=$HOME/Desktop/screen-recordings +default=$(xrandr | awk '/*/ { print $1 }' | head -n1) +file="$(date +%I:%M:%S-%p-%A-%d-%B-%Y).mp4" +resolution=${1:-$default} + +[ "${1:-}" = "stop" ] && kill -15 "$(ps -aux | awk "/$process/"' { print $2 }' | head -n 1)" +[ "${1:-}" = "stop" ] && exit + +[ "$(ps -aux | awk "/$process/"' { print $2 }' | wc -l)" != 1 ] && printf 'Screen Already Recording!\n' && exit + +mkdir --parents "$directory" +notify-send --expire-time=2000 "Screen Recording Started ($resolution)" "$directory/$file" && sleep 2 +ffmpeg -f alsa -i default -f alsa -i default -f x11grab -s "$resolution" -i "$DISPLAY" -r 24 -c:v libx264rgb -crf 0 -preset ultrafast "$directory/$file" || true +notify-send "Screen Recording Ended ($resolution)" "$directory/$file" diff --git a/.local/bin/scripts/amixer b/.local/bin/scripts/amixer deleted file mode 100755 index 9b9b679..0000000 --- a/.local/bin/scripts/amixer +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -eu -[ "$1" = "up" ] && amixer set Master 1%+ -[ "$1" = "down" ] && amixer set Master 1%- -[ "$1" = "mute" ] && amixer sset Master toggle diff --git a/.local/bin/scripts/app-launcher b/.local/bin/scripts/app-launcher deleted file mode 100755 index 60e507a..0000000 --- a/.local/bin/scripts/app-launcher +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eu -# rofi -cache-dir "$HOME/.local/share" -fullscreen -show run -display-run '$' -font 'ubuntu 12' -padding 250; -dmenu_run_history; diff --git a/.local/bin/scripts/app-launcher-priv b/.local/bin/scripts/app-launcher-priv deleted file mode 100755 index 8552f21..0000000 --- a/.local/bin/scripts/app-launcher-priv +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eu -# rofi -cache-dir "$HOME/.local/share" -fullscreen -show run -display-run '#' -run-command 'sudo -A {cmd}' -font 'ubuntu 12' -padding 250; -dmenu_run_history privilege; diff --git a/.local/bin/scripts/app-launcher-terminal b/.local/bin/scripts/app-launcher-terminal deleted file mode 100755 index c96f919..0000000 --- a/.local/bin/scripts/app-launcher-terminal +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -eu -dmenu_run_history terminal; diff --git a/.local/bin/scripts/events-idle b/.local/bin/scripts/events-idle deleted file mode 100755 index 1ec1e10..0000000 --- a/.local/bin/scripts/events-idle +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -eux - -# update file search cache -"$HOME"/.local/bin/scripts/file-search update; - -# update dmenu_run_history -"$HOME"/.local/bin/dmenu_run_history update; diff --git a/.local/bin/scripts/events-usb b/.local/bin/scripts/events-usb deleted file mode 100755 index 2978a84..0000000 --- a/.local/bin/scripts/events-usb +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -eux -xmodmap "$HOME/.config/X11/Xmodmap"; -xset r rate 200 60; diff --git a/.local/bin/scripts/internet-search b/.local/bin/scripts/internet-search deleted file mode 100755 index 096c4ee..0000000 --- a/.local/bin/scripts/internet-search +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -eu -rofi -dmenu -show run -font "ubuntu 16" -padding 10 -lines 0 -p " " | xargs -r surfraw duckduckgo diff --git a/.local/bin/scripts/volume-down b/.local/bin/scripts/volume-down deleted file mode 100755 index 774ee0b..0000000 --- a/.local/bin/scripts/volume-down +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -eu -"$HOME"/.local/bin/scripts/amixer down diff --git a/.local/bin/scripts/volume-mute b/.local/bin/scripts/volume-mute deleted file mode 100755 index e3aded4..0000000 --- a/.local/bin/scripts/volume-mute +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -eu -"$HOME"/.local/bin/scripts/amixer mute diff --git a/.local/bin/scripts/volume-up b/.local/bin/scripts/volume-up deleted file mode 100755 index fbbbb0b..0000000 --- a/.local/bin/scripts/volume-up +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -eu -"$HOME"/.local/bin/scripts/amixer up diff --git a/.local/bin/scripts/window-switcher b/.local/bin/scripts/window-switcher deleted file mode 100755 index 39483a2..0000000 --- a/.local/bin/scripts/window-switcher +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -eu - -# Copyright 2013 Tom Vincent <http://tlvince.com/contact/> -wmctrl -l | cut -d' ' -f 1,5- | dmenu -f -i -b -p Switch | cut -d' ' -f 1 | xargs wmctrl -ia - -# Rofi -#rofi -no-disable-history -show window -theme-str '#prompt { enabled: false; }' -window-format {t} -font "ubuntu 12" -padding 15 -lines 1 diff --git a/.local/bin/seance b/.local/bin/seance new file mode 100755 index 0000000..1dcaf36 --- /dev/null +++ b/.local/bin/seance @@ -0,0 +1,64 @@ +#!/bin/sh -eu + +program=$(basename "$0") +directory=$HOME/.config/seance +session=$directory/session +spirits=$directory/spirits + +help() { +printf \ +" +Usage: %s [FLAGS]... [ARGUMENT]... + +The program $program shall save and restore +running programs in a desktop session according +to a specified configuration file. + +Add a program string, one per line, +to $spirits to +save programs in current session. + +Session: $session +Configuration: $spirits + + Command List: + + $program commit Saves current running programs to session. + $program list List saved programs. + $program config View current configuration. + $program search Search for a running program. + $program windows List running programs + $program start Restore previous session. + $program -h --help Show this help menu. + +" "$program"; +} + +{ [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ] || [ "$#" = 0 ]; } && help && exit; + +mkdir --parents "$directory" + +touch "$spirits" + +commit() { + ps aux \ + | awk '$1 == "'"$(whoami)"'" { $1=$2=$3=$4=$5=$6=$7=$8=$9=$10=""; print $0 }' \ + | awk '!deduplicate[$0]++ { $1=$1; printf "%s &\n", $0 }' +} + +[ "${1:-}" = "commit" ] && + { commit | grep --file="$spirits" >> "$session" || printf "Warning empty or failed session file!\n"; } && + printf 'Session %s canonized.\n' "$session" && + exit + +[ "${1:-}" = "list" ] && cat "$session" && exit; + +[ "${1:-}" = "config" ] && cat "$spirits" && exit; + +[ "${1:-}" = "windows" ] && wmctrl -lp && exit; + +[ "${1:-}" = "search" ] && commit | grep --ignore-case -- "$2" | head --lines=1 && exit; + +[ "${1:-}" = "start" ] && /bin/sh "$session" && exit; + +help && printf "Error: Unknown argument '%s'.\n\n" "$@" && exit 1; diff --git a/.local/bin/sfeed_fzf b/.local/bin/sfeed_fzf new file mode 100755 index 0000000..5c432b8 --- /dev/null +++ b/.local/bin/sfeed_fzf @@ -0,0 +1,24 @@ +#!/bin/sh -eu + +config=$XDG_CONFIG_HOME/sfeed/sfeedrc +unread=$XDG_CONFIG_HOME/sfeed/unread +read=$XDG_CONFIG_HOME/sfeed/read +feeds=$XDG_CONFIG_HOME/sfeed/feeds + +touch "$read" + +sfeed_update "$config" || true + +sfeed_plain_function() { + sfeed_plain "$feeds"/* | + sed 's/^[N ]\+//g' | + sort --reverse | + grep --invert-match --fixed-strings --file "$read" > "$unread" +} + +sfeed_plain_function +fzf < "$unread" \ + --multi \ + --info hidden \ + --bind "enter:execute(firefox \$(echo {} | awk '{ print \$NF }'))" \ + --bind "ctrl-d:reload(echo {} >> $read && { sfeed_plain $feeds/* | sed 's/^[N ]\+//g' | sort --reverse | grep --invert-match --fixed-strings --file $read > $unread && cat $unread; })" diff --git a/.local/bin/scripts/snipping-tool b/.local/bin/snipping-tool index 4347bfe..4347bfe 100755 --- a/.local/bin/scripts/snipping-tool +++ b/.local/bin/snipping-tool diff --git a/.local/bin/scripts/sshfs-mount b/.local/bin/sshfs-mount index 0e2352c..0e2352c 100755 --- a/.local/bin/scripts/sshfs-mount +++ b/.local/bin/sshfs-mount diff --git a/.local/bin/scripts/switch-monitor b/.local/bin/switch-monitor index 80d7191..80d7191 100755 --- a/.local/bin/scripts/switch-monitor +++ b/.local/bin/switch-monitor diff --git a/.local/bin/sx b/.local/bin/sx new file mode 100755 index 0000000..bda1ba0 --- /dev/null +++ b/.local/bin/sx @@ -0,0 +1,57 @@ +#!/bin/sh -- +# LICENCE: MIT +# https://github.com/Earnestly/sx + +stty=$(stty -g) +tty=$(tty) +tty=${tty#/dev/tty} + +cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/X11 +datadir=${XDG_CONFIG_HOME:-$HOME/.config}/X11 + +cleanup() { + if [ "$pid" ] && kill -0 "$pid" 2> /dev/null; then + kill "$pid" + wait "$pid" + xorg=$? + fi + + if ! stty "$stty"; then + stty sane + fi + + xauth remove :"$tty" + + if [ "$1" = exit ]; then + exit "${xorg:-0}" + fi +} + + +mkdir --parents -- "$cfgdir" "$datadir" +export XAUTHORITY="${XAUTHORITY:-$datadir/Xauthority}" +touch -- "$XAUTHORITY" +export XDG_SESSION_TYPE=X11 + +xauth add :"$tty" MIT-MAGIC-COOKIE-1 "$(od -An -N16 -tx /dev/urandom | tr -d ' ')" + +trap 'cleanup; trap - INT; kill -INT "$$"' INT +trap 'cleanup exit' EXIT HUP TERM QUIT + +# Xorg will check whether it inherited a USR1 with a disposition of SIG_IGN and +# use this state to reply back to the parent process with its own USR1. +# This is done to indicate that the server is ready to accept connections. +# Taking advantage of this feature allows launching the client directly from a +# USR1 signal trap which obviates the need to poll for server readiness. + +trap 'DISPLAY=:$tty exec "${@:-$cfgdir/xinitrc}" & wait "$!"' USR1 + +(trap '' USR1 && exec Xorg :"$tty" \ + -keeptty vt"$tty" \ + -noreset \ + -auth "$XAUTHORITY" \ + -configdir "$cfgdir/xorg.conf.d" \ + -logfile "$HOME/.cache/xorg.log" \ +) & pid=$! + +wait "$pid" diff --git a/.local/bin/tidy-url b/.local/bin/tidy-url new file mode 100755 index 0000000..2aa400b --- /dev/null +++ b/.local/bin/tidy-url @@ -0,0 +1,2 @@ +#!/bin/sh -eu +curl --silent "$1" | tidy -config "$HOME/.config/tidy/url.conf" diff --git a/.local/bin/vnc b/.local/bin/vnc new file mode 100755 index 0000000..1af953f --- /dev/null +++ b/.local/bin/vnc @@ -0,0 +1,30 @@ +#!/bin/sh -eu + +host="$1" +address="$host.internal" + +. "$HOME/.vnc/keys/macs" + +[ "$host" = 'hound' ] && wol "$hound"; +[ "$host" = 'tiger' ] && wol "$tiger"; + +notify-send -t 2000 Connecting...; + +i=0; +until ping -c1 "$address" > /dev/null 2>&1; +do notify-send -t 2000 'Waiting for response...'; + i=$((i+1)); [ "$i" -gt 5 ] && notify-send -u critical 'Unable to negotiate connection.' && exit; +done; + +notify-send -t 4000 Connected.; + +vncviewer -passwd "$HOME/.vnc/keys/passwd-$host" \ + AlertOnFatalError=0 \ + AutoSelect=0 \ + CompressLevel=0 \ + DotWhenNoCursor=1 \ + Fullscreen=1 \ + PreferredEncoding=Hextile \ + QualityLevel=6 \ + Shared=1 \ + "$address:5901"; diff --git a/.local/bin/scripts/vnc-exit b/.local/bin/vnc-exit index afc4833..afc4833 100755 --- a/.local/bin/scripts/vnc-exit +++ b/.local/bin/vnc-exit diff --git a/.local/bin/scripts/vnc-suspend b/.local/bin/vnc-suspend index 589a7f2..589a7f2 100755 --- a/.local/bin/scripts/vnc-suspend +++ b/.local/bin/vnc-suspend diff --git a/.local/bin/volume-control b/.local/bin/volume-control new file mode 100755 index 0000000..95454a3 --- /dev/null +++ b/.local/bin/volume-control @@ -0,0 +1,4 @@ +#!/bin/sh -eu +[ "$1" = "up" ] && amixer set Master 1%+ +[ "$1" = "down" ] && amixer set Master 1%- +[ "$1" = "mute" ] && amixer sset Master toggle diff --git a/.local/bin/scripts/window-overview b/.local/bin/window-overview index 62b50d9..62b50d9 100755 --- a/.local/bin/scripts/window-overview +++ b/.local/bin/window-overview diff --git a/.local/bin/window-switcher b/.local/bin/window-switcher new file mode 100755 index 0000000..a184baa --- /dev/null +++ b/.local/bin/window-switcher @@ -0,0 +1,23 @@ +#!/bin/sh -u +# https://git.suckless.org/sites/file/tools.suckless.org/dmenu/scripts/switch.html + +windows=$(wmctrl -xl | + tr --squeeze-repeats '[:blank:]' | + tr '[:upper:]' '[:lower:]' | + cut --delimiter ' ' --fields 3-3,5- | + sed 's/^[a-zA-Z0-9-]*\.//' | + sort | + uniq) + +windows=$(printf "%s" "$windows" | + awk --assign list="$windows" \ + '{cur=length($1); printf $1; for(i=0; i < list - cur + 1; i++) printf " "; $1 = ""; printf "%s\n", $0}' 2> /dev/null) + +selection=$( + printf "%s" "$windows" | dmenu -nhf '#cf71e0' -sf '#cf71e0' -f -i -b -p ⠀:::⠀windows⠀::: + [ "$?" = 127 ] && kill -15 "$$" && "$0" +) + +target=$(printf "%s" "$selection" | tr --squeeze-repeats '[:blank:]' | cut --delimiter ' ' --fields 2-) + +[ -n "$target" ] && wmctrl -a "$target" diff --git a/.local/bin/scripts/workout-notify b/.local/bin/workout-notify index 6934a45..6934a45 100755 --- a/.local/bin/scripts/workout-notify +++ b/.local/bin/workout-notify diff --git a/.local/bin/wrappers/adb b/.local/bin/wrappers/adb new file mode 100755 index 0000000..cfe91cf --- /dev/null +++ b/.local/bin/wrappers/adb @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which adb --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/aegisub b/.local/bin/wrappers/aegisub new file mode 100755 index 0000000..9ade37a --- /dev/null +++ b/.local/bin/wrappers/aegisub @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which aegisub --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/aspell b/.local/bin/wrappers/aspell new file mode 100755 index 0000000..78fddd0 --- /dev/null +++ b/.local/bin/wrappers/aspell @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which aspell --all | grep --invert-match "local/bin" | head -n 1) --conf "$HOME/.config/aspell/aspell.conf" "$@"; diff --git a/.local/bin/scripts/clipboard b/.local/bin/wrappers/audacity index e776c70..fead7fd 100755 --- a/.local/bin/scripts/clipboard +++ b/.local/bin/wrappers/audacity @@ -1,2 +1,2 @@ #!/bin/sh -eu -copyq toggle; +tenacity "$@" diff --git a/.local/bin/wrappers/chromium b/.local/bin/wrappers/chromium new file mode 100755 index 0000000..d0e9a9f --- /dev/null +++ b/.local/bin/wrappers/chromium @@ -0,0 +1,13 @@ +#!/bin/sh -eu + +$(which chromium --all | grep --invert-match "local/bin" | head -n 1) \ + --disable-smooth-scrolling \ + --disable-sync-preferences \ + --process-per-site \ + "$@"; + +# --incognito +# --disable-gpu-compositing +# --disk-cache-dir=/dev/null +# --enable-native-gpu-memory-buffers +# --proxy-server="socks5://localhost:2871" diff --git a/.local/bin/wrappers/claws-mail b/.local/bin/wrappers/claws-mail new file mode 100755 index 0000000..b19aa55 --- /dev/null +++ b/.local/bin/wrappers/claws-mail @@ -0,0 +1,3 @@ +#!/bin/sh -eu +$(which claws-mail --all | grep --invert-match "local/bin" | head -n 1) \ + --alternate-config-dir "${XDG_CONFIG_HOME:-~/.config}"/claws-mail "$@"; diff --git a/.local/bin/wrappers/codium b/.local/bin/wrappers/codium new file mode 100755 index 0000000..87e93e5 --- /dev/null +++ b/.local/bin/wrappers/codium @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which codium --all | grep --invert-match "local/bin" | head -n 1) --extensions-dir "$XDG_DATA_HOME/codium" "$@" diff --git a/.local/bin/wrappers/eslint b/.local/bin/wrappers/eslint new file mode 100755 index 0000000..a122f62 --- /dev/null +++ b/.local/bin/wrappers/eslint @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which eslint --all | grep --invert-match "local/bin" | head -n 1) --no-ignore --config "$HOME/.config/eslint/config.yaml" "$@"; diff --git a/.local/bin/wrappers/firefox b/.local/bin/wrappers/firefox new file mode 100755 index 0000000..ab8c72e --- /dev/null +++ b/.local/bin/wrappers/firefox @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which firefox --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/ghci b/.local/bin/wrappers/ghci new file mode 100755 index 0000000..75f3577 --- /dev/null +++ b/.local/bin/wrappers/ghci @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which ghci --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/gnaural b/.local/bin/wrappers/gnaural new file mode 100755 index 0000000..cb63d08 --- /dev/null +++ b/.local/bin/wrappers/gnaural @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which gnaural --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/google-chrome-stable b/.local/bin/wrappers/google-chrome-stable new file mode 100755 index 0000000..b9c406f --- /dev/null +++ b/.local/bin/wrappers/google-chrome-stable @@ -0,0 +1,13 @@ +#!/bin/sh -eu + +$(which google-chrome-stable --all | grep --invert-match "local/bin" | head -n 1) \ + --disable-smooth-scrolling \ + --disable-sync-preferences \ + --process-per-site \ + "$@"; + +# --incognito +# --disable-gpu-compositing +# --disk-cache-dir=/dev/null +# --enable-native-gpu-memory-buffers +# --proxy-server="socks5://localhost:2871" diff --git a/.local/bin/wrappers/gore b/.local/bin/wrappers/gore new file mode 100755 index 0000000..af19cab --- /dev/null +++ b/.local/bin/wrappers/gore @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which gore --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/guile b/.local/bin/wrappers/guile new file mode 100755 index 0000000..1a5b4d8 --- /dev/null +++ b/.local/bin/wrappers/guile @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which guile --all | grep --invert-match "local/bin" | head --lines 1) "$@"; diff --git a/.local/bin/wrappers/latexindent b/.local/bin/wrappers/latexindent new file mode 100755 index 0000000..44e7459 --- /dev/null +++ b/.local/bin/wrappers/latexindent @@ -0,0 +1,8 @@ +#!/bin/sh -eu +$(which latexindent --all | grep --invert-match "local/bin" | head -n 1) \ + --modifylinebreaks \ + --overwrite \ + --silent \ + --cruft=/tmp \ + --local="$HOME/.config/latexindent/settings.yaml" \ + "$@"; diff --git a/.local/bin/wrappers/mix b/.local/bin/wrappers/mix new file mode 100755 index 0000000..c687a2d --- /dev/null +++ b/.local/bin/wrappers/mix @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which mix --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/mplayer b/.local/bin/wrappers/mplayer new file mode 100755 index 0000000..8554a81 --- /dev/null +++ b/.local/bin/wrappers/mplayer @@ -0,0 +1,3 @@ +#!/bin/sh -eu +export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer" +$(which mplayer --all | grep --invert-match "local/bin" | head -n 1) "$@" diff --git a/.local/bin/wrappers/nix-index b/.local/bin/wrappers/nix-index new file mode 100755 index 0000000..96c3990 --- /dev/null +++ b/.local/bin/wrappers/nix-index @@ -0,0 +1,16 @@ +#!/bin/sh -eu + +# https://github.com/nix-community/nix-index-database?tab=readme-ov-file#ad-hoc-download + +Update() { + directory=~/.local/share/nix-index + file="index-$(uname -m | sed 's/^arm64$/aarch64/')-$(uname | tr '[:lower:]' '[:upper:]')" + mkdir --parents $directory && cd $directory + wget --quiet --timestamping "https://github.com/Mic92/nix-index-database/releases/latest/download/$file" + printf "\nUpdating database %s\n\n" "$file" + ln --symbolic --force "$file" files +} + +Update + +$(which nix-index --all | grep --invert-match "local/bin" | head --lines 1) "$@" diff --git a/.local/bin/wrappers/palemoon b/.local/bin/wrappers/palemoon new file mode 100755 index 0000000..caef463 --- /dev/null +++ b/.local/bin/wrappers/palemoon @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which palemoon --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/prettier b/.local/bin/wrappers/prettier new file mode 100755 index 0000000..94fd412 --- /dev/null +++ b/.local/bin/wrappers/prettier @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which prettier --all | grep --invert-match "local/bin" | head -n 1) --config "$HOME/.config/prettier/config.yaml" "$@"; diff --git a/.local/bin/wrappers/sbcl b/.local/bin/wrappers/sbcl new file mode 100755 index 0000000..b5ba6ea --- /dev/null +++ b/.local/bin/wrappers/sbcl @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which sbcl --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/scribus b/.local/bin/wrappers/scribus new file mode 100755 index 0000000..c77ac6b --- /dev/null +++ b/.local/bin/wrappers/scribus @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which scribus --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/stalonetray b/.local/bin/wrappers/stalonetray new file mode 100755 index 0000000..bcdf87c --- /dev/null +++ b/.local/bin/wrappers/stalonetray @@ -0,0 +1,6 @@ +#!/bin/sh -eu +$(which stalonetray --all | grep --invert-match "local/bin" | head -n 1) \ + --background '#000000' \ + --window-type normal \ + --window-strut none \ + "$@"; diff --git a/.local/bin/wrappers/stylelint b/.local/bin/wrappers/stylelint new file mode 100755 index 0000000..d0efb27 --- /dev/null +++ b/.local/bin/wrappers/stylelint @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which stylelint --all | grep --invert-match "local/bin" | head -n 1) --config "$HOME/.config/stylelint/config.js" "$@"; diff --git a/.local/bin/wrappers/svn b/.local/bin/wrappers/svn new file mode 100755 index 0000000..77fdbdb --- /dev/null +++ b/.local/bin/wrappers/svn @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which svn --all | grep --invert-match "local/bin" | head -n 1) --config-dir "$XDG_CONFIG_HOME"/subversion "$@"; diff --git a/.local/bin/wrappers/swc b/.local/bin/wrappers/swc new file mode 100755 index 0000000..c352781 --- /dev/null +++ b/.local/bin/wrappers/swc @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which swc --all | grep --invert-match "local/bin" | head --lines 1) "$@" --config-file "$HOME/.config/swc/swc.json" diff --git a/.local/bin/wrappers/tiemu b/.local/bin/wrappers/tiemu new file mode 100755 index 0000000..310f7dc --- /dev/null +++ b/.local/bin/wrappers/tiemu @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which tiemu --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/tilp b/.local/bin/wrappers/tilp new file mode 100755 index 0000000..4f07917 --- /dev/null +++ b/.local/bin/wrappers/tilp @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which tilp --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/treesheets b/.local/bin/wrappers/treesheets new file mode 100755 index 0000000..956277b --- /dev/null +++ b/.local/bin/wrappers/treesheets @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which treesheets --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/vale b/.local/bin/wrappers/vale index fb86fde..f5863f2 100755 --- a/.local/bin/vale +++ b/.local/bin/wrappers/vale @@ -13,4 +13,4 @@ if [ "${1:-}" = "--update" ]; then exit; fi -$(which vale --all | grep -v "local/bin" | head -n 1) --config "$directory/vale.ini" "$@"; +$(which vale --all | grep --invert-match "local/bin" | head -n 1) --config "$directory/vale.ini" "$@"; diff --git a/.local/bin/wrappers/w3m b/.local/bin/wrappers/w3m new file mode 100755 index 0000000..f2c62b4 --- /dev/null +++ b/.local/bin/wrappers/w3m @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which w3m --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/wget b/.local/bin/wrappers/wget new file mode 100755 index 0000000..9f06fce --- /dev/null +++ b/.local/bin/wrappers/wget @@ -0,0 +1,2 @@ +#!/bin/sh -eu +$(which wget --all | grep --invert-match "local/bin" | head -n 1) --hsts-file "$HOME/.cache/wget.history" "$@"; diff --git a/.local/bin/wrappers/xournalpp b/.local/bin/wrappers/xournalpp new file mode 100755 index 0000000..3601bbf --- /dev/null +++ b/.local/bin/wrappers/xournalpp @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which xournalpp --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/wrappers/xsane b/.local/bin/wrappers/xsane new file mode 100755 index 0000000..2edfe09 --- /dev/null +++ b/.local/bin/wrappers/xsane @@ -0,0 +1,2 @@ +#!/bin/sh -eu +HOME=$HOME/.config && $(which xsane --all | grep --invert-match "local/bin" | head -n 1) "$@"; diff --git a/.local/bin/xdg-open b/.local/bin/xdg-open index 5278183..cdb4269 100755 --- a/.local/bin/xdg-open +++ b/.local/bin/xdg-open @@ -1,2 +1,4 @@ -#!/bin/sh -mimeo --term "urxvt -e %s" --deprecated "$@"; +#!/bin/sh -eu + +term="$TERMINAL -e %s" +mimeo --term "$term" --deprecated "$@" diff --git a/.local/bin/xrandr-scale b/.local/bin/xrandr-scale index f5d3c2e..bdb92bd 100755 --- a/.local/bin/xrandr-scale +++ b/.local/bin/xrandr-scale @@ -1,2 +1,3 @@ -#!/bin/sh +#!/bin/sh -eu +# TODO: Output can change default $1 to first known monitor. xrandr --output "$1" --scale "$2"x"$2" diff --git a/.local/share/applications/archive.desktop b/.local/share/applications/archive.desktop new file mode 100644 index 0000000..45a3a9a --- /dev/null +++ b/.local/share/applications/archive.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Archive Extractor +Exec=sh -c "atool --subdir --extract %F || cat" +Terminal=true +NoDisplay=true +Type=Application diff --git a/.local/share/applications/binary.desktop b/.local/share/applications/binary.desktop new file mode 100644 index 0000000..c8b851b --- /dev/null +++ b/.local/share/applications/binary.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Binary Viewer +Exec=hexmime %F +Terminal=true +NoDisplay=true +Type=Application diff --git a/.local/share/applications/blender.desktop b/.local/share/applications/blender.desktop new file mode 100644 index 0000000..39a28b4 --- /dev/null +++ b/.local/share/applications/blender.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Blender +Type=Application +Exec=blender %F +Terminal=false +NoDisplay=true diff --git a/.local/share/applications/browser.desktop b/.local/share/applications/browser.desktop new file mode 100644 index 0000000..b8d24fa --- /dev/null +++ b/.local/share/applications/browser.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Internet Browser +Exec=browser %U +Terminal=false +NoDisplay=true +Type=Application diff --git a/.local/share/applications/defaults.list b/.local/share/applications/defaults.list new file mode 120000 index 0000000..26be7e8 --- /dev/null +++ b/.local/share/applications/defaults.list @@ -0,0 +1 @@ +../../../.config/mimeapps.list
\ No newline at end of file diff --git a/.local/share/applications/file-manager.desktop b/.local/share/applications/inode.desktop index a62c0f4..a62c0f4 100644 --- a/.local/share/applications/file-manager.desktop +++ b/.local/share/applications/inode.desktop diff --git a/.local/share/applications/email.desktop b/.local/share/applications/message.desktop index 07667ef..f57b0dc 100644 --- a/.local/share/applications/email.desktop +++ b/.local/share/applications/message.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Mail Client Type=Application -Exec=thunderbird %U +Exec=claws-mail --compose %U Terminal=false NoDisplay=true diff --git a/.local/share/applications/mimeapps.list b/.local/share/applications/mimeapps.list new file mode 120000 index 0000000..26be7e8 --- /dev/null +++ b/.local/share/applications/mimeapps.list @@ -0,0 +1 @@ +../../../.config/mimeapps.list
\ No newline at end of file diff --git a/.local/share/applications/libreoffice.desktop b/.local/share/applications/office.desktop index ce6fa00..ce6fa00 100644 --- a/.local/share/applications/libreoffice.desktop +++ b/.local/share/applications/office.desktop diff --git a/.local/share/applications/editor.desktop b/.local/share/applications/text.desktop index eff7464..ce8a2b1 100644 --- a/.local/share/applications/editor.desktop +++ b/.local/share/applications/text.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Name=Editor +Name=Text Viewer Type=Application Exec=vim %U Terminal=true diff --git a/.local/share/applications/video.desktop b/.local/share/applications/video.desktop index 06ba60a..da28a63 100644 --- a/.local/share/applications/video.desktop +++ b/.local/share/applications/video.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Video Player Type=Application -Exec=mplayer-wrapper %F +Exec=mplayer %F Terminal=false NoDisplay=true diff --git a/.local/share/fonts/charter/LICENSE b/.local/share/fonts/charter/LICENSE new file mode 100644 index 0000000..148919d --- /dev/null +++ b/.local/share/fonts/charter/LICENSE @@ -0,0 +1,3 @@ +This is a copy of the Charter fonts which Bitstream contributed to the X consortium. This is the original notice included with the fonts: + +(c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA. You are hereby granted permission under all Bitstream propriety rights to use, copy, modify, sublicense, sell, and redistribute the 4 Bitstream Charter (r) Type 1 outline fonts and the 4 Courier Type 1 outline fonts for any purpose and without restriction; provided, that this notice is left intact on all copies of such fonts and that Bitstream's trademark is acknowledged as shown below on all unmodified copies of the 4 Charter Type 1 fonts. BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
\ No newline at end of file diff --git a/.local/share/fonts/charter/Charter Bold Italic.ttf b/.local/share/fonts/charter/charter-bold-italic.ttf Binary files differindex 8bf2421..8bf2421 100644 --- a/.local/share/fonts/charter/Charter Bold Italic.ttf +++ b/.local/share/fonts/charter/charter-bold-italic.ttf diff --git a/.local/share/fonts/charter/Charter Bold.ttf b/.local/share/fonts/charter/charter-bold.ttf Binary files differindex c8f7e85..c8f7e85 100644 --- a/.local/share/fonts/charter/Charter Bold.ttf +++ b/.local/share/fonts/charter/charter-bold.ttf diff --git a/.local/share/fonts/charter/Charter Italic.ttf b/.local/share/fonts/charter/charter-italic.ttf Binary files differindex a650121..a650121 100644 --- a/.local/share/fonts/charter/Charter Italic.ttf +++ b/.local/share/fonts/charter/charter-italic.ttf diff --git a/.local/share/fonts/charter/Charter Regular.ttf b/.local/share/fonts/charter/charter-regular.ttf Binary files differindex 33c6d7c..33c6d7c 100644 --- a/.local/share/fonts/charter/Charter Regular.ttf +++ b/.local/share/fonts/charter/charter-regular.ttf diff --git a/.local/share/fonts/et-book/LICENSE b/.local/share/fonts/et-book/LICENSE new file mode 100644 index 0000000..16d0a33 --- /dev/null +++ b/.local/share/fonts/et-book/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Dave Liepmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/.local/share/fonts/et-book/et-book-bold-line-figures.ttf b/.local/share/fonts/et-book/et-book-bold-line-figures.ttf Binary files differnew file mode 100755 index 0000000..9798360 --- /dev/null +++ b/.local/share/fonts/et-book/et-book-bold-line-figures.ttf diff --git a/.local/share/fonts/et-book/et-book-display-italic-old-style-figures.ttf b/.local/share/fonts/et-book/et-book-display-italic-old-style-figures.ttf Binary files differnew file mode 100755 index 0000000..9da91de --- /dev/null +++ b/.local/share/fonts/et-book/et-book-display-italic-old-style-figures.ttf diff --git a/.local/share/fonts/et-book/et-book-roman-line-figures.ttf b/.local/share/fonts/et-book/et-book-roman-line-figures.ttf Binary files differnew file mode 100755 index 0000000..daceffb --- /dev/null +++ b/.local/share/fonts/et-book/et-book-roman-line-figures.ttf diff --git a/.local/share/fonts/et-book/et-book-roman-old-style-figures.ttf b/.local/share/fonts/et-book/et-book-roman-old-style-figures.ttf Binary files differnew file mode 100755 index 0000000..5ae5198 --- /dev/null +++ b/.local/share/fonts/et-book/et-book-roman-old-style-figures.ttf diff --git a/.local/share/fonts/et-book/et-book-semi-bold-old-style-figures.ttf b/.local/share/fonts/et-book/et-book-semi-bold-old-style-figures.ttf Binary files differnew file mode 100755 index 0000000..725af42 --- /dev/null +++ b/.local/share/fonts/et-book/et-book-semi-bold-old-style-figures.ttf diff --git a/.local/share/fonts/old-london/Olondon_.otf b/.local/share/fonts/old-london/Olondon_.otf Binary files differdeleted file mode 100644 index 9a68b20..0000000 --- a/.local/share/fonts/old-london/Olondon_.otf +++ /dev/null diff --git a/.local/share/fonts/old-london/Olondona.otf b/.local/share/fonts/old-london/Olondona.otf Binary files differdeleted file mode 100644 index 56161c8..0000000 --- a/.local/share/fonts/old-london/Olondona.otf +++ /dev/null diff --git a/.local/share/fonts/old-london/OldLondonAlternate.ttf b/.local/share/fonts/old-london/old-london-alternate.ttf Binary files differindex 6010ffd..6010ffd 100644 --- a/.local/share/fonts/old-london/OldLondonAlternate.ttf +++ b/.local/share/fonts/old-london/old-london-alternate.ttf diff --git a/.local/share/fonts/old-london/OldLondon.ttf b/.local/share/fonts/old-london/old-london.ttf Binary files differindex f24a340..f24a340 100644 --- a/.local/share/fonts/old-london/OldLondon.ttf +++ b/.local/share/fonts/old-london/old-london.ttf diff --git a/.local/share/plank/themes/Basic/dock.theme b/.local/share/plank/themes/Basic/dock.theme new file mode 100644 index 0000000..476e566 --- /dev/null +++ b/.local/share/plank/themes/Basic/dock.theme @@ -0,0 +1,33 @@ +[PlankTheme] +BottomRoundness=5 +FillEndColor=46;;52;;58;;200 +FillStartColor=46;;52;;58;;200 +InnerStrokeColor=50;;50;;50;;100 +LineWidth=1 +OuterStrokeColor=25;;25;;25;;100 +TopRoundness=5 + +[PlankDockTheme] +ActiveTime=0 +BadgeColor=0;;0;;0;;0 +BottomPadding=2.0 +CascadeHide=true +ClickTime=0 +FadeOpacity=0 +FadeTime=0 +GlowPulseTime=0 +GlowSize=0 +GlowTime=0 +HideTime=0 +HorizPadding=2.0 +IconShadowSize=0.5 +IndicatorSize=5 +ItemMoveTime=0 +ItemPadding=1.5 +LaunchBounceHeight=0.9 +LaunchBounceTime=500 +SlideTime=0 +TopPadding=2.0 +UrgentBounceHeight=1 +UrgentBounceTime=0 +UrgentHueShift=180 diff --git a/.local/share/ssh/ansible.pub b/.local/share/ssh/ansible.pub new file mode 100644 index 0000000..f868197 --- /dev/null +++ b/.local/share/ssh/ansible.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF6FlqeC59LLEfojMiuFfD631dB9ELrlaJ+mo4kLcGsS ansible diff --git a/.local/share/ssh/identity.pub b/.local/share/ssh/identity.pub new file mode 100644 index 0000000..2a077f5 --- /dev/null +++ b/.local/share/ssh/identity.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOBX/OFekH6rPVUXc9mCcQwLYbgmdCzi9ebr8P2d1+3h86DMoqOh9h8hbRk0pxiXzrrAZNvPK5LUUms37Gc76UsOlU0W3YGpkDeoFaXcT0mAiFaQnUA8EmIPphPN4r6RJ67IA8/vjn0bXwO3nR27SDlldg9rP+IhTOV/nU350jhaQHcL1HBMMj4VR+fOrz/uPkwUlAtE9/6q/k1d1M3reQGtoY5JCcJz/Vvm1x2dXOeVfSl/DlFHyTWsky4VZYkC111o8D5bMJ/9r+FhjQwPZGzSMZPB3lC1U2JC15tsgjcSGvP0//9BWJiLcwm+WUZOs2G7SjXCZU+4RB+WYxi22P identity diff --git a/.local/share/ssh/legacy-link.pub b/.local/share/ssh/legacy-link.pub new file mode 100644 index 0000000..439b806 --- /dev/null +++ b/.local/share/ssh/legacy-link.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY+eC8MSDNeXDpz9Kif68tSgRopd0FukSWpDg5mAg1JRprHRRLapUHduB7o3vpbmoSuSJnsgrqpLOwkJl8UtrMXb5eZxH53LX1nIplYAo4TTzSsKqEGs9EsfrD/FES9KlHkQp5Mk7Oo55l352LkgDj3zGGbkc7ExlBNTnYZEYfnuj4S02i/2YR2LXTypJRFkRCfBSx6QLLVijYX8cv4cZ9G/3fgN9TZGXmTN9vsDG5uczfaI0ip2aVCVh4/JvKHfdbiT+QixHzcZBE+P8Li28Ae1vn0cNkAFhfZ8V0lbvXiPxUZz9SNm+/jQf11XsreaLYm49zLnOHw/6DFgxD+sQL link-legacy diff --git a/.local/share/ssh/link.pub b/.local/share/ssh/link.pub new file mode 100644 index 0000000..5e01350 --- /dev/null +++ b/.local/share/ssh/link.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILQxVjdY5vS0gcNjhGqrElwI+q199qpxlwC1VWCvxhTX link diff --git a/.local/share/ssh/mobile.pub b/.local/share/ssh/mobile.pub new file mode 100644 index 0000000..b16211b --- /dev/null +++ b/.local/share/ssh/mobile.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8aD3uJ937DKFXN1BYDAezG2umwj4k6PoaC9gEgHONKGFugpzLKLJ0e2ql4BIxweRTdW4BHvC0NE4lesdv7j9rs5F05h+OXuR+CT6cmNgIpg5oks172Fno7nKtXILdLsLBA26K+o7yemrNIUpq5MNLjy4+q1t8PmgTvHPwZtPBpz35RzVXdM5TP5jR0aZ+agpQaMo2A0c+BaxDlDHCPnF4727FXLJ0uzQ84c86LEtaJ+4zPEGnPuBdQCo9r7v6zar8u3yCYkrUrJQu7svqPlDvdI6fGagoywzQDKZ9Rid+DPx4YWyybnOTJ5R0SlSKB563djne/IV5bQziDKjC2obN mobile diff --git a/.local/share/ssh/nix-builder.pub b/.local/share/ssh/nix-builder.pub new file mode 100644 index 0000000..5d571c1 --- /dev/null +++ b/.local/share/ssh/nix-builder.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGwALObFS2YjqttSPbwCPfPZVr42LGBeuJ2oaXDa8oFC nix-builder diff --git a/.local/share/ssh/primary.pub b/.local/share/ssh/primary.pub new file mode 100644 index 0000000..fab0b36 --- /dev/null +++ b/.local/share/ssh/primary.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBACChudA6phuLab1paXiYv3KJeenIptKIZuT3tqe5CGZDKLBuxzNsJAoNND8p9C6YAx2v1RynYJYfHxuatxBsNJnSQAP60dsxgJnZpso+UeA1bLO8sZIp2IvlCehXOaDuR8PEoB+ZgKy7J0vyHjzU42a1CE1wxNVAwwqnGKmvISf1z9eJQ== primary diff --git a/.local/share/ssh/secondary.pub b/.local/share/ssh/secondary.pub new file mode 100644 index 0000000..6f46413 --- /dev/null +++ b/.local/share/ssh/secondary.pub @@ -0,0 +1 @@ +ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAANRhYdpiYUak1fL5sSFryEMy1tudoShGmv/RcRDFgHhKvVHwNCxj3kaGT9sft490ce/raHShIiJJVWOSYihgPqQgEtBA6SiHKZM6GrB8Papg++XJrIzc9MyFky2BeV+YJIAM7lDaOHzGb77R7O+cWsdddBW0sucSjB2kMHIy6AXyWOQA== secondary diff --git a/.local/share/tex/iexec.sty b/.local/share/tex/iexec.sty new file mode 100644 index 0000000..6c7fd5d --- /dev/null +++ b/.local/share/tex/iexec.sty @@ -0,0 +1,49 @@ +% (The MIT License) +% https://github.com/yegor256/iexec +% Copyright (c) 2021 Yegor Bugayenko +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the 'Software'), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{iexec}[00.00.0000 0.0.0 Inputable Shell Executions] + +\RequirePackage{shellesc} + +\RequirePackage{xkeyval} +\newif\iftrace +\DeclareOptionX{trace}{\tracetrue} +\ProcessOptionsX\relax + +\newcommand\iexec[2][iexec.tmp]{% + \ifnum\pdfshellescape=1\else + \PackageError{iexec}{You must run latex with --shell-escape option}{} + \fi + \begingroup% + \let\%\@percentchar% + \let\\\@backslashchar% + \let\{\@charlb% + \let\}\@charrb% + \ShellEscape{#2 > #1}% + \message{iexec executed shell command: [#2 > #1]}% + \endgroup% + \input{#1}% + \iftrace\else\ShellEscape{rm #1}\fi% +} + +\endinput diff --git a/.local/share/themes/Preless/gtk-2.0/gtkrc b/.local/share/themes/Preless/gtk-2.0/gtkrc new file mode 100644 index 0000000..63ac40c --- /dev/null +++ b/.local/share/themes/Preless/gtk-2.0/gtkrc @@ -0,0 +1,8 @@ +gtk-color-scheme = "bg_color: #f2f1f0;" +gtk-color-scheme = "fg_color: #4c4c4c;" +gtk-color-scheme = "base_color: #ffffff;" +gtk-color-scheme = "text_color: #3C3C3C;" +gtk-color-scheme = "selected_bg_color: #f07746;" +gtk-color-scheme = "selected_fg_color: #ffffff;" +gtk-color-scheme = "tooltip_bg_color: #000000;" +gtk-color-scheme = "tooltip_fg_color: #ffffff;" diff --git a/.local/share/themes/Preless/gtk-3.0/gtk.css b/.local/share/themes/Preless/gtk-3.0/gtk.css new file mode 100644 index 0000000..3e23a63 --- /dev/null +++ b/.local/share/themes/Preless/gtk-3.0/gtk.css @@ -0,0 +1,570 @@ +@define-color fg_color #000000; +@define-color bg_color #f5f5f5; +@define-color link_fg_color #1a0dab; +@define-color link_bg_color #fafafa; +@define-color text_fg_color #3C3C3C; +@define-color text_bg_color #ffffff; +@define-color selected_fg_color #000000; +@define-color selected_bg_color #b1dbff; +@define-color active_fg_color #ffffff; +@define-color active_bg_color #222222; +@define-color danger_fg_color #222222; +@define-color danger_bg_color #ff8a8a; +@define-color disabled_fg_color #999999; +@define-color disabled_bg_color rgba(0,0,0,0.05); +@define-color hover_fg_color #000000; +@define-color hover_bg_color rgba(0,0,0,0.1); +@define-color tooltip_fg_color #ffffff; +@define-color tooltip_bg_color #000000; +@define-color scrollbar_fg_color #000000; +@define-color scrollbar_bg_color #dddddd; + +* { + all: unset; +} + +* { + color: @fg_color; + border-radius: 0.5em; + background-color: @bg_color; +} + +window, +dialog, +headerbar, +treeview *, +.popup menu * { + border-radius: unset; +} + +row, +tab, +tab *, +list, +entry, +button, +button *, +iconview, +calendar, +treeview, +textview *, +viewport *, +scrolledwindow, +scrolledwindow * { + background-color: @text_bg_color; +} + +*:hover, +*:hover *, +*:hover:checked, +*:hover:checked { + color: @hover_fg_color; + background-color: @hover_bg_color; +} + +row:hover *, +tab:hover *, +title:hover *, +button:hover *, +scale:hover value, +modelbutton:hover *, +menuitem:hover label, +radiobutton:hover label, +checkbutton:hover label { + background-color: transparent; +} + +.popup menu menuitem:hover { + background-color: @scrollbar_bg_color; +} + +separator:hover { + background-color: @selected_bg_color; +} + +*:active, +*:active * { + color: @selected_fg_color; + background-color: @selected_bg_color; +} + +scrollbar.vertical slider:hover, +scrollbar.horizontal slider:hover, +scrollbar.vertical slider:active, +scrollbar.horizontal slider:active { + background: #4c5e6e; +} + +*:disabled, +*:disabled *, +*:disabled:checked, +*:disabled:checked * { + color: @disabled_fg_color; + background-color: @disabled_bg_color; +} + +box:disabled, +arrow:disabled, +image:disabled, +label:disabled, +scale:disabled, +spinner:disabled, +cellview:disabled, +spinbutton:disabled, +modelbutton:disabled, +checkbutton:disabled, +radiobutton:disabled, +checkbutton:disabled:checked, +radiobutton:disabled:checked, +button:disabled:checked label, +checkbutton:disabled:checked label { + background-color: transparent; +} + +*:focus, +*:focus * { + outline-offset: -3px; + outline: 3px @fg_color dotted; + -gtk-outline-radius: 0.5em; +} + +entry:focus { + border: 1px @fg_color solid; + box-shadow: 0 0 0 3px @selected_bg_color; +} + +trough:focus { + outline: unset; +} + +*:selected, +*:selected *, +*:selected:focus, +*:selected:focus * { + color: @selected_fg_color; + background-color: @selected_bg_color; +} + +row:selected, +row:selected *, +row:selected:focus * { + border-radius: unset; +} + +*:checked, +*:checked * { + color: @selected_fg_color; + background-color: @selected_bg_color; +} + +tab:checked *, +button:checked *, +checkbutton:checked, +radiobutton:checked, +checkbutton:checked label, +radiobutton:checked label { + background-color: transparent; +} + +tooltip, +tooltip * { + color: @tooltip_fg_color; + background: @tooltip_bg_color; +} + +overlay, +row grid, +row label, +overshoot, +treeview *, +undershoot, +row grid label, +.popup menu menuitem * { + background-color: transparent; +} + +title, +spinner, +expander, +modelbutton, +frame.app-notification { + padding: 0.5em; +} + +popover, +header tab, +toolbar.osd, +placessidebar, +paned scrolledwindow, +dialog scrolledwindow, +frame.app-notification, +window > grid > frame border { + border: 0.5px @fg_color solid; +} + +arrow, +arrow.right { + padding: 8px; + background-size: 1.5em; + background-position: center; + background-repeat: no-repeat; +} + +menuitem arrow { + background-image: url("../icons/arrow-down.svg"); +} + +menuitem arrow.right { + background-image: url("../icons/arrow-right.svg"); +} + +combobox box.horizontal arrow { + background-image: url("../icons/selector.svg"); +} + +widget.path-bar button { + margin-left: 4px; +} + +selection { + color: @selected_fg_color; + background: @selected_bg_color; +} + +textview { + padding: 4px 6px; +} + +viewport label { + padding: 6px 12px; +} + +viewport list row { + padding: 2px 10px; +} + +switch { + padding: 4px; + border: 1px @fg_color solid; +} + +switch slider { + background: @text_bg_color; + border: 1px @fg_color solid; +} + +separator.horizontal { + border-bottom: 1px @disabled_fg_color solid; +} + +separator.vertical { + border-right: 1px @disabled_fg_color solid; +} + +expander { + padding: 0; +} + +headerbar { + padding: 6px; + border-bottom: 0.5px @disabled_fg_color solid; +} + +calendar, +viewport widget list { + border: 1px @fg_color solid; +} + +actionbar { + padding: 4px; +} + +toolbar { + padding: 4px; +} + +toolbar toolbutton button { + margin: 4px; + padding: 2px; +} + +toolbar.inline-toolbar { + padding: 4px; + margin-top: 4px; + border: 1px @fg_color solid; +} + +stackswitcher button { + margin-right: 4px; +} + +paned label { + padding: 4px; +} + +button { + margin: 2px; + border: 1px @fg_color solid; + padding: 4px 6px; +} + +label link, +button.link label { + color: @link_fg_color; + text-decoration: underline; +} + +button.destructive-action, +button.destructive-action * { + background: @danger_bg_color; +} + +.border-inset border { + border-left: 1px @fg_color inset; + border-top: 1px @fg_color inset; +} + +.border-outset border { + border-right: 1px @fg_color outset; + border-bottom: 1px @fg_color outset; +} + +header tab { + margin: 4px; +} + +header tab label { + padding: 4px 8px; +} + +header.top tab label { + margin-right: 4px; +} + +header.bottom tab label { + border-top: 1px transparent solid; + margin-right: 4px; +} + +header.right tab label { + border-left: 1px transparent solid; + margin-bottom: 4px; +} + +header.left tab label { + border-right: 1px transparent solid; + margin-bottom: 4px; +} + +header.top tab label { + border-bottom: 1px transparent solid; +} + +treeview { + padding: 4px 8px; +} + +treeview header button { + margin: 0; + border: none; + border-radius: unset; + border-right: 1px @fg_color solid; + border-bottom: 1px @fg_color solid; +} + +treeview header button:last-child { + border-right: none; +} + +row box colorswatch { + border: 2px solid transparent; +} + +row:selected box colorswatch { + border: 2px solid @selected_fg_color; +} + +frame widget box > button:last-child { + margin-left: 4px; +} + +checkbutton { + padding: 4px 6px; +} + +check { + border: 1px @fg_color solid; + background-color: @text_bg_color; +} + +radiobutton { + padding: 4px 6px; +} + +radio { + border-radius: 100%; + border: 1px @fg_color solid; + background-color: @text_bg_color; +} + +expander label, +modelbutton label, +radiobutton label, +checkbutton label { + margin: 0 6px; +} + +scrollbar { + padding: 2px; +} + +scrollbar trough { + background-color: @scrollbar_bg_color; +} + +scrollbar button { + margin: 0; + padding: 0; + border: none; +} + +scrollbar slider { + margin: 3px; + padding: 3px; + border: 1px @fg_color solid; + background: @disabled_fg_color; +} + +scrollbar.vertical slider { + min-height: 3em; +} + +scrollbar.horizontal slider { + min-width: 3em; +} + +scale { + border: 2px transparent solid; + padding: 4px; +} + +scale.horizontal contents { + border: 1px @fg_color solid; + margin: 8px 0; +} + +scale.horizontal trough { + margin: 1px; +} + +scale.horizontal highlight { + background: @selected_bg_color; + padding: 1px; +} + +scale.horizontal slider { + border: 1px @fg_color solid; + border-radius: 100%; + padding: 8px; + margin: -8px; + background: @bg_color; +} + +scale.vertical value.top { + margin-bottom: 8px; +} + +scale.vertical contents { + border: 1px @fg_color solid; + margin: 0 8px; +} + +scale.vertical trough { + margin: 1px; +} + +scale.vertical highlight { + background: @selected_bg_color; + padding: 1px; +} + +scale.vertical slider { + border: 1px solid @fg_color; + border-radius: 100%; + padding: 8px; + margin: -8px; + background: @bg_color; +} + +scale:disabled highlight { + background-color: @disabled_bg_color; +} + +scale:disabled contents { + border: 1px solid @disabled_fg_color; +} + +scale:disabled slider { + border: 1px solid @disabled_fg_color; +} + +progressbar trough { + border: 1px @fg_color solid; +} + +progressbar progress { + background: @selected_bg_color; +} + +levelbar.horizontal.continuous trough { + border: 1px @fg_color solid; +} + +levelbar.horizontal.continuous trough block.filled { + background: @selected_bg_color; + margin: 2px; + padding: 2px; +} + +levelbar.horizontal.discrete trough { + border: 1px @fg_color solid; +} + +levelbar.horizontal.discrete trough block.filled { + background: @selected_bg_color; + margin: 2px; + padding: 2px; +} + +entry { + margin: 2px; + padding: 4px 6px; + border: 1px @disabled_fg_color solid; +} + +entry image { + margin: 0 6px; +} + +menubar label { + padding: 2px 6px; +} + +menuitem label { + margin: 0 2px; +} + +menu, +.menu, +.context-menu { + padding: 1px; +} + +.popup menu menuitem { + background-color: @text_bg_color; + padding: 2px 10px; +} + +.popup separator { + border-bottom: 1px @disabled_fg_color solid; +} diff --git a/.local/share/themes/Preless/icons/LICENSE b/.local/share/themes/Preless/icons/LICENSE new file mode 100644 index 0000000..fe62055 --- /dev/null +++ b/.local/share/themes/Preless/icons/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2023 Paweł Kuna + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.local/share/themes/Preless/icons/arrow-down.svg b/.local/share/themes/Preless/icons/arrow-down.svg new file mode 100644 index 0000000..37211bc --- /dev/null +++ b/.local/share/themes/Preless/icons/arrow-down.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-down" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> + <path stroke="none" d="M0 0h24v24H0z" fill="none"/> + <path d="M12 5l0 14" /> + <path d="M18 13l-6 6" /> + <path d="M6 13l6 6" /> +</svg> + + diff --git a/.local/share/themes/Preless/icons/arrow-left.svg b/.local/share/themes/Preless/icons/arrow-left.svg new file mode 100644 index 0000000..c152187 --- /dev/null +++ b/.local/share/themes/Preless/icons/arrow-left.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-left" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> + <path stroke="none" d="M0 0h24v24H0z" fill="none"/> + <path d="M5 12l14 0" /> + <path d="M5 12l6 6" /> + <path d="M5 12l6 -6" /> +</svg> + + diff --git a/.local/share/themes/Preless/icons/arrow-right.svg b/.local/share/themes/Preless/icons/arrow-right.svg new file mode 100644 index 0000000..59d4904 --- /dev/null +++ b/.local/share/themes/Preless/icons/arrow-right.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-right" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> + <path stroke="none" d="M0 0h24v24H0z" fill="none"/> + <path d="M5 12l14 0" /> + <path d="M13 18l6 -6" /> + <path d="M13 6l6 6" /> +</svg> + + diff --git a/.local/share/themes/Preless/icons/arrow-up.svg b/.local/share/themes/Preless/icons/arrow-up.svg new file mode 100644 index 0000000..dbfbe91 --- /dev/null +++ b/.local/share/themes/Preless/icons/arrow-up.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-up" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> + <path stroke="none" d="M0 0h24v24H0z" fill="none"/> + <path d="M12 5l0 14" /> + <path d="M18 11l-6 -6" /> + <path d="M6 11l6 -6" /> +</svg> + + diff --git a/.local/share/themes/Preless/icons/selector.svg b/.local/share/themes/Preless/icons/selector.svg new file mode 100644 index 0000000..d138dcf --- /dev/null +++ b/.local/share/themes/Preless/icons/selector.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-selector" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> + <path stroke="none" d="M0 0h24v24H0z" fill="none"/> + <path d="M8 9l4 -4l4 4" /> + <path d="M16 15l-4 4l-4 -4" /> +</svg> + + @@ -0,0 +1 @@ +.local/share/themes
\ No newline at end of file diff --git a/.vim/colors/fluid.vim b/.vim/colors/fluid.vim index e904c6c..7d1ee72 100644 --- a/.vim/colors/fluid.vim +++ b/.vim/colors/fluid.vim @@ -1,14 +1,21 @@ -nohl -hi clear -syntax reset -set t_Co=256 -set background=dark -let g:syntax_cmd = "skip" +nohls " Do not highlight previous search patterns. +highlight clear " Reset all highlighting to the defaults. Run :hi to see current theme colors. +syntax reset " Reset syntax to defaults. -let s:none='NONE' -let s:bold='bold' -let s:t_clear=0 +set t_Co=256 " Set number of terminal colors to 256. +set guioptions-=l " Remove left scrollbar in GUI. +set guioptions-=L " Remove left scrollbar in GUI vertical split. +set guioptions-=r " Remove right scrollbar in GUI. +set guioptions-=R " Remove right scrollbar in GUI vertical split. +set guioptions-=m " Remove menu in GUI. +set guioptions-=T " Remove toolbar in GUI. +set guioptions-=e " Remove tab bar in GUI. +set background=dark " Try to use dark colors. +let g:syntax_cmd = "skip" " Don't define colors. We define the colors. +let s:t_clear=0 " Set terminal empty color value. + +let s:none = 'NONE' | let s:bold = 'bold' let s:t_background = s:none | let s:g_background = '#2c303c' let s:t_white = '255' | let s:g_white = '#cdd3de' let s:t_black = '232' | let s:g_black = '#000000' diff --git a/.vim/pack/plugins/start/fzf.vim b/.vim/pack/plugins/start/fzf.vim new file mode 160000 +Subproject f86ef1bce602713fe0b5b68f4bdca8c6943ecb5 diff --git a/.vim/pack/plugins/start/gundo.vim b/.vim/pack/plugins/start/gundo.vim new file mode 160000 +Subproject c5efef192b975b8e7d5fa3c6db932648d3b7632 diff --git a/.vim/pack/plugins/start/nnn.vim b/.vim/pack/plugins/start/nnn.vim new file mode 160000 +Subproject bfc91b503769920a366b12851b871795c0eb682 diff --git a/.vim/pack/plugins/start/vim-HiLinkTrace b/.vim/pack/plugins/start/vim-HiLinkTrace new file mode 160000 +Subproject 64da6bf463362967876fdee19c6c8d7dd3d0bf0 diff --git a/.vim/pack/plugins/start/vim-elixir b/.vim/pack/plugins/start/vim-elixir new file mode 160000 +Subproject 53c530f79cfcd12498e31fcf8ecc466eba34c75 diff --git a/.vim/plugins.vim b/.vim/plugins.vim deleted file mode 100644 index 030c306..0000000 --- a/.vim/plugins.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Source plugin manager -so ~/.vim/bundle/vim-plug/plug.vim - -" Specify a directory for plugins -call plug#begin('~/.vim/bundle') - -Plug 'junegunn/vim-plug', { 'tag': 'e718868e85e2a32410144dfcdc3ba1303719450d' } -Plug 'junegunn/fzf.vim', { 'tag': 'f86ef1bce602713fe0b5b68f4bdca8c6943ecb59' } -Plug 'sjl/gundo.vim', { 'tag': 'c5efef192b975b8e7d5fa3c6db932648d3b76323' } -Plug 'mcchrish/nnn.vim', { 'tag': 'bfc91b503769920a366b12851b871795c0eb6825' } -Plug 'tpope/vim-fugitive', { 'tag': '85e2c73830b6bb01ce7fc3a926d2b25836a253eb' } -Plug 'gerw/vim-HiLinkTrace', { 'tag': '64da6bf463362967876fdee19c6c8d7dd3d0bf0f' } -Plug 'elixir-editors/vim-elixir', { 'tag': '53c530f79cfcd12498e31fcf8ecc466eba34c75c' } - -" Enable fzf.vim on Debian. -silent! source /usr/share/doc/fzf/examples/fzf.vim - -" Initialize plugin system -call plug#end() diff --git a/.vim/snippets/module.nix b/.vim/snippets/module.nix new file mode 100644 index 0000000..bc9d52e --- /dev/null +++ b/.vim/snippets/module.nix @@ -0,0 +1,56 @@ +{ pkgs, lib, config, ... }: + +let + + service = ""; + cfg = config.services.${service}; + settings = pkgs.formats.json { }; + +in { + + options.services.${service} = { + + enable = lib.mkOption { + type = lib.types.bool; + default = false; + }; + + user = lib.mkOption { + type = lib.types.str; + default = service; + }; + + group = lib.mkOption { + type = lib.types.str; + default = service; + }; + + directory = lib.mkOption { + type = lib.types.str; + default = "/var/empty"; + }; + + settings = lib.mkOption { + type = settings.type; + default = { }; + }; + }; + + config = lib.mkIf cfg.enable { + + services.${service}.settings = { }; + + users = { + groups.${cfg.user} = { gid = 9999; }; + users.${cfg.group} = { + uid = 9999; + shell = pkgs.shadow; + home = cfg.directory; + group = cfg.group; + createHome = true; + isSystemUser = true; + }; + }; + + }; +} diff --git a/.vim/snippets/package.nix b/.vim/snippets/package.nix new file mode 100644 index 0000000..31cb944 --- /dev/null +++ b/.vim/snippets/package.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchgit }: + +stdenv.mkDerivation rec { + pname = ""; + version = ""; + + src = fetchgit { + rev = version; + url = ""; + sha256 = ""; + }; + + dontBuild = true; + + installPhase = '' + runHook preInstall + mkdir "$out" + runHook postInstall + ''; + + meta = { + homepage = ""; + description = ""; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + }; +} diff --git a/.vim/snippets/shell.nix b/.vim/snippets/shell.nix new file mode 100644 index 0000000..2e58365 --- /dev/null +++ b/.vim/snippets/shell.nix @@ -0,0 +1,22 @@ +let + + name = "nix-shell.pure"; + pkgs = import <nixpkgs> { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.vim/snippets/skeleton.awk b/.vim/snippets/skeleton.awk new file mode 100644 index 0000000..528ca97 --- /dev/null +++ b/.vim/snippets/skeleton.awk @@ -0,0 +1 @@ +#!/usr/bin/env -S awk -f diff --git a/.vim/snippets/skeleton.html b/.vim/snippets/skeleton.html new file mode 100644 index 0000000..8099090 --- /dev/null +++ b/.vim/snippets/skeleton.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head> + <title></title> + <meta charset="utf-8" /> + <meta + name="viewport" + content="width=device-width, initial-scale=1" + /> + </head> + <body> + </body> +</html> diff --git a/.vim/syntax/nftables.vim b/.vim/syntax/nftables.vim new file mode 100644 index 0000000..8a6bc90 --- /dev/null +++ b/.vim/syntax/nftables.vim @@ -0,0 +1,32 @@ +" https://github.com/nfnty/vim-nftables +" License: MIT Copyright (c) 2015 nfnty + +if exists('b:current_syntax') + finish +endif + +syn match nftablesSet /{.*}/ contains=nftablesSetEntry +syn match nftablesSetEntry /[a-zA-Z0-9]\+/ contained +hi def link nftablesSet Keyword +hi def link nftablesSetEntry Operator + +syn match nftablesNumber "\<[0-9A-Fa-f./:]\+\>" contains=nftablesMask,nftablesDelimiter +syn match nftablesHex "\<0x[0-9A-Fa-f]\+\>" +syn match nftablesDelimiter "[./:]" contained +syn match nftablesMask "/[0-9.]\+" contained contains=nftablesDelimiter +hi def link nftablesNumber Statement +hi def link nftablesHex Number +hi def link nftablesDelimiter Operator +hi def link nftablesMask Operator + +syn region Comment start=/#/ end=/$/ +syn region String start=/"/ end=/"/ +syn keyword Function table tcp udp +syn keyword Statement drop reject log limit +syn keyword Type accept +syn keyword Constant prerouting input forward output postrouting +syn keyword Special snat dnat masquerade queue +syn keyword Keyword continue return goto +syn keyword Keyword define + +let b:current_syntax = 'nftables' diff --git a/.vim/vimrc b/.vim/vimrc new file mode 100644 index 0000000..7416679 --- /dev/null +++ b/.vim/vimrc @@ -0,0 +1,388 @@ +"------------Setup-------------" + +mapclear " Clear all mappings. +packadd! matchit " Add match tag pairs package. +let skip_defaults_vim=1 " Do not load defaults if vimrc is missing. + + +"------------General------------" + +let mapleader = "\<space>" " Set default map leader. +let php_htmlInStrings = 1 " Highlight HTML in PHP. + +set ruler " Show the cursor position all the time. +set nowrap " Do not wrap lines. +set nonumber " Set line numbers. +set hlsearch " Enable search. +set incsearch " Set incremental search. +set showmatch " Briefly show matching tags. +set nocompatible " Use Vim defaults. +set splitbelow " Open horizontal splits below. +set splitright " Open vertical splits to the right. +set cursorline " Set cursor line highlight. +set notimeout " Wait indefinitely for complete key combinations. +set ttimeout " Prevent pressing <Esc> twice. +set nostartofline " Do not move cursor to line start on buffer switch. +set showcmd " Show key presses in status line. +set wildmenu " Show tab completions menu. +set nojoinspaces " Insert one space after a '.', '?' and '!' with a join command. +set path+=** " Search subfolders. +set display=lastline " @@@ which indicates remaining line is not displayed. + +set hidden " Set hidden buffers. +set nobackup " No write backups. +set noswapfile " Disable swap files. +set nowritebackup " No overwrite backups. +set autoread " Auto read file on external change. +set autowrite " Write if modified. +set autowriteall " Write if modified on buffer change. +set autoindent " Copy indent from current line to new line. +set ignorecase " Ignore case on search. +set smartcase " Search by case smartly. +set nolazyredraw " Disable lazy redraw on screen when using macros. +set ttyfast " Assume fast terminal. +set undofile " Enable undofile. +set viminfo+=n~/.vim/viminfo " Set viminfo file path. +set undodir=~/.vim/undodir " Set undofile directory. + +set mouse=a " Enable mouse. +set shortmess+=I " Disable startup message. +set shortmess-=S " Count number of search result matches. +set showtabline=0 " Disable tab bar. +set updatetime=1500 " Set duration for cursor hold event. +set synmaxcol=500 " Maximum column in which to search for syntax items. +set fillchars= " Set split window margin fill to none. +set laststatus=0 " Disable status bar. +set linespace=3 " Set line spaces. +set guiheadroom=0 " Disable headroom on window maximize. +set history=50 " Keep 50 lines of command line history. +set clipboard=unnamed " Use clipboard as default register. +set backspace=indent,eol,start " Enable backspacing. +set formatoptions-=t " Do not auto wrap text when typing. +set complete=.,w,b,u " Set our desired autocompletion match pattern. +set encoding=utf-8 " Set UTF-8 encoding. +set scrolloff=3 " Set vertical scroll headroom. +set sidescroll=3 " Set horizontal column scroll. +set sidescrolloff=10 " Set horizontal scroll headroom. +set foldcolumn=2 " Set fold column width to 2. + +set tabstop=2 softtabstop=0 shiftwidth=2 smarttab expandtab " Set spaces as default. +set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣ " Set hidden character identifiers. + + +"----------------Visuals----------------" + +syntax enable " Enable syntax highlighting. +colorscheme fluid " Set color scheme. + + +"---------------Functions---------------" + +" Ansible Check +function! AnsibleCheck() + :exe 'Notify(''ansible-playbook --syntax-check ' . expand('%') . ' 2>&1'')' | :e +endfunction + +" Typography Format +function! TypographyFormat() + :silent! %s/\(^\|\s\|\w\)\zs--\ze\($\|\s\|\w\)/–/g | silent! %s/\(^\|\s\|\w\)\zs---\ze\($\|\s\|\w\)/—/g + :silent! %s/ '/ ‘/g | silent! %s/' /’ /g | :silent! %s/^'/‘/g | silent! %s/'$/’/g + :silent! %s/ "/ “/g | silent! %s/" /” /g | :silent! %s/^"/“/g | silent! %s/"$/”/g + :silent! %s/\S\@='\S@!/’/g | :silent! %s/\S\@<='\S\@=/’/g + :silent! %s/\S\@="\S@!/”/g | :silent! %s/\S\@<="\S\@=/”/g +endfunction + + +"---------------Shortcuts---------------" + +" Edit shortcuts +nmap <leader>ev :tabedit ~/.vim/vimrc<cr> +nmap <leader>eh :tabedit ~/.vim/post-save-hook<cr> + +" Show key mappings +nmap <leader>mn :nmap<cr> +nmap <leader>mv :vmap<cr> +nmap <leader>mi :imap<cr> +nmap <leader>mc :command<cr> + +" Search documentation under cursor +nmap <leader>ds :exe ':term ++hidden ++close recoll -q ' . '' . expand('<cword>') . ''<cr> +nmap <leader>dt :exe ':term dict -h localhost -d dict-moby-thesaurus-latest ' . expand('<cword>')<cr> + +" Search for file containing word under cursor +nmap <silent> <leader>ag :Ag <C-R><C-W><cr> + +" View function documentation +nmap <leader>dp :call fzf#run({'options': ['--preview', 'echo doc {} \| psysh \| fold --spaces --width 80'], 'source': "psysh-doc", 'sink': ':term psysh-doc', 'down': '50%'})<cr> + +" Jump to line +nmap <leader>jl :norm yaW<cr> \| :Jump<cr> + +" Load and save sessions +nmap <leader>sl :source ~/.vim/sessions/session.vim \| :source ~/.vim/vimrc<cr>:Notify('printf "Last saved session loaded."')<cr> +nmap <leader>ss :silent! exe "!~/.vim/hooks/pre-session-save" \| :mksession! ~/.vim/sessions/session.vim \| :redraw!<cr>:Notify('printf "Current session saved."')<cr> + +" Toggle Spell Check +nmap <leader>sp :set spell!<cr> + +" Sort lines by length +vnoremap <leader>sn !perl -e 'print sort { length($a) <=> length($b) } <>'<cr> + +" Switch between tabs and spaces +nmap <leader>ses :set tabstop=2 softtabstop=0 shiftwidth=2 smarttab expandtab<cr> +nmap <leader>set :set tabstop=2 softtabstop=0 shiftwidth=2 smarttab noexpandtab<cr> + +" Close buffer and window +nmap <leader>qq :bd<cr> +nmap <leader>qa :silent! %bd!\|e#\|bd#<cr> +nmap <leader>qw <C-w>c<cr> + +" Re-indent entire file +nmap <leader>re gg=G<C-o><C-o> + +" Reset all settings and source configuration. +nmap <leader>ra :set all& \| :source ~/.vim/vimrc \| :packloadall \|:e<cr>:Notify('printf "Settings cleared and reloaded."')<cr> + +" Remove trailing whitespace +nmap <leader>rs :%s/\s\+$//e + +" Dump output of command to new buffer +nmap <leader>rr :enew \| .!<space> + +" Remove duplicate lines +vnoremap <leader>rd !awk '\!visited[$0]++'<cr> + +" Toggle color column +nmap <leader>cv :exe "set colorcolumn=" . (&colorcolumn == "" ? "80" : "")<cr> + +" Toggle cursor column +nmap <leader>cx :set cursorcolumn!<cr> + +" Transliterate special characters to ascii +nmap <leader>ce :silent! %s/–/--/g<cr> \| :silent! %s/—/---/g<cr> \| my \| :%!iconv -f utf-8 -t ascii//translit<cr>'y + +" Use typographic characters +nmap <leader>cl :call TypographyFormat()<cr> + +" Toggle line numbers +nmap <leader>cn :set number!<cr> +nmap <leader>cr :set relativenumber!<cr> + +" Move line up or down +nmap <leader>ck ddkkpk<cr> +nmap <leader>cj ddpk<cr> + +" Justify columns +vnoremap <leader>ct !column -t -o' '<cr> + +" Fold text +vnoremap <leader>cf <S-J><S-v> \| !fold --spaces --width<space>80 + +" Go to scratchpad of specified filetype +noremap <leader>cs :w !cat > $HOME/.cache/vim-scratchpad<cr>:e +setf\ <space>$HOME/.cache/vim-scratchpad<C-left><left> + +" File open mappings +nmap <Tab> :Buffers<cr> +nmap <leader>ov :Lines<cr> +nmap <leader>ob :BLines<cr> +nmap <leader>ol :Locate<space> +nmap <leader>ot :exe '!$TERMINAL -cd ' . expand('%:p:h') . ' > /dev/null 2>&1 &'<cr><cr> +nmap <leader>of :call fzf#run({'options': [], 'source': "cat $FZF_FILE_MARKS", 'sink': 'e', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr><down> +nmap <leader>od :call fzf#run({'options': ['--preview', 'ls {}'], 'source': "cut -d' ' -f3 $FZF_DIRECTORY_MARKS", 'sink': 'cd', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr><down> +nmap <leader>oo :call fzf#run({'options': ['--preview', 'highlight -O ansi --force {}'], 'source': 'rg --files --hidden \|\| find . -type f -printf "%P\n"', 'sink': 'e', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr><down> +nmap <leader>oa :call fzf#run({'options': ['--preview', 'ls {}'], 'source': "find $HOME -type d -maxdepth 6", 'sink': 'cd', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr><down> + +" Mappings for nnn +nmap <leader>nm :NnnPicker<cr> +nmap <leader>nn :NnnPicker '%:p:h'<cr> + +" Exit incremental search +nmap <Esc><Esc> :nohl<cr> + +" Disable Ex Mode +nnoremap Q <Nop> + +" Split window mappings +nmap <Bslash> :vsplit<cr> +nmap <C-Bslash> :split<cr> +nmap <C-j> :resize +5<cr> +nmap <C-k> :resize -5<cr> +nmap <C-h> :vertical resize +5<cr> +nmap <C-l> :vertical resize -5<cr> + +" Inverse Tabs +inoremap <S-Tab> <C-d> + +" Retain visual selection when tabbing +vnoremap < <gv +vnoremap > >gv + +" Prevent cursor from jumping in visual select context https://ddrscott.github.io/blog/2016/yank-without-jank/ +vnoremap <expr>y "my\"" . v:register . "y`y" + + +"------------------Snippets-------------------" + +nnoremap ,awk :-1read $HOME/.vim/snippets/skeleton.awk<cr> +nnoremap ,nix-shell :-1read $HOME/.vim/snippets/shell.nix<cr>2jf"a +nnoremap ,nix-module :-1read $HOME/.vim/snippets/module.nix<cr>4jf"a +nnoremap ,nix-package :-1read $HOME/.vim/snippets/package.nix<cr>3jf"a +nnoremap ,html :-1read $HOME/.vim/snippets/skeleton.html<cr>3jwf>a + + +"---------------Plugin Settings---------------" + +let g:gundo_prefer_python3=1 " Use python3 to restore gundo functionality. +let g:netrw_banner=0 " Disable netrw banner. +let g:nnn#command = 'nnn -H' " Override default command. +let g:nnn#set_default_mappings = 0 " Disable default mappings. +let g:nnn#layout = 'new' " Opens the nnn window in a split. +let g:nnn#layout = { 'left': '~20%' } " Left 20% of the window. +let g:fzf_layout = { 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 } } " Set fzf window layout, + + +"-------------------Scripts-------------------" + +" https://vi.stackexchange.com/questions/14300/vim-how-to-send-entire-line-to-a-buffer-of-type-terminal +function s:repl(start, end, language) + let g:terminal_buffer = get(g:, 'terminal_buffer', -1) + if g:terminal_buffer == -1 || !bufexists(g:terminal_buffer) + terminal ++rows=10 + let g:terminal_buffer = bufnr('') + call term_sendkeys(g:terminal_buffer, a:language . "; exit" . "\<cr>") + wincmd p + elseif bufwinnr(g:terminal_buffer) == -1 + exe 'sbuffer ' . g:terminal_buffer + wincmd p + endif + call term_sendkeys(g:terminal_buffer, join(getline(a:start, a:end), "\<cr>") . " " . "\<cr>") +endfunction + +" Jump to line and column in the format 123:13 +function s:cursor(selection) + wincmd p + let g:cursor_request = split(a:selection, ":") + call cursor(g:cursor_request[0], g:cursor_request[1]) +endfunction + +" Notify +function s:notify(command) + call popup_notification(systemlist(a:command), { 'pos': 'topright', 'col': 9999, 'time' : 600000, 'highlight': 'Normal' }) +endfunction + + +"-------------------Commands-------------------" + +command! -nargs=? -range Jump call s:cursor(@*) +command! -nargs=? -range REPL call s:repl(<line1>, <line2>, <f-args>) +command! -nargs=1 -range Notify call s:notify(<args>) +command! Term term ++noclose + + +"----------------Autorun----------------" + +augroup AutoCommands + + " Clear auto commands. + autocmd! + + " Source reloads. + autocmd BufWritePost .vimrc,vimrc source % | Notify('printf "Configuration sourced."') + + " Linting file type post write commands. + autocmd FileType markdown autocmd! BufWritePost <buffer> :only | :term ++rows=10 sh -c "cat % | vale --ext .md" + autocmd FileType raku autocmd! BufWritePost <buffer> exe 'Notify(''raku -c ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType scheme autocmd! BufWritePost <buffer> exe 'Notify(''guile -s ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType css autocmd! BufWritePost <buffer> exe 'Notify(''prettier --write --parser css ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType html autocmd! BufWritePost <buffer> exe 'Notify(''prettier --write --parser html ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType python autocmd! BufWritePost <buffer> exe 'Notify(''ruff --no-cache ' . expand('%') . ' 2>&1 && black ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType nim autocmd! BufWritePost <buffer> exe 'Notify(''nimpretty ' . expand('%') . ' 2>&1 && printf "Nim OK: ' . expand('%') . '"'')' | :e + autocmd FileType rust autocmd! BufWritePost <buffer> exe 'Notify(''rustfmt ' . expand('%') . ' 2>&1 && printf "rustfmt OK: ' . expand('%') . '"'')' | :e + autocmd FileType json autocmd! BufWritePost <buffer> exe 'Notify(''jsonlint -i ' . expand('%') . ' 2>&1 && printf "JSON OK: ' . expand('%') . '"'')' | :e + autocmd FileType ruby autocmd! BufWritePost <buffer> exe 'Notify(''rubocop --fix-layout ' . expand('%') . ' 2>&1 && rubocop ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType javascript autocmd! BufWritePost <buffer> exe 'Notify(''eslint --fix ' . expand('%') . ' 2>&1 && printf "JavaScript OK: '. expand('%') . '"'')' | :e + autocmd FileType elixir autocmd! BufWritePost <buffer> exe 'Notify(''mix format ' . expand('%') . ' 2>&1 && printf "Elixir Format OK: ' . expand('%') . '"'')' | :e + autocmd FileType haskell autocmd! BufWritePost <buffer> exe 'Notify(''hlint ' . expand('%') . ' 2>&1 && brittany --write-mode inplace ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType bash,sh autocmd! BufWritePost <buffer> exe 'Notify(''shellcheck -x --exclude=SC1090,SC1091 ' . expand('%') . ' 2>&1 && printf "Shellcheck OK: ' . expand('%') . '"'')' + autocmd FileType xml,xslt,rng,xsd autocmd! BufWritePost <buffer> exe 'Notify(''xmllint --pretty 1 ' . expand('%') . ' --output ' . expand('%') . ' 2>&1 && printf "XML OK: ' . expand('%') . '"'')' | :e + autocmd FileType go autocmd! BufWritePost <buffer> exe 'Notify(''gofmt -w -s -e ' . expand('%') . ' 2>&1 && go vet ' . expand('%') . ' 2>&1 && printf "Go Format OK: ' . expand('%') . '"'')' | :e + autocmd FileType nix autocmd! BufWritePost <buffer> exe 'Notify(''nix-linter ' . expand('%') . ' 2>&1 && printf "Nix Lint OK: ' . expand('%') . '"' . ' && nixfmt ' . expand('%') . ' 2>&1' . ''')' | :e + autocmd FileType php autocmd! BufWritePost <buffer> exe 'Notify(''phpcbf ' . expand('%') . ' 2>&1 && phpstan --no-progress --no-ansi --no-interaction analyze --level max ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType tex autocmd! BufWritePost <buffer> exe 'Notify(''latexindent ' . expand('%') . ' 2>&1 && printf "LaTeX OK: ' . expand('%') . '"'')' | :e | :only | :term ++close ++rows=10 latex-compile % + autocmd FileType bindzone autocmd! BufWritePost <buffer> exe 'Notify(''file="' . expand('%') . '" && named-checkzone "$(head --lines=1 "$file" | cut --delimiter=" " --fields=2 | perl -ple "chop")" $file'')' | :e + autocmd FileType awk autocmd! BufWritePost <buffer> exe 'Notify(''awk -g -f ' . expand('%') . ' 2>&1 && awk -o- -f ' . expand('%') . ' | sponge ' . expand('%') . ' && printf "AWK OK: ' . expand('%') . '"'')' | :e + autocmd FileType yaml autocmd! BufWritePost <buffer> exe 'Notify(''yaml round-trip --indent 2 --save ' . expand('%') . ' 2>&1 && yamllint -s ' . expand('%') . ' 2>&1 && printf "YAML OK: ' . expand('%') . '"'')' | :e + autocmd FileType typescript autocmd! BufWritePost <buffer> exe 'Notify(''deno fmt ' . expand('%') . ' 2>&1 && NO_COLOR=true deno lint ' . expand('%') . ' 2>&1'')' | :e | :only | :term ++rows=10 deno run --allow-all --location https://example.com/ % + autocmd FileType c autocmd! BufWritePost <buffer> exe 'Notify(''clang-format -i ' . expand('%') . ' 2>&1 && printf "Clang Format OK: ' . expand('%') . '\n"' . ' && gcc -Wall -Wpedantic -Werror -fsyntax-only ' . expand('%') . ' 2>&1'')' | :e + autocmd FileType sql autocmd! BufWritePost <buffer> exe 'Notify(''sqlint ' . expand('%') . ' 2>&1 && pg_format --type-case 2 --inplace ' . expand('%') . ' 2>&1 && sqlfluff lint --exclude-rules L003,L016 --dialect postgres ' . expand('%') . ' 2>&1 && printf "SQL OK: ' . expand('%') . '"'')' | :e + + " Linting extension post write commands. + autocmd BufWritePost $HOME/.config/chromexup/config.ini exe 'Notify(''chromexup 2>&1'')' + autocmd BufWritePost rc.lua exe 'Notify(''awesome -k 2>&1'')' + autocmd BufWritePost quotes,*.fortune exe 'Notify(''strfile ' . expand('%') . ''')' + autocmd BufWritePost *.doas exe 'Notify(''doas -C ' . expand('%') . ' 2>&1 && printf "doas OK: ' . expand('%') . '"'')' + autocmd BufWritePost Xresources exe 'Notify(''xrdb ~/.config/X11/Xresources ' . '2>&1 && printf "Reloading Xresources: ' . expand('%') . '"'')' + autocmd BufWritePost Makefile exe 'Notify(''make --dry-run --warn-undefined-variables ' . '2>&1 && printf "\nMake OK: ' . expand('%') . '"'')' + autocmd BufWritePost *.nft exe 'Notify(''doas nft --check --file ' . expand('%') . ' 2>&1 && printf "nftables OK: ' . expand('%') . '"'')' + autocmd BufWritePost *.desktop exe 'Notify(''desktop-file-validate ' . expand('%') . ' 2>&1 && printf "Desktop File OK: ' . expand('%') . '"'')' + autocmd BufWritePost *.service exe 'Notify(''systemd-analyze verify --user ' . expand('%') . ' 2>&1 && printf "Systemd Service File OK: ' . expand('%') . '"'')' + + " File type function under cursor lookups. + autocmd FileType go noremap <buffer> <leader>df :exe ':term ++rows=10 go doc ' . expand('<cexpr>')<cr> + autocmd FileType elixir noremap <buffer> <leader>df :exe ':term ++rows=10 sh -c "echo ''h(' . expand('<cexpr>') . ')'' \| iex"'<cr> + + " REPL commands. + autocmd FileType bash noremap <buffer> <leader>cc :REPL bash -x<cr> + autocmd FileType elixir noremap <buffer> <leader>cc :REPL iex<cr> + autocmd FileType go noremap <buffer> <leader>cc :REPL gore<cr> + autocmd FileType javascript noremap <buffer> <leader>cc :REPL node<cr> + autocmd FileType lua noremap <buffer> <leader>cc :REPL lua<cr> + autocmd FileType nix noremap <buffer> <leader>cc :REPL nix repl<cr> + autocmd FileType perl noremap <buffer> <leader>cc :REPL perl -de0<cr> + autocmd FileType php noremap <buffer> <leader>cc :REPL psysh<cr> + autocmd FileType python noremap <buffer> <leader>cc :REPL python<cr> + autocmd FileType rust noremap <buffer> <leader>cc :REPL evcxr<cr> + autocmd FileType scheme noremap <buffer> <leader>cc :REPL guile<cr> + autocmd FileType sh noremap <buffer> <leader>cc :REPL dash -x<cr> + autocmd FileType typescript noremap <buffer> <leader>cc :REPL deno<cr> + autocmd FileType awk noremap <buffer> <leader>cc :term ++rows=10 ++close awk -f %<cr> + + " Format using visual select + gq. + autocmd FileType nix set formatprg=nixfmt + autocmd FileType sh set formatprg=shfmt\ - + autocmd FileType lua set formatprg=lua-format + autocmd FileType perl set formatprg=perltidy\ - + autocmd FileType typescriptreact set formatprg=deno\ fmt\ - + autocmd FileType typescript set formatprg=deno\ fmt\ - + autocmd FileType elixir set formatprg=mix\ format\ - + autocmd FileType c set formatprg=clang-format\ - + autocmd FileType python set formatprg=black\ --quiet\ - + autocmd FileType scheme set formatprg=emacs-batch-indent\ scheme + autocmd FileType css set formatprg=prettier\ --parser\ css\ --stdin-filepath\ % + autocmd FileType html set formatprg=prettier\ --parser\ html\ --stdin-filepath\ % + autocmd FileType markdown set formatprg=prettier\ --parser\ markdown\ --stdin-filepath\ % + autocmd FileType javascript set formatprg=swc\ compile\ --filename\ %\ \|\ tail\ --lines\ +2 + autocmd FileType ruby set formatprg=rubocop\ --autocorrect\ --stderr\ --stdin\ %\ 2>\ \/dev\/null + + " Format by extension using visual select + gq + autocmd BufRead,BufNewFile *.mathml.xml set formatprg=latexmlmath\ - + + " Set file types by extension + autocmd BufRead,BufNewFile *.nims set filetype=nim + autocmd BufRead,BufNewFile *.rasi set filetype=css + autocmd BufRead,BufNewFile *.doas set filetype=conf + autocmd BufRead,BufNewFile *.nft set filetype=nftables + autocmd BufRead,BufNewFile *.blade.php set filetype=php + + " Clear notification on cursor movement. + autocmd CursorMoved * silent! call popup_clear() + + " Automatically remove trailing white space on save. + autocmd BufWritePre * %s/\s\+$//e + + " Automatically save file on insert and idle. + autocmd InsertLeave,CursorHold * silent! write + \| silent! exe "!~/.vim/hooks/post-save > /dev/null 2>&1 &" + \| :echo expand('%:t') '[filetype=' . &filetype . ']' + +augroup END @@ -1,346 +0,0 @@ -"------------Setup-------------" - -mapclear " Clear all mappings. -packadd! matchit " Add match tag pairs package. -let skip_defaults_vim=1 " Do not load defaults if ~/.vimrc is missing. -so ~/.vim/plugins.vim " Source plugins. - - -"------------General------------" - -let mapleader = "\<space>" " Set default map leader. -let g:notify = "notify-send -t 10000" " Set default notify daemon. - -syntax enable " Enable syntax highlighting. - -set ruler " Show the cursor position all the time. -set nowrap " Do not wrap lines. -set nonumber " Set line numbers. -set hlsearch " Enable search. -set incsearch " Set incremental search. -set showmatch " Briefly show matching tags. -set nocompatible " Use Vim defaults. -set splitbelow " Open horizontal splits below. -set splitright " Open vertical splits to the right. -set cursorline " Set cursor line highlight. -set notimeout " Wait indefinitely for complete key combinations. -set ttimeout " Prevent pressing <Esc> twice. -set showcmd " Show key presses in status line. -set wildmenu " Show tab completions menu. -set nojoinspaces " Insert one space after a '.', '?' and '!' with a join command. -set path+=** " Search subfolders. -set display=lastline " @@@ which indicates remaining line is not displayed. - -set hidden " Set hidden buffers. -set nobackup " No write backups. -set noswapfile " Disable swap files. -set nowritebackup " No overwrite backups. -set autoread " Auto read file on external change. -set autowrite " Write if modified. -set autowriteall " Write if modified on buffer change. -set autoindent " Copy indent from current line to new line. -set ignorecase " Ignore case on search. -set smartcase " Search by case smartly. -set lazyredraw " Do not redraw screen when using macros. -set undofile " Enable undofile. -set viminfo+=n~/.vim/viminfo " Set viminfo file path. -set undodir=~/.vim/undodir " Set undofile directory. - -set mouse=a " Enable mouse. -set shortmess+=I " Disable startup message. -set showtabline=0 " Disable tab bar. -set updatetime=1500 " Set duration for cursor hold event. -set fillchars= " Set split window margin fill to none. -set laststatus=0 " Disable status bar. -set linespace=3 " Set line spaces. -set guiheadroom=0 " Disable headroom on window maximize. -set history=50 " Keep 50 lines of command line history. -set clipboard=unnamed " Use clipboard as default register. -set backspace=indent,eol,start " Enable backspacing. -set formatoptions-=t " Do not auto wrap text when typing. -set complete=.,w,b,u " Set our desired autocompletion match pattern. -set encoding=utf-8 " Set UTF-8 encoding. -set scrolloff=3 " Set vertical scroll headroom. -set sidescroll=3 " Set horizontal column scroll. -set sidescrolloff=10 " Set horizontal scroll headroom. -set foldcolumn=2 " Set fold column width to 2. - -let php_htmlInStrings = 1 " Highlight HTML in PHP. - -" Convert tab to spaces. -set tabstop=2 softtabstop=0 shiftwidth=2 smarttab expandtab - - -"----------------Visuals----------------" - -colorscheme fluid " Set color scheme. -set guioptions-=l " Remove left scrollbar in GUI. -set guioptions-=L " Remove left scrollbar in GUI vertical split. -set guioptions-=r " Remove right scrollbar in GUI. -set guioptions-=R " Remove right scrollbar in GUI vertical split. -set guioptions-=m " Remove menu in GUI. -set guioptions-=T " Remove toolbar in GUI. -set guioptions-=e " Remove tab bar in GUI. - - -"---------------Functions---------------" - -" PHP Fixer -function! PHPFix() - :silent exe '!' . expand(g:notify) . ' ' . '"$(phpcbf % 2>&1)" > /dev/null 2>&1' - :redraw! -endfunction - -" ESLint Fix -function! ESLintFix() - :silent exe '!' . expand(g:notify) . ' ' . '"$(eslint -c $HOME/.config/eslintrc.yml --fix % 2>&1)" > /dev/null 2>&1' -endfunction - -" Ansible Check -function! AnsibleCheck() - :silent exe '!' . expand(g:notify) . ' ' . '"$(ansible-playbook --syntax-check % 2>&1)" > /dev/null 2>&1 &' - :redraw! -endfunction - -" Typography Format -function! TypographyFormat() - :silent! %s/\(^\|\s\|\w\)\zs--\ze\($\|\s\|\w\)/–/g | silent! %s/\(^\|\s\|\w\)\zs---\ze\($\|\s\|\w\)/—/g - :silent! %s/ '/ ‘/g | silent! %s/' /’ /g | :silent! %s/^'/‘/g | silent! %s/'$/’/g - :silent! %s/ "/ “/g | silent! %s/" /” /g | :silent! %s/^"/“/g | silent! %s/"$/”/g - :silent! %s/\S\@='\S@!/’/g | :silent! %s/\S\@<='\S\@=/’/g - :silent! %s/\S\@="\S@!/”/g | :silent! %s/\S\@<="\S\@=/”/g -endfunction - - -"---------------Shortcuts---------------" - -" Edit shortcuts -nmap <leader>ev :tabedit ~/.vimrc<cr> -nmap <leader>ep :tabedit ~/.vim/plugins.vim<cr> -nmap <leader>eh :tabedit ~/.vim/post-save-hook<cr> - -" Git, tags, and help commands -nmap <leader>fgf :GFiles<cr> -nmap <leader>fgs :GFiles?<cr> -nmap <leader>fgc :Commits<cr> -nmap <leader>ftb :BTags<cr> -nmap <leader>flh :Helptags<cr> -nmap <leader>flc :Commands<cr> - -" Show key mappings -nmap <leader>mm :Maps<cr> -nmap <leader>ma :Marks<cr> - -" Search documentation under cursor -nmap <leader>dm :exe ':term ++close fzf-man ' . expand('<cword>')<cr> -nmap <leader>di :exe ':term ++close fzf-doc ' . expand('<cword>')<cr> -nmap <leader>dt :exe ':term dict -h localhost -d dict-moby-thesaurus-latest ' . expand('<cword>')<cr> - -" View function documentation -nmap <leader>dp :call fzf#run({'options': ['--preview', 'echo doc {} \| psysh \| fold -s -w 80'], 'source': "psysh-doc", 'sink': ':term psysh-doc', 'down': '50%'})<cr> - -" Jump to line -nmap <leader>jl :norm yaW<cr> \| :Jump<cr> - -" Load and save sessions -nmap <leader>sl :source ~/.vim/sessions/session.vim \| :source ~/.vimrc<cr> -nmap <leader>ss :silent! exe "!~/.vim/hooks/pre-session-save && notify-send 'Vim session saved.'" \| :mksession! ~/.vim/sessions/session.vim \| :redraw!<cr> - -" Toggle Spell Check -nmap <leader>sp :set spell!<cr> - -" Sort lines by length -vnoremap <leader>sn !perl -e 'print sort { length($a) <=> length($b) } <>'<cr> - -" Switch between tabs and spaces -nmap <leader>ses :set tabstop=2 softtabstop=0 shiftwidth=2 smarttab expandtab \| :%retab!<cr> -nmap <leader>set :set tabstop=2 softtabstop=0 shiftwidth=2 smarttab noexpandtab \| :%retab!<cr> - -" Close buffer and window -nmap <leader>q :bd<cr> -nmap <leader>w <C-w>c<cr> - -" Re-indent entire file -nmap <leader>re gg=G<C-o><C-o> - -" Reset all settings and source configuration. -nmap <leader>ra :set all& \| :source ~/.vimrc \| :e<cr> - -" Remove duplicate lines -vnoremap <leader>rd !awk '\!visited[$0]++'<cr> - -" Toggle color column -nmap <leader>cv :exe "set colorcolumn=" . (&colorcolumn == "" ? "80" : "")<cr> - -" Toggle cursor column -nmap <leader>cx :set cursorcolumn!<cr> - -" Transliterate special characters to ascii -nmap <leader>ce :silent! %s/–/--/g<cr> \| :silent! %s/—/---/g<cr> \| my \| :%!iconv -f utf-8 -t ascii//translit<cr>'y - -" Use typographic characters -nmap <leader>cl :call TypographyFormat()<cr> - -" Toggle line numbers -nmap <leader>cn :set number!<cr> - -" Justify columns -vnoremap <leader>ct !column -t -o' '<cr> - -" Fold text -vnoremap <leader>cf <S-J><S-v> \| !fold -s -w<space> - -" Go to scratchpad of specified filetype -noremap <leader>cs :w !cat > $HOME/.cache/vim-scratchpad<cr>:e +setf\ <space>$HOME/.cache/vim-scratchpad<C-left><left> - -" File open mappings -let g:fzf_layout = { 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 } } -nmap <Tab> :Buffers<cr> -nmap <leader>ov :Lines<cr> -nmap <leader>ob :BLines<cr> -nmap <leader>op :History<cr> -nmap <leader>oc :History:<cr> -nmap <leader>ol :Locate<space> -nmap <leader>ot :exe '!$TERMINAL -cd ' . expand('%:p:h') . ' &'<cr><cr> -nmap <leader>of :call fzf#run({'options': [], 'source': "cat $FZF_FILE_MARKS", 'sink': 'e', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr><cr> -nmap <leader>od :call fzf#run({'options': ['--preview', 'ls {}'], 'source': "cut -d' ' -f3 $FZF_DIRECTORY_MARKS", 'sink': 'cd', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr><cr> -nmap <leader>oo :call fzf#run({'options': ['--preview', 'highlight -O ansi --force {}'], 'source': 'rg --files --hidden \|\| find . -type f -printf "%P\n"', 'sink': 'e', 'window': { 'xoffset': 0, 'yoffset': 1, 'width': 1, 'height': 0.5 }})<cr> - -" Mappings for nnn -nmap <leader>nm :NnnPicker<cr> -nmap <leader>nn :NnnPicker '%:p:h'<cr> - -" Exit incremental search -nmap <Esc><Esc> :nohl<cr> - -" Disable Ex Mode -nnoremap Q <Nop> - -" Split window mappings -nmap <Bslash> :vsplit<cr> -nmap <C-Bslash> :split<cr> -nmap <C-j> :resize +5<cr> -nmap <C-k> :resize -5<cr> -nmap <C-h> :vertical resize +5<cr> -nmap <C-l> :vertical resize -5<cr> - -" Inverse Tabs -inoremap <S-Tab> <C-d> - -" Retain visual selection when tabbing -vnoremap < <gv -vnoremap > >gv - -" Prevent cursor from jumping in visual select context https://ddrscott.github.io/blog/2016/yank-without-jank/ -vnoremap <expr>y "my\"" . v:register . "y`y" - - -"---------------Plugin Settings---------------" - -let g:netrw_banner=0 " Disable netrw banner. - -let g:nnn#command = 'nnn -H' " Override default command. -let g:nnn#set_default_mappings = 0 " Disable default mappings. -let g:nnn#layout = 'new' " Opens the nnn window in a split. -let g:nnn#layout = { 'left': '~20%' } " Left 20% of the window. - - -"-------------------Scripts-------------------" - -" https://vi.stackexchange.com/questions/14300/vim-how-to-send-entire-line-to-a-buffer-of-type-terminal -function s:repl(start, end, language) - let g:terminal_buffer = get(g:, 'terminal_buffer', -1) - if g:terminal_buffer == -1 || !bufexists(g:terminal_buffer) - terminal ++rows=10 - let g:terminal_buffer = bufnr('') - call term_sendkeys(g:terminal_buffer, a:language . "; exit" . "\<cr>") - wincmd p - elseif bufwinnr(g:terminal_buffer) == -1 - exe 'sbuffer ' . g:terminal_buffer - wincmd p - endif - call term_sendkeys(g:terminal_buffer, join(getline(a:start, a:end), "\<cr>") . "\<cr>") -endfunction - -" Jump to line and column in the format 123:13 -function s:cursor(selection) - wincmd p - let g:cursor_request = split(a:selection, ":") - call cursor(g:cursor_request[0], g:cursor_request[1]) -endfunction - -command! -nargs=? -range Jump call s:cursor(@*) -command! -nargs=? -range REPL call s:repl(<line1>, <line2>, <f-args>) - - -"----------------Autorun----------------" - -augroup AutoCommands - - " Clear auto commands. - autocmd! - - " Source reloads. - autocmd BufWritePost .vimrc source % | silent exe '!' . expand(g:notify) . ' ' . '''Sourcing vimrc...''' - autocmd BufWritePost plugins.vim source % | silent exe '!' . expand(g:notify) . ' ' . '''Sourcing plugins...''' - - " Linting extension post write commands. - autocmd BufWritePost *.php :call PHPFix() - autocmd BufWritePost *.js :call ESLintFix() - autocmd BufWritePost *.txt,*.md :only | :term ++rows=10 vale % - autocmd BufWritePost *.lit silent exe '!' . expand(g:notify) . ' ' . '"$(lit % 2>&1 && printf ''Literate OK: %'')"' - - " Linting file type post write commands. - autocmd FileType css autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(prettier --write --parser css % 2>&1)"' - autocmd FileType rust autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(rustfmt % 2>&1 && echo ''rustfmt OK: %'')"' - autocmd FileType json autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(jsonlint -i % 2>&1 && echo ''json OK: %'')"' - autocmd FileType haskell autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(hlint % 2>&1 && brittany --write-mode inplace % 2>&1)"' - autocmd FileType c autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(clang-format -i % 2>&1 && echo ''clang-format OK: %'')"' - autocmd FileType go autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(gofmt -w -s -e % 2>&1 && go vet % 2>&1 && echo ''gofmt OK: %'')"' - autocmd FileType awk autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(awk -g -f % 2>&1 && awk -o- -f % | sponge % && echo ''awk OK: %'')"' - autocmd FileType elixir autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(mix format % 2>&1 && echo ''Elixir Format OK: %'')" > /dev/null 2>&1' - autocmd FileType nix autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(nix-linter % 2>&1 && echo ''Nix Lint OK: %'' && nixfmt % 2>&1)" > /dev/null 2>&1' - autocmd FileType yaml autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(yaml round-trip --indent 2 --save % 2>&1 && yamllint -s % 2>&1 && echo ''yaml OK: %'')"' - autocmd FileType bash,sh autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(shellcheck -x --exclude=SC1090,SC1091 % 2>&1 && echo ''Shellcheck OK: %'')" > /dev/null 2>&1 &' - autocmd FileType sql autocmd! BufWritePost <buffer> silent exe '!' . expand(g:notify) . ' ' . '"$(sqlint % 2>&1 && pg_format -i % 2>&1 && sqlfluff lint --exclude-rules L003,L016 --dialect postgres % 2>&1 && echo ''SQL OK: %'')"' - - " File type function under cursor lookups. - autocmd FileType go noremap <buffer> <leader>df :exe ':term ++rows=10 go doc ' . expand('<cexpr>')<cr> - autocmd FileType nix noremap <buffer> <leader>df :exe ':term ++rows=10 nixos-option ' . expand('<cexpr>')<cr> - autocmd FileType elixir noremap <buffer> <leader>df :exe ':term ++rows=10 sh -c "echo ''h(' . expand('<cexpr>') . ')'' \| iex"'<cr> - - " REPL commands. - autocmd FileType go noremap <buffer> <leader>cc :REPL gore<cr> - autocmd FileType lua noremap <buffer> <leader>cc :REPL lua<cr> - autocmd FileType php noremap <buffer> <leader>cc :REPL psysh<cr> - autocmd FileType elixir noremap <buffer> <leader>cc :REPL iex<cr> - autocmd FileType sh noremap <buffer> <leader>cc :REPL dash -x<cr> - autocmd FileType rust noremap <buffer> <leader>cc :REPL evcxr<cr> - autocmd FileType nix noremap <buffer> <leader>cc :REPL nix repl<cr> - autocmd FileType bash noremap <buffer> <leader>cc :REPL bash -x<cr> - autocmd FileType python noremap <buffer> <leader>cc :REPL python<cr> - autocmd FileType perl noremap <buffer> <leader>cc :REPL perl -de0<cr> - autocmd FileType javascript noremap <buffer> <leader>cc :REPL node<cr> - autocmd FileType awk noremap <buffer> <leader>cc :term ++rows=10 ++close awk -f %<cr> - - " Formatting programs. - autocmd FileType nix set formatprg=nixfmt - autocmd FileType sh set formatprg=shfmt\ - - - " General auto commands. - autocmd BufWritePost *.tex :term ++close ++rows=10 latex-compile % - autocmd BufWritePost quotes,*.fortune silent exe '!' . expand(g:notify) . ' ' . '"$(strfile %)"' - autocmd BufWritePost $HOME/.config/chromexup/config.ini silent exe '!' . expand(g:notify) . ' ' . '"$(chromexup 2>&1)"' - autocmd BufWritePost rc.lua silent exe '!' . expand(g:notify) . ' ' . '"$(awesome -k 2>&1)"' - autocmd BufWritePost *.desktop silent exe '!' . expand(g:notify) . ' ' . '"$(desktop-file-validate % 2>&1 && echo ''OK: %'')"' - autocmd BufWritePost Xresources silent exe '!' . 'xrdb ~/.config/X11/Xresources &&' . ' ' . expand(g:notify) . ' ' . '''Reloading Xresources...''' - - " Automatically remove trailing white space on save. - autocmd InsertLeave,BufWritePre * %s/\s\+$//e - - " Automatically save file on insert and idle. - autocmd InsertLeave,CursorHold * silent! write - \| silent! exe "!~/.vim/hooks/post-save > /dev/null 2>&1 &" - \| :echo expand('%:t') '[filetype=' . &filetype . ']' - -augroup END |