small pixel drawing of a pufferfish dotfiles

Merge branch 'master'
Jes Olson j3s@c3f.net
Sun, 31 Jul 2022 19:43:54 -0500
commit

54584e00aacf4492d481c8b85f8607fe4032d41a

parent

cc9610a65dc0b09bb01133dfa1d7a23ce2605ad8

M .config/git/config.config/git/config

@@ -1,4 +1,5 @@

[advice] + addIgnoredFile = false detachedhead = false [alias] s = status

@@ -37,9 +38,11 @@ name = Jes Olson

email = j3s@c3f.net [pull] ff = only -[includeIf "gitdir:~/do/"] - path = ~/.config/git/config-work +[push] + autoSetupRemote = true [pager] status = true [init] defaultBranch = main +[includeIf "gitdir:~/do/"] + path = ~/.config/git/config-work
M .config/git/config-work.config/git/config-work

@@ -3,5 +3,7 @@ name = Jes Olson

email = jolson@digitalocean.com [changelog] format = * %s [%an] -[url "git@github.internal.digitalocean.com:"] +[url "ssh://git@github.com/"] + insteadOf = https://github.com/ +[url "ssh://git@github.internal.digitalocean.com/"] insteadOf = https://github.internal.digitalocean.com/
M .config/kanshi/config.config/kanshi/config

@@ -4,6 +4,16 @@ }

profile { output eDP-1 disable + output DP-1 enable +} + +profile { + output eDP-1 disable + output DP-4 enable +} + +profile { + output eDP-1 disable output DP-2 mode 1920x1080 position 0,0 output HDMI-A-1 mode 1920x1080 position 1920,0 }
M .config/nvim/init.vim.config/nvim/init.vim

@@ -6,6 +6,8 @@ Plug 'vhyrro/neorg'

Plug 'hrsh7th/nvim-compe' Plug 'ctrlpvim/ctrlp.vim' Plug 'cormacrelf/vim-colors-github' +Plug 'dewyze/vim-tada' +Plug 'tidalcycles/vim-tidal' call plug#end() colorscheme github

@@ -98,3 +100,6 @@

" bindings let mapleader = "," nmap <leader>m Go<esc>:put =strftime(\"%Y-%m-%d\")<cr>o----------------<cr><esc> + +" use neovim's own terminal instead of tmux: +let g:tidal_target = "terminal"
A .config/sway/colorscheme

@@ -0,0 +1,19 @@

+## Base16 Default Dark +# Author: Chris Kempson (http://chriskempson.com) + +set $base00 #181818 +set $base01 #282828 +set $base02 #383838 +set $base03 #585858 +set $base04 #b8b8b8 +set $base05 #d8d8d8 +set $base06 #e8e8e8 +set $base07 #f8f8f8 +set $base08 #ab4642 +set $base09 #dc9656 +set $base0A #f7ca88 +set $base0B #a1b56c +set $base0C #86c1b9 +set $base0D #7cafc2 +set $base0E #ba8baf +set $base0F #a16946
M .config/sway/config.config/sway/config

@@ -1,63 +1,21 @@

-# Default config for sway -# -# Copy this to ~/.config/sway/config and edit it to your liking. -# -# Read `man 5 sway` for a complete reference. - -### Variables -# -# Logo key. Use Mod1 for Alt. +# vars set $mod Mod4 -# Home row direction keys, like vim set $left h set $down j set $up k set $right l -# Your preferred terminal emulator set $term foot -### Output configuration -# -# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) -# output * bg /home/j3s/Pictures/wallpapers/widelain.jpg fill -# -# Example configuration: -# -# output HDMI-A-1 resolution 1920x1080 position 1920,0 -# -# You can get the names of your outputs by running: swaymsg -t get_outputs +set $wssteam "steam" +set $wsdota2 "dota2" +set $wssuperautopets "super auto pets" + output DP-1 disable +# qweh? # output HDMI-A-2 position 1920,215 resolution 2560x1440@170hz # output HDMI-A-1 position 0,395 resolution 1920x1080@74hz # output HDMI-A-2 position 4480,0 resolution 1920x1080@74hz transform 90 -### Idle configuration -# -# Example configuration: -# -#exec swayidle -w \ -# timeout 300 'swaylock -f -c 000000' \ -# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ -# before-sleep 'swaylock -f -c 000000' -# -# This will lock your screen after 300 seconds of inactivity, then turn off -# your displays after another 300 seconds, and turn your screens back on when -# resumed. It will also lock your screen before your computer goes to sleep. - -### Input configuration -# -# Example configuration: -# -# input "2:14:SynPS/2_Synaptics_TouchPad" { -# dwt enabled -# tap enabled -# natural_scroll enabled -# middle_emulation enabled -# } -# -# You can get the names of your inputs by running: swaymsg -t get_inputs -# Read `man 5 sway-input` for more information about this section. - input "type:keyboard" { xkb_layout us xkb_options ctrl:nocaps

