Skip to content

Commit

Permalink
Merge branch 'master' of https://gitlab.com/Seirdy/dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Seirdy committed Dec 17, 2019
2 parents ce88e2e + 29315de commit 1d87812
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .config/coc/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"coc-json": ">=1.2.4",
"coc-lists": ">=1.3.6",
"coc-lua": ">=0.2.0",
"coc-markdownlint": ">=0.4.0",
"coc-markdownlint": ">=1.0.1",
"coc-marketplace": ">=1.5.0",
"coc-python": ">=1.2.6",
"coc-rls": ">=1.1.4",
Expand Down
2 changes: 1 addition & 1 deletion .config/git/config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
gpgsign = true
[core]
editor = nvim
pager = delta --dark --theme='Monokai Extended Origin' | less --tabs=2 -RFX
pager = delta --dark --theme='base16' | less --tabs=2 -RFX
commitGraph = true
[color]
ui = true
Expand Down
4 changes: 4 additions & 0 deletions .config/newsboat/urls
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ https://github.com/DavidAnson/markdownlint/commits/master/README.md.atom "git re
https://github.com/igorshubovych/markdownlint-cli/releases.atom "git repos" "Programs" "Dev"
# jq for yaml; can convert between yaml and json as well.
https://github.com/mikefarah/yq/releases.atom "git repos" "Programs" "Dev"
# sh/shfmt for shell formatting
https://github.com/mvdan/sh/commits/master.atom "git repos" "Programs" "Dev" "~shfmt changelog"
# best mail client; should with fetchmail/sendmail
https://git.sr.ht/~sircmpwn/aerc/refs/rss.xml "git repos" "Programs" "Dev" "Favorite" "~aerc refs"
# my school gave me unlimited GDrive storage, so i have to use it for *something*.
Expand Down Expand Up @@ -423,6 +425,8 @@ https://latenightlinux.com/feed/ogg "Audio" "Media" "Linux"
https://dlnxtend.com/rss "Audio" "Media" "Linux"
# Saturday Morning Linux Review
https://smlr.us/?feed=smlr-ogg "Audio" "Media" "Linux"
# On the Metal
https://feeds.transistor.fm/on-the-metal-0294649e-ec23-4eab-975a-9eb13fd94e06 "Audio" "Media" "Linux"

# Video

Expand Down
4 changes: 4 additions & 0 deletions .config/nvim/spell/en.utf-8.add
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,7 @@ Neovim's
YouCompleteMe
clickable
lol
featureful
performant
Spotify
iTunes
7 changes: 4 additions & 3 deletions .config/shell_common/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ alias battstat="upower -i /org/freedesktop/UPower/devices/battery_BAT0 | rg 'tim
alias emoj="emoji-fzf preview | fzf --preview 'emoji-fzf get --name {1}' | cut -d \" \" -f 1 | emoji-fzf get"
alias emoj-cp='emoj | wl-copy'
alias weechat-matrix='source $GHQ_ROOT/github.com/poljar/weechat-matrix/venv/bin/activate && weechat -r "/script load matrix.py; /matrix connect matrix_org"'
alias sub='tuir -s'
# Aliases that change existing commands
alias tuir='tuir --enable-media'
alias flatpak='flatpak --user'
alias ddgr='ddgr -x'
alias newsboat='echo -ne "\033]0;newsboat\007" && newsboat'
alias tldr='tldr -p'
alias tuir='tuir --enable-media'
alias sub='tuir -s'
alias tldr='tldr'
alias glances='glances --disable-webui --disable-bg --disable-check-update'

# mpd stuff
Expand Down
8 changes: 8 additions & 0 deletions .config/shell_common/zsh/zplugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ zplugin light sdushantha/kunst
zi_program has'perl' pick'inxi'
zplugin light smxi/inxi

zi_program has'grim' pick'grimshot'
zplugin light $GHQ_ROOT/github.com/swaywm/sway/contrib

# }}}

# Git extensions {{{
Expand All @@ -135,6 +138,8 @@ zi0a
zplugin light wfxr/emoji-cli