@@ -68,48 +26,35 @@ scroll_method on_button_down

scroll_button 275 } -### Key bindings -# -# Basics: -# - client.focused #4c7899 #000000 #000000 #2e9ef4 #97f0a6 - for_window [title="^weallfloatdownhere$"] floating enable, border pixel +# default workspaces +assign [class="^Steam$"] $wssteam +assign [class="^dota2$"] $wsdota2 +assign [class="^superautopets.x86_64$"] $wssuperautopets - # Start a terminal - bindsym $mod+Return exec $term +# layout options +for_window [title="^weallfloatdownhere$"] floating enable, border pixel - # floating terms - bindsym $mod+Shift+Return exec $term --title 'weallfloatdownhere' +for_window [app_id="^firefox$"] layout tabbed +for_window [class="^Steam$"] layout tabbed +for_window [title="Virtual Machine Manager"] layout tabbed - # Kill focused window - bindsym $mod+Shift+q kill +for_window [title="Firefox — Sharing Indicator"] floating enable +for_window [title="Firefox — Sharing Indicator"] kill - # notification management (i don't use the Delete key at all) - bindsym Delete exec makoctl dismiss - bindsym $mod+Delete exec makoctl dismiss --all - - # bind bad return presses to nothing -# bindsym Shift+Return Return - bindsym Mod1+Shift+Return Return - - # Start your launcher - bindsym $mod+d exec fuzzel - - # Password manager - bindsym $mod+Shift+p exec --no-startup-id pa-fuzzel - - # Drag floating windows by holding down $mod and left mouse button. - # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. - floating_modifier $mod normal +### keybinds ### +bindsym $mod+Return exec $term +bindsym $mod+Shift+Return exec $term --title 'weallfloatdownhere' +bindsym $mod+Shift+q kill +bindsym Delete exec makoctl dismiss +bindsym $mod+Delete exec makoctl dismiss --all +bindsym Mod1+Shift+Return Return +bindsym $mod+d exec bemenu-run -l 20 -c -W 0.2 +bindsym $mod+Shift+p exec --no-startup-id pa-bemenu +bindsym $mod+Shift+c reload +bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' - # Reload the configuration file - bindsym $mod+Shift+c reload +floating_modifier $mod normal - # Exit sway (logs you out of your Wayland session) - bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' # # Moving around: #

@@ -194,12 +139,6 @@ # bindsym $mod+a focus parent

# Float config # use swaymsg -t get_tree to find class or app_id - for_window [class="Steam"] floating enable - for_window [class="Mumble"] floating enable - for_window [class="Dino"] floating enable - for_window [title="Firefox — Sharing Indicator"] floating enable - for_window [title="Virtual Machine Manager"] floating enable - for_window [title="Firefox — Sharing Indicator"] kill # for_window [class="Dota 2"] floating enable, border none # # Scratchpad:

@@ -220,47 +159,33 @@ #

bindsym $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy -# -# Resizing containers: -# -mode "resize" { - # left will shrink the containers width - # right will grow the containers width - # up will shrink the containers height - # down will grow the containers height - bindsym $left resize shrink width 10px - bindsym $down resize grow height 10px - bindsym $up resize shrink height 10px - bindsym $right resize grow width 10px - - # Ditto, with arrow keys - bindsym Left resize shrink width 10px - bindsym Down resize grow height 10px - bindsym Up resize shrink height 10px - bindsym Right resize grow width 10px - - # Return to default mode - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+r mode "resize" +include colorscheme +client.focused $base05 $base0D $base00 $base0D $base0D +client.focused_inactive $base01 $base01 $base05 $base03 $base01 +client.unfocused $base01 $base00 $base05 $base01 $base01 +client.urgent $base08 $base08 $base00 $base08 $base08 +client.placeholder $base00 $base00 $base05 $base00 $base00 +client.background $base07 -# -# Status Bar: -# -# Read `man 5 sway-bar` for more information about this section. bar { position top # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. status_command statusbar + pango_markup enabled colors { - statusline #89CFF0 - focused_workspace #89cff0 #89cff0 #000000 - background #000000 - inactive_workspace #32323200 #32323200 #5c5c5c + background $base00 + separator $base01 + statusline $base04 + + # State Border BG Text + focused_workspace $base05 $base0D $base00 + active_workspace $base05 $base03 $base00 + inactive_workspace $base03 $base01 $base05 + urgent_workspace $base08 $base08 $base00 + binding_mode $base00 $base0A $base00 } }
M .config/sway/zora.config/sway/zora