# has ICE-selector wait'0b' so it gets loaded after diff-so-fancy
export FORGIT_GI_REPO_LOCAL="$XDG_DATA_HOME/forgit/gi/repos/dvcs/gitignore"

zi0b has'fzf' pick'forgit.plugin.zsh'
zplugin light wfxr/forgit

Expand Down Expand Up @@ -205,6 +210,9 @@ zplugin snippet $GHQ_ROOT/github.com/ytdl-org/youtube-dl/youtube-dl.zsh
zi_completion has'podman'
zplugin snippet $GOPATH/src/github.com/containers/libpod/completions/zsh/_podman

zi_completion has'mpv'
zplugin snippet https://github.com/mpv-player/mpv/blob/master/etc/_mpv.zsh

zi_completion pick'src/go' src'src/zsh'
zplugin light zchee/zsh-completions

Expand Down
18 changes: 11 additions & 7 deletions .config/sway/config_master
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ set $up k
set $right l
# Your preferred terminal emulator
set $term kitty
# Your preferred application launcher
bindsym $mod+z exec --no-startup-id kitty --class launcher sway-launcher
bindsym $mod+d exec --no-startup-id kitty --class launcher app-launcher

# launchers
bindsym $mod+z exec sway-launcher
bindsym $mod+d exec app-launcher
bindsym Mod1+Tab exec window-switcher
for_window [app_id="^launcher$"] floating enable
for_window [app_id="^org.keepassxc.KeePassXC$"] floating enable
for_window [app_id="^pavucontrol-qt$"] floating enable
Expand Down Expand Up @@ -125,10 +127,11 @@ input * {
# bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad

# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
set $playerctl LD_LIBRARY_PATH="$HOME/.local/lib/:$LD_LIBRARY_PATH" GI_TYPELIB_PATH="$HOME/.local/lib/:$GI_TYPELIB_PATH" playerctl
bindsym XF86AudioPlay exec $playerctl play-pause
bindsym XF86AudioPause exec $playerctl pause
bindsym XF86AudioNext exec $playerctl next
bindsym XF86AudioPrev exec $playerctl previous

#
# Moving around:
Expand Down Expand Up @@ -260,3 +263,4 @@ bar {
inactive_workspace #32323200 #32323200 #5c5c5c
}
status_command i3status-rs ~/.config/sway/status.toml
icon_theme Papirus-Dark
6 changes: 5 additions & 1 deletion .local/bin/app-launcher
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env dash

# launcher for .desktop files; used with app-runner script
cmd=$(SHELL=$HOME/.local/bin/app-runner j4-dmenu-desktop --dmenu=fzf | sed -n 2p)

# see my `term-dmenu` script in ~/.local/bin
dmenu_program=term-dmenu

cmd="$(SHELL=$HOME/.local/bin/app-runner j4-dmenu-desktop --dmenu=$dmenu_program | sed -n 2p)"
[ -n "$cmd" ] && swaymsg exec "$cmd"

# vi:ft=sh
Expand Down
4 changes: 3 additions & 1 deletion .local/bin/grim-window
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env dash
grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" "$@"
grim -g \
"$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)" \
"$@"
# vi:ft=sh
93 changes: 28 additions & 65 deletions .local/bin/sway-launcher
Original file line number Diff line number Diff line change
@@ -1,105 +1,68 @@
#!/usr/bin/env dash

# The following script is based on:
# POSIX-compliant shell script to replace dmenu/rofi's command-running
# functionality. Based on:
# https://gitlab.com/FlyingWombat/my-scripts/blob/a0cb5717777c1587af381004aa8fb048206bee55/sway-launcher
# terminal application launcher for sway, using fzf

# original command:

# Based on: https://github.com/swaywm/sway/issues/1367

# bindsym $altkey+space exec termite --name=launcher -e \

# "bash -c 'compgen -c | sort -u | fzf --no-extended --print-query | \

# tail -n1 | xargs -r swaymsg -t command exec'"

# printf "\033]0;Menu\007"
# Pick your preferred dmenu-like program. It should not do any sorting.
dmenu_program='term-dmenu --no-extended --print-query --no-sort'

HIST_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/sway-launcher-history.txt"

# Get shell command list

# This may include the occasional non-executable file

# shellcheck disable=SC2046 # word-splitting isn't an issue here.
command_list=$(stest -flx $(echo "$PATH" | tr : ' ' | sort -u))

# read existing command history

if [ -f "$HIST_FILE" ]; then

command_history=$(cat "$HIST_FILE")

else

command_history=""

fi

# search command list

command_str=$(printf "%s\n" "${command_history}" "${command_list}" \
| sed -E 's/^[0-9]+ (.+)$/\1/' \
| fzf --no-extended --print-query --no-sort \
| $dmenu_program \
| tail -n1) || exit 1

if [ "$command_str" = "" ]; then

exit 1

fi

# echo "Command: $command_str"

# using \E flag from perl regex

test "${command_str#*\\E}" != "$command_str" && echo "command can't contain '\E'"

test "${command_str#*\\E}" != "$command_str" && exit 1

# get full line from history (with count number)

hist_line=$(echo "$command_history" | grep -Pe "^[0-9]+ \Q$command_str\E$")

# echo "Hist Line: $hist_line"

if [ "$hist_line" = "" ]; then

hist_count=1

else

# Increment usage count

hist_count=$(echo "$hist_line" | sed -E 's/^([0-9]+) .+$/\1/')

hist_count=$((hist_count + 1))

# delete line, to add updated later

# echo "Hist Before: $command_history"

command_history=$(echo "$command_history" \
| grep --invert-match -Pe "^[0-9]+ \Q$command_str\E$")

# echo "Hist After: $command_history"

fi

# update history

update_line="${hist_count} ${command_str}"

printf "%s\n" "${update_line}" "${command_history}" \
| sort --numeric-sort --reverse >"$HIST_FILE"

# echo "$update_line"
update_history() {
# get full line from history (with count number)
hist_line=$(echo "$command_history" | grep -Pe "^[0-9]+ \Q$command_str\E$")

if [ "$hist_line" = "" ]; then
hist_count=1
else
# Increment usage count
hist_count=$(echo "$hist_line" | sed -E 's/^([0-9]+) .+$/\1/')
hist_count=$((hist_count + 1))
# delete line, to add updated later
command_history=$(echo "$command_history" \
| grep --invert-match -Pe "^[0-9]+ \Q$command_str\E$")
fi

# update history
update_line="${hist_count} ${command_str}"
printf "%s\n" "${update_line}" "${command_history}" \
| sort --numeric-sort --reverse >"$HIST_FILE"
}
update_history &

# execute command

echo "$command_str"

swaymsg -t command exec "$command_str"
swaymsg -t command exec "$command_str" &

# vi:ft=sh

30 changes: 30 additions & 0 deletions .local/bin/term-dmenu
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env dash

# term-dmenu is a dmenu/rofi-dmenu replacement that launches a terminal
# emulator to filter stdin using fzf. Arguments are passed to fzf.
# By default, it uses kitty. Change this if you wish.

export FZF_DEFAULT_OPTS="$* $FZF_DEFAULT_OPTS"

# This happens in three steps:

# 1. if a named pipe for term-dmenu doesn't exist, create it
[ -p /tmp/term-dmenu ] || mkfifo /tmp/term-dmenu

# 2. export stdin, separated by newlines, so the terminal process can access it
IFS=$(printf '\n')
input=$(cat)
export input

# 3. open a floating terminal, running a shell command that does the following:.
# 3a. filter $input in fzf
# 3b. send the result to the named pipe in a detached abduco session
# shellcheck disable=SC2016 # I don't want expressions to expand
kitty --class launcher -e dash -c \
'output=$(echo "$input" | fzf); export output; abduco -rnf term-dmenu dash -c "echo \"$output\" >/tmp/term-dmenu" 2>/dev/null'

# 4. send the value from the named pipe to stdout
cat </tmp/term-dmenu

# vi:ft=sh

4 changes: 2 additions & 2 deletions .local/bin/w3m-sandbox-tor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env dash

cd "$(mktemp -d)" \
&& curl-tor "$@" >/tmp/page.html && w3m-sandbox /tmp/page.html
&& curl-tor "$@" >/tmp/page.html \
&& w3m-sandbox /tmp/page.html

# vi:ft=sh

18 changes: 18 additions & 0 deletions .local/bin/window-switcher
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env dash

# Window-switcher for SwayWM, similar to switchers typically launched with alt-tab
# based on
# https://framagit.org/roipoussiere/dotfiles/blob/6618e7a39c5d43b4b3e776afd4ee0a5c999c294a/home/.config/sway/config#L165
# and https://www.reddit.com/comments/aolf3u/_/eg6twfh

dmenu_program=term-dmenu

swaymsg -t get_tree \
| jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.type=="con"),select(.type=="floating_con")|(.id|tostring)+" "+.app_id+": "+.name' \
| grep -v '^[0-9]* \: $' \
| $dmenu_program \
| awk '{print $1}' \
| xargs -I % swaymsg '[con_id="%"] focus'

# vi:ft=sh

12 changes: 1 addition & 11 deletions .local/share/weechat/.weerc
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
#
# WeeChat 2.7-rc1 (compiled on Dec 6 2019 14:16:36)
# WeeChat 2.8-dev (compiled on Dec 15 2019 12:51:43)
#
# Use /autoconf load or cat this file to the FIFO pipe.
#
# For more info, see https://weechat.org/scripts/source/autoconf.py.html
#

*/set Option changed: weechat.look.mouse on
*/set Option changed: weechat.bar.buflist.items "buflist"
*/set Option changed: weechat.bar.fset.items "fset"
*/set Option changed: weechat.bar.input.items "mode_indicator+[input_prompt]+(away),[input_search],[input_paste],input_text,[vi_buffer]"
*/set Option changed: weechat.bar.nicklist.items "chatters,buffer_nicklist"
*/set Option changed: weechat.bar.status.items "matrix_typing_notice,[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes),scroll,[lag],[hotlist],completion"
*/set Option changed: weechat.bar.vi_line_numbers.items "line_numbers"
*/set Option changed: exec.command.shell "sh"
*/set Option changed: script.look.sort "d"
*/set Option changed: matrix.server.matrix_org.address "matrix.org"
*/set weechat.look.mouse on
*/set weechat.bar.buflist.items "buflist"
*/set weechat.bar.fset.items "fset"
Expand Down
1 change: 0 additions & 1 deletion Executables/shell-scripts/bootstrap/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ cargo_install_git https://github.com/Y2Z/monolith.git
cargo_install_git https://github.com/anordal/shellharden.git
cargo_install_git https://github.com/chmln/sd.git
cargo_install_git https://github.com/dandavison/delta.git
cargo_install_git https://github.com/dbrgn/tealdeer.git
cargo_install_git https://github.com/greshake/i3status-rust.git
cargo_install_git https://github.com/jameslzhu/roflcat.git
cargo_install_git https://github.com/lunaryorn/mdcat.git
Expand Down
2 changes: 2 additions & 0 deletions Executables/shell-scripts/bootstrap/sudo-dnf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ dnf install ${packages[*]} --allowerasing --skip-broken -y
iptables -I INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -I INPUT -p udp --dport 60000:61000 -j ACCEPT

echo 'Initial bootstrap finished. After running "update-all" successfully, uninstall stack and cargo'

end_time=$(date '+%s')
elapsed=$(echo "$end_time - $start_time" | bc)
echo "Time elapsed: $elapsed seconds"
2 changes: 1 addition & 1 deletion Executables/shell-scripts/updates/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ GO111MODULE=on go_update github.com/schollz/croc/v6
# Pager for log files
go_update github.com/tigrawap/slit/cmd/slit
# shell script formatter
go_update github.com/mvdan/sh/cmd/shfmt
GO111MODULE=on go_update mvdan.cc/sh/v3/cmd/shfmt
# like jq but for yaml
GO111MODULE=on go_update github.com/mikefarah/yq/v2
# curlie: better than httpie
Expand Down
Loading

0 comments on commit 1d87812

Please sign in to comment.