@@ -12,7 +12,7 @@

for_window [class="Firefox"] inhibit_idle fullscreen for_window [class="Chromium"] inhibit_idle fullscreen -bindsym $mod+Shift+i exec jira-fuzzel +bindsym $mod+Shift+i exec jira-bemenu bindsym $mod+Prior exec vpn bindsym $mod+Next exec vpn kill
M .profile.profile

@@ -7,3 +7,10 @@ # https://wiki.archlinux.org/title/Firefox#Applications_on_Wayland_can_not_launch_Firefox

export MOZ_DBUS_REMOTE=1 export XDG_CURRENT_DESKTOP=sway export CHEF_USER_NAME=jolson +export DIGITALOCEAN_ACCESS_TOKEN="$(pa show cloud.digitalocean.com | head -1)" + +# this apparently makes java windows not suck +# for reasons beyond my mortal comprehension +# used for: +# - arduino ide +export _JAVA_AWT_WM_NONREPARENTING=1
M .rc.rc

@@ -2,16 +2,12 @@ #!/bin/sh

PS1='$(prompt) \$ ' - # this is a story all about how -# history control in bash sucks +# history control in bash sucks, wow HISTFILE=~/.sh_eternal_history HISTSIZE= HISTCONTROL=ignoredups:erasedups shopt -s histappend - -# # reload history on every prompt invocation -# PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" # extend pa for git stuffs # meh i don't like this at all tbh

@@ -48,3 +44,7 @@

if [ "$TERM" = "foot" ]; then alias ssh='TERM=xterm-256color ssh' fi + +# simple prompt +# for demo purposes mostly +alias sp="export PS1='$ '"
M bin/chtfbin/chtf

@@ -1,40 +1,1 @@

-#!/bin/sh -# -# list installed tf versions + -# switch terraform versions + -# + download tf if not found - -tf_version="$1" -tf_install_dir="${HOME}/.local/share/chtf" -tf_link_name="${HOME}/bin/terraform" - -# make some os assumptions -if [ "$(uname)" = "Linux" ]; then - os="linux" -else - os="darwin" -fi - -mkdir -p "$tf_install_dir" - -if [ -z "$tf_version" ]; then - # if no arguments, list versions of tf plus list symlink pointer. - printf "available:\n" - ls "$tf_install_dir" - printf "active:\n" - if [ -e "$tf_link_name" ]; then - readlink "$tf_link_name" | xargs basename - fi -else - if [ ! -f "${tf_install_dir}/${tf_version}" ]; then - # download tf version if not found - printf "terraform version not found. downloading...\n" - dl="https://releases.hashicorp.com/terraform/${tf_version}/terraform_${tf_version}_${os}_amd64.zip" - printf "downloading %s\n" "$dl" - curl -L --output /tmp/tf.zip "$dl" - unzip /tmp/tf.zip -d /tmp - mv /tmp/terraform "${tf_install_dir}/${tf_version}" - rm /tmp/tf.zip - fi - ln -sf "${tf_install_dir}/${tf_version}" "$tf_link_name" -fi +/home/j3s/code/chtf/chtf
D bin/jira-fuzzel

@@ -1,9 +0,0 @@

-#!/bin/sh -# -# this script launches fuzzel, takes a jira -# ticket, and opens it - -# upcase because jira wants that i guess -jira_id=$(printf "" | fuzzel -d | tr '[a-z]' '[A-Z]') - -xdg-open "https://jira.internal.digitalocean.com/browse/$jira_id"
A bin/nostromo/statusbar

@@ -0,0 +1,20 @@

+#!/bin/sh + +get_bat() { + bat="$(cat /sys/class/power_supply/BAT1/capacity)" + if [ "$bat" -lt 10 ]; then + printf '<span foreground="red">%s%%</span>' "$bat" + else + printf '%s%%' "$bat" + fi +} + +while true +do + time=$(date +"%A %Y-%m-%d %I:%M %p") + time="$time $(date -u +"(%H:%M UTC)")" + bat="$(get_bat)" + wifi="$(nmcli -t dev show wlp170s0 | grep GENERAL.CONNECTION | cut -d ':' -f 2)" + printf "wifi: %s | bat: %s | %s\n" "$wifi" "$bat" "$time" + sleep 10 +done
A bin/pa-bemenu

@@ -0,0 +1,15 @@

+#!/bin/sh +# +# prompt for a password via bemenu +# then type the selected password +# +# deps: +# - wtype +# - bemenu +# - pa + +cd "${PA_DIR:-$HOME/.local/share/pa}" +password_files="$(find * -type f | grep -v '/.git')" +password=$(printf '%s\n' "$password_files" | sed 's/.age//' | bemenu -c -W 0.2 -l 20 "$@") + +pa show "$password" | head -n 1 | tr -d '\n' | wtype -
D bin/pa-fuzzel

@@ -1,10 +0,0 @@

-#!/bin/sh -# -# prompt for a password, then type the selected password - -cd "${PA_DIR:-$HOME/.local/share/pa}" -password_files="$(find * -type f | grep -v '/.git')" -password=$(printf '%s\n' "$password_files" | sed 's/.age//' | fuzzel -dmenu "$@") - -pa show "$password" | head -n 1 | - wtype -
M bin/prompt.gobin/prompt.go

@@ -11,16 +11,14 @@ )

// getRepoRoot returns the full path to the root // of the closest git dir -func getRepoRoot() string { - var rootPath string - +func gitTopLevel() string { path, err := exec.Command("git", "rev-parse", "--show-toplevel").Output() if err != nil { - rootPath = "~" - } else { - rootPath = strings.TrimSpace(string(path)) + // assume the error means there's no git + // dir above us + return "/" } - return rootPath + return strings.TrimSpace(string(path)) } func resolveEmoji(hostname string) string {

@@ -34,23 +32,27 @@ return emoji

} func main() { - cwd, _ := os.Getwd() + wd, _ := os.Getwd() + cwd, _ := filepath.EvalSymlinks(wd) host, _ := os.Hostname() home := os.Getenv("HOME") now := time.Now().Format("15:04:05") emoji := resolveEmoji(host) fmt.Printf("%s %s ", now, emoji) - gitRoot := getRepoRoot() - - var prefix string - if gitRoot == home { - prefix = "~" + var promptRoot string + gitTop := gitTopLevel() + if gitTop == home { + promptRoot = "~" } else { - prefix = filepath.Base(gitRoot) + promptRoot = filepath.Base(gitTop) } - suffix := cwd[len(gitRoot):] - fmt.Printf("%s", prefix) + // subtract the git toplevel "/home/j3s" + // from the cwd "/home/j3s/code/nongitdir" + // to get the suffix "/code/nongitdir" + // os.cwd gets the symlink, git does not + suffix := cwd[len(gitTop):] + fmt.Printf("%s", promptRoot) var parts []string parts = strings.Split(suffix, "/")
M bin/volbin/vol

@@ -15,20 +15,24 @@ if [ "$vol" -gt 100 ]; then

# prevent volumes of >100% for the # good of all ears pactl set-sink-volume @DEFAULT_SINK@ 100% - notify-send '🔈 vol' --hint=int:value:100 -t 800 + notify-send '🔈 vol' --hint=int:value:100 -t 800 -h string:x-canonical-private-synchronous:anything elif [ "$vol" -lt 0 ]; then # prevent volumes of <0% for the # good of all ... dog... whateij fiwjoefj pactl set-sink-volume @DEFAULT_SINK@ 0% - notify-send '🔈 vol' --hint=int:value:0 -t 800 + notify-send '🔈 vol' --hint=int:value:0 -t 800 -h string:x-canonical-private-synchronous:anything else - notify-send '🔈 vol' --hint=int:value:"$vol" -t 800 + notify-send '🔈 vol' --hint=int:value:"$vol" -t 800 -h string:x-canonical-private-synchronous:anything fi } case "$1" in - ls|list) pactl list short sinks ;; - set) pactl set-default-sink "$2" ;; + ls|list) + pactl list short sinks | awk '{print $1" "$2}' + ;; + set|use) + pactl set-default-sink "$2" + ;; [0-9]*) pactl set-sink-volume @DEFAULT_SINK@ "$1"% notify_current_volume

@@ -42,5 +46,8 @@ down)

pactl set-sink-volume @DEFAULT_SINK@ -"$2"% notify_current_volume ;; - *) ;; + *) + printf "unknown command\n" + exit 1 + ;; esac
A bin/zora/drosh

@@ -0,0 +1,1 @@

+/home/j3s/code/drosh/drosh
A bin/zora/jira-bemenu

@@ -0,0 +1,10 @@

+#!/bin/sh -e +# +# this script launches fuzzel, takes a jira +# ticket, and opens it + +# upcase because jira wants that i guess +jira_id=$(printf "" | bemenu -c -W 0.2 | tr '[a-z]' '[A-Z]') +[ "$jira_id" = "" ] && exit 1 + +xdg-open "https://jira.internal.digitalocean.com/browse/$jira_id"