Merge remote-tracking branch 'origin/lappy' into wip-refactor

This commit is contained in:
Daniel Flanagan 2020-01-08 13:32:56 -06:00
commit d80a823ce2
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
27 changed files with 619 additions and 30 deletions

View file

@ -5,7 +5,7 @@ source "$HOME/.bashrc"
# NO_COMPTON=1 # NO_COMPTON=1
BORDER_WIDTH=5 # change in bspwm_config, here for launcher BORDER_WIDTH=5 # change in bspwm_config, here for launcher
START_BAR=1 START_BAR=1
BAR_COMMAND="$DOTFILES_PATH/apps/de/bar/bar.bash" BAR_COMMAND="$DOTFILES_PATH/apps/de/polybar/run"
if [[ -z "$XDG_CONFIG_HOME" ]]; then if [[ -z "$XDG_CONFIG_HOME" ]]; then
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"

View file

@ -1,6 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# allows bspwm to reload when killed bspwm
while true; do
bspwm || break
done

View file

@ -5,4 +5,5 @@ Section "InputClass"
MatchIsTouchpad "on" MatchIsTouchpad "on"
Option "Tapping" "on" Option "Tapping" "on"
Option "NaturalScrolling" "true" Option "NaturalScrolling" "true"
Option "DisableWhileTyping" "false"
EndSection EndSection

4
apps/de/mako/config Normal file
View file

@ -0,0 +1,4 @@
max-visible=5
default-timeout=30000
background-color=#111111
border-color=#666666

View file

@ -387,7 +387,7 @@ margin-bottom = ${env:WINDOW_GAP:0}
[module/microphone] [module/microphone]
type = custom/script type = custom/script
exec = $DOTFILES_PATH/apps/de/bar/mic.bash exec = $DOTFILES_PATH/apps/de/polybar/mic.bash
tail = true tail = true
format = <label> format = <label>
label-foreground = ${colors.icon} label-foreground = ${colors.icon}

View file

@ -23,8 +23,8 @@ export POS_Y=0
# allow a per-device config to override options # allow a per-device config to override options
echo "$EDFP" echo "$EDFP"
if [ -f "$EDFP/bar" ]; then if [ -f "$EDFP/polybar" ]; then
source "$EDFP/bar" source "$EDFP/polybar"
fi fi
export MONITOR_WIDTH=$(xrandr | grep "^$BAR_MONITOR " | grep -Po ' \d+' | head -n 1) export MONITOR_WIDTH=$(xrandr | grep "^$BAR_MONITOR " | grep -Po ' \d+' | head -n 1)

131
apps/de/sway/config Normal file
View file

@ -0,0 +1,131 @@
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term kitty
# TODO: launcher for wayland
# set $menu app-launcher
set $menu dmenu_path | dmenu | xargs swaymsg exec --
output * bg $HOME/.wallpaper fill
# TODO: configured displays?
# output eDP-1 res 3200x1800 pos 0 0 scale 2
# output DP-3 res 3440x1440 pos 1600 0
### 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.
bindsym $mod+Return exec $term
bindsym $mod+t exec $term
bindsym $mod+c kill
bindsym $mod+Space exec $menu
bindsym $mod+Shift+r reload
bindsym $mod+Control+Escape exit
bindsym $mod+Shift+e exit
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# TODO: this should nudge if floating?
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
floating_modifier $mod normal
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+b splith
bindsym $mod+v splitv
bindsym $mod+e layout toggle split
bindsym $mod+Shift+f fullscreen
bindsym $mod+f floating toggle
bindsym $mod+Alt+f focus mode_toggle
bindsym $mod+p focus parent
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
mode "resize" {
bindsym $left resize shrink width 10 px or 10 ppt
bindsym $down resize grow height 10 px or 10 ppt
bindsym $up resize shrink height 10 px or 10 ppt
bindsym $right resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
}
default_border none
# bindsym $mod+r mode "resize"
# man 5 sway-bar
bar {
swaybar_command waybar
}
input * {
repeat_delay 200
repeat_rate 60
}
focus_follows_mouse no
# include /etc/sway/config.d/*
include $EDFP/sway/config.d/*

View file

@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
killall -9 urxvtd # killall -9 urxvtd
urxvtd & # urxvtd &
# key repeat # key repeat
export WLC_REPEAT_DELAY=200 export WLC_REPEAT_DELAY=200
@ -14,5 +14,11 @@ export XKB_DEFAULT_OPTIONS=caps:escape
export QT_QPA_PLATFORM=wayland-egl export QT_QPA_PLATFORM=wayland-egl
export CLUTTER_BACKEND=wayland export CLUTTER_BACKEND=wayland
export SDL_VIDEODRIVER=wayland export SDL_VIDEODRIVER=wayland
export MOZ_ENABLE_WAYLAND=1
# configuration flag for some of my dotfiles scripts
export IS_WAYLAND=1
exec mako
sway sway

158
apps/de/waybar/config Normal file
View file

@ -0,0 +1,158 @@
{
"layer": "top", // Waybar at top layer
"position": "bottom", // Waybar position (top|bottom|left|right)
"height": 32, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": [
// "mpd",
// "idle_inhibitor",
"pulseaudio",
"network",
"cpu",
"memory",
"temperature",
"backlight",
"battery",
// "battery#bat2",
"clock",
"tray"
],
"sway/workspaces": {
"disable-scroll": false,
"all-outputs": true,
"format": "{name}: {icon}",
"format-icons": {
"1": "",
"2": "龜",
"3": "",
"4": "",
"5": "",
"urgent": "",
"focused": "",
"default": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"interval": 1,
"format": "{:%a %b %d %H:%M:%S}"
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}
}

188
apps/de/waybar/style.css Normal file
View file

@ -0,0 +1,188 @@
* {
border: none;
border-radius: 0;
/* `otf-font-awesome` is required to be installed for icons */
font-family: "Iosevka", Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
min-height: 0;
}
window#waybar {
background-color: #111111;
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
#workspaces button {
padding: 0 0.75em;
background-color: transparent;
color: #ffffff;
}
#workspaces button:hover {
/*
* background: rgba(0, 0, 0, 0.2);
* box-shadow: inherit;
*/
}
#workspaces button.focused {
background-color: #333333;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 0.75em;
color: #ffffff;
}
#clock {
/* background-color: #64727D; */
}
#battery {
/* background-color: #ffffff; */
/* color: #000000; */
}
#battery.charging {
/* color: #ffffff; */
/* background-color: #26A65B; */
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#cpu {
/* background-color: #2ecc71; */
/* color: #000000; */
}
#memory {
/* background-color: #9b59b6; */
}
#backlight {
/* background-color: #90b1b1; */
}
#network {
/* background-color: #2980b9; */
}
#network.disconnected {
/* background-color: #f53c3c; */
}
#pulseaudio {
/* background-color: #f1c40f; */
/* color: #000000; */
}
#pulseaudio.muted {
/* background-color: #90b1b1; */
/* color: #2a5c45; */
}
#custom-media {
/* background-color: #66cc99; */
/* color: #2a5c45; */
/* min-width: 100px; */
}
#custom-media.custom-spotify {
/* background-color: #66cc99; */
}
#custom-media.custom-vlc {
/* background-color: #ffa000; */
}
#temperature {
/* background-color: #f0932b; */
}
#temperature.critical {
/* background-color: #eb4d4b; */
}
#tray {
/* background-color: #2980b9; */
}
#idle_inhibitor {
/* background-color: #2d3436; */
}
#idle_inhibitor.activated {
/* background-color: #ecf0f1; */
/* color: #2d3436; */
}
#mpd {
/* background-color: #66cc99; */
/* color: #2a5c45; */
}
#mpd.disconnected {
/* background-color: #f53c3c; */
}
#mpd.stopped {
/* background-color: #90b1b1; */
}
#mpd.paused {
/* background-color: #51a37a; */
}

View file

@ -5,11 +5,11 @@ sort_key=2
sort_direction=1 sort_direction=1
hide_threads=0 hide_threads=0
hide_kernel_threads=1 hide_kernel_threads=1
hide_userland_threads=1 hide_userland_threads=0
shadow_other_users=0 shadow_other_users=0
show_thread_names=0 show_thread_names=0
show_program_path=0 show_program_path=1
highlight_base_name=1 highlight_base_name=0
highlight_megabytes=1 highlight_megabytes=1
highlight_threads=1 highlight_threads=1
tree_view=0 tree_view=0
@ -20,7 +20,8 @@ update_process_names=0
account_guest_in_cpu_meter=0 account_guest_in_cpu_meter=0
color_scheme=0 color_scheme=0
delay=15 delay=15
left_meters=LeftCPUs2 Memory Swap left_meters=AllCPUs Memory Swap
left_meter_modes=1 1 1 left_meter_modes=1 1 1
right_meters=RightCPUs2 Tasks LoadAverage Uptime right_meters=RightCPUs2 Tasks LoadAverage Uptime
right_meter_modes=1 2 2 2 right_meter_modes=1 2 2 2
vim_mode=1

View file

@ -5,7 +5,7 @@ bold_italic_font Iosevka Term Bold Italic
font_size 11.0 font_size 11.0
adjust_line_height 0 adjust_line_height 0
window_padding_width 18.0 window_padding_width 5.0
window_margin_width 0.0 window_margin_width 0.0
enable_audio_bell no enable_audio_bell no

View file

@ -105,7 +105,7 @@ highlight GitGutterChangeDelete ctermbg=black guibg=black
hi NonText ctermfg=black guifg=black hi NonText ctermfg=black guifg=black
set hidden " allows buffer switching without saving set hidden " allows buffer switching without saving
set shortmess=Ia " hide vim intro, skip lots of file messages/prompts set shortmess+=Ia " hide vim intro, skip lots of file messages/prompts
set history=1000 set history=1000
" undo files " undo files

View file

@ -120,6 +120,8 @@ alias sctlu="systemctl --user"
alias logs="sudo journalctl" alias logs="sudo journalctl"
alias logsr="sudo journalctl -r" alias logsr="sudo journalctl -r"
alias logsf="sudo journalctl -f" alias logsf="sudo journalctl -f"
alias bt="sudo bluetoothctl"
alias btctl="bt"
alias btctl="sudo bluetoothctl" alias btctl="sudo bluetoothctl"
alias pbcopy="clip" alias pbcopy="clip"
alias pt="htop -t" # experimental htop tree-view-by-default alias pt="htop -t" # experimental htop tree-view-by-default

View file

@ -12,9 +12,9 @@ NICE_HOME="$HOME"
# TODO: better logic for auto-detecting alternative home directories? # TODO: better logic for auto-detecting alternative home directories?
# 1. check dirname(basename $HOME)) matches username # 1. check dirname(basename $HOME)) matches username
# 2. check /home/$username # 2. check /home/$username
[[ $(basename "${HOME}") = "usr" ]] && NICE_HOME="$(realpath "$HOME/..")"
[[ $(basename "${HOME}") = ".home" ]] && NICE_HOME="$(realpath "$HOME/..")" [[ $(basename "${HOME}") = ".home" ]] && NICE_HOME="$(realpath "$HOME/..")"
# TODO: nice home explicitly definable on a per-device (env) basis [[ -e "${HOME}/.nice_home" ]] && NICE_HOME="$(cat "${HOME}/.nice_home")"
[[ -e "${EDFP}/.nice_home" ]] && NICE_HOME="$(cat "${EDFP}/.nice_home")"
export NICE_HOME export NICE_HOME
export NOTES_DIR="$NICE_HOME/doc/notes" export NOTES_DIR="$NICE_HOME/doc/notes"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$DOTFILES_PATH/apps/de/bar/bar.bash" --just-vars source "$DOTFILES_PATH/apps/de/polybar/run" --just-vars
LAUNCHER_FONT="$BAR_FONT" LAUNCHER_FONT="$BAR_FONT"
LAUNCHER_FONT_SIZE="$BAR_FONT_SIZE" LAUNCHER_FONT_SIZE="$BAR_FONT_SIZE"

16
bin/fsw
View file

@ -40,21 +40,32 @@ ${I}${I}${I}'.*' /etc/secrets \$HOME/.secrets
USAGE USAGE
} }
dbg() {
if [[ ! -z ${FSW_DEBUG+x} ]]; then
echo -e "[debug] fsw: $@"
fi
}
if [[ $1 = '-h' ]] || [[ $1 = '--help' ]] || [[ -z $1 ]]; then if [[ $1 = '-h' ]] || [[ $1 = '--help' ]] || [[ -z $1 ]]; then
help help
exit 0 exit 0
fi fi
FSW_EVENTS="${FSW_EVENTS:-close_write}" FSW_EVENTS="${FSW_EVENTS:-close_write}"
dbg "Events: $FSW_EVENTS"
SHELL_COMMAND="${1}"; shift SHELL_COMMAND="${1}"; shift
dbg "Command: $SHELL_COMMAND"
FILTER="${1}"; shift FILTER="${1}"; shift
dbg "Filter: $FILTER"
dbg "Directory: ${1}"
DIRS=("${1:-.}"); shift DIRS=("${1:-.}"); shift
if [[ -e $FILTER ]]; then if [[ -e $FILTER ]]; then
# TODO: this is a sad hack/workaround # TODO: this is a sad hack/workaround
echo "It looks like your filter is an actual file. I'll just watch that for you." echo "It looks like your filter is an actual file. I'll just watch that for you."
DIRS=("${FILTER}") DIRS=("${FILTER}")
fi fi
while [[ ! -z $1 ]]; do while [[ ! -z $1 ]] && $(realpath $1) &> /dev/null; do
dbg "Directory: ${1}"
DIRS+=("$1"); shift DIRS+=("$1"); shift
done done
inotifywait -m -e "${FSW_EVENTS}" -r "${DIRS[@]}" 2>&1 \ inotifywait -m -e "${FSW_EVENTS}" -r "${DIRS[@]}" 2>&1 \
@ -62,12 +73,15 @@ inotifywait -m -e "${FSW_EVENTS}" -r "${DIRS[@]}" 2>&1 \
| while read -r dir events filename; do | while read -r dir events filename; do
if [[ "$dir $events" = "Watches established." ]]; then if [[ "$dir $events" = "Watches established." ]]; then
echo "Ready." echo "Ready."
dbg "Directory: ${DIRS[@]}"
else else
export FSW_FILENAME="$filename" export FSW_FILENAME="$filename"
export FSW_DIR="$dir" export FSW_DIR="$dir"
export FSW_PATH="$dir$filename" export FSW_PATH="$dir$filename"
export FSW_FILE_EVENTS="$events" export FSW_FILE_EVENTS="$events"
export FSW_EVENT="$events $dir$filename" export FSW_EVENT="$events $dir$filename"
dbg "Event:\n $(date)\n $FSW_PATH\n $FILTER\n $FSW_EVENT\n $dir $events $filename\n ${SHELL_COMMAND}"
dbg "Filtered Event: $(<<< "$FSW_PATH" grep -P "$FILTER")"
<<< "$FSW_PATH" grep -P "$FILTER" > /dev/null 2>&1 && eval "${SHELL_COMMAND}" <<< "$FSW_PATH" grep -P "$FILTER" > /dev/null 2>&1 && eval "${SHELL_COMMAND}"
fi fi
done done

View file

@ -38,6 +38,7 @@ pacaur --needed -S \
gtk-engine-murrine xorg-server-devel `# GTK Theme Base and Headers?` \ gtk-engine-murrine xorg-server-devel `# GTK Theme Base and Headers?` \
bspwm-git sxhkd-git xdo-git `# Window Manager and Tools for its use` \ bspwm-git sxhkd-git xdo-git `# Window Manager and Tools for its use` \
wlroots-git sway-git `# Wayland Compositor` \ wlroots-git sway-git `# Wayland Compositor` \
waybar mako `# Wayland Bar & Notifications` \
terminus-font ttf-iosevka-type ttf-iosevka-term `# Primary Fonts` \ terminus-font ttf-iosevka-type ttf-iosevka-term `# Primary Fonts` \
ttf-font-awesome `# Icon Font` \ ttf-font-awesome `# Icon Font` \
curl `# HTTP Utility` \ curl `# HTTP Utility` \

View file

@ -8,13 +8,13 @@ if [[ $UID -ne 0 ]]; then
exit exit
fi fi
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../" && pwd) dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../../" && pwd)
source "${dfp}/scripts/setup_helpers.bash" source "${dfp}/bin/lib/setup_helpers.bash"
links=( links=(
# display manager files # display manager files
"$dfp/apps/de/sway/sway-init" "/usr/bin/sway-lytedev" "$dfp/apps/de/sway/init" "/usr/bin/sway-lytedev"
"$dfp/apps/de/sway/dm_entry" "/usr/share/wayland-sessions/sway-lytedev.desktop" "$dfp/apps/de/sway/dm-entry" "/usr/share/wayland-sessions/sway-lytedev.desktop"
# touchpad # touchpad
"$dfp/apps/de/libinput/touchpad.conf" "/etc/X11/xorg.conf.d/41-libinput-lytedev-touchpad-options.conf" "$dfp/apps/de/libinput/touchpad.conf" "/etc/X11/xorg.conf.d/41-libinput-lytedev-touchpad-options.conf"

10
bin/linewise Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [[ ! -z "${1+x}" ]]; then
while read r; do
<<< "${r}" "$@"
done
else
echo "No reader program provided."
exit 1
fi

67
bin/pipeline Executable file
View file

@ -0,0 +1,67 @@
#!/usr/bin/env bash
SAVED_PIPELINE_DIR="$EDFP/pipelines"
mkdir -p "$SAVED_PIPELINE_DIR"
if [[ ! -z "${1+x}" ]]; then
pdir="$SAVED_PIPELINE_DIR/$1"; shift
mkdir -p "$pdir"
if [[ -z ${1+x} ]]; then
td="$(mktemp -p "$pdir" -d "tmp_pipeline.XXXXXXXX")"
cleanup_trap="rm -rf \"$td\""
else
td="$pdir/$1"; shift
mkdir -p "$td"
fi
transform="$pdir/transform"
else
td="$(mktemp --tmpdir -d pipeline.XXXXXXXX)"
transform="$td/transform"
cleanup_trap="rm -rf \"$td\""
fi
if [[ ! -e "$transform" ]]; then
echo -e "#!/usr/bin/env bash\n# for ${td}\n\nbase64" > "$transform"
fi
in="$td/in"
if [[ ! -z "${1+x}" ]]; then
in="${1}"; shift
fi
out="$td/out"
if [[ ! -z "${1+x}" ]]; then
out="${1}"; shift
fi
# TODO: if no logging, log="/dev/null"
log="$td/log"
chmod +x "$transform"
echo "Hello World" > "$in"
touch "$log"
fswi \
"bash -c 'cd \"$td\" && < \"$in\" \"$transform\" | tee \"$out\"'" \
'in$|transform$' \
"$td" "$pdir" &> "$log" &
watcher="$!"
if [[ -z ${cleanup_trap+x} ]]; then
trap "kill \"$watcher\"" EXIT
else
trap "${cleanup_trap}; kill \"$watcher\"" EXIT
fi
job="call jobstart(['inotifywait', '-m', '-e', 'close_write', '${out}'], {'on_stdout':{j,d,e->execute('checktime')}})"
# this will only autosave (and therefore autoreload) for the out buffer (since
# it was opened last) - autosaving (and therefore autorunning) is potentially
# very scary
nvim \
--cmd 'set shm+=atIWF' \
--cmd 'set shm-=Oo' \
-o "$in" "$transform" "$out" \
--cmd 'set autoread' \
--cmd 'set updatetime=250' \
--cmd 'autocmd CursorHold,CursorHoldI <buffer> silent write' \
--cmd "$(<<< "$job" tr "'" '"')"

View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
"${DOTFILES_PATH}/apps/de/bar/bar.bash" "${DOTFILES_PATH}/apps/de/polybar/run"

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# TODO: progress bar!
HOST="ld" HOST="ld"
f="${1}" f="${1}"

View file

@ -78,6 +78,7 @@ Here are some bullet points on my workflow:
* Makefile instead of setup script * Makefile instead of setup script
* [Vimux](https://github.com/benmills/vimux)? * [Vimux](https://github.com/benmills/vimux)?
* Nerd Fonts with ligatures and icons for Kitty * Nerd Fonts with ligatures and icons for Kitty
* Setup network file sharing directory
[upstream]: https://git.faceless.lytedev.io/lytedev/dotfiles [upstream]: https://git.faceless.lytedev.io/lytedev/dotfiles

14
setup
View file

@ -11,6 +11,8 @@
# D O T F I L E S # # D O T F I L E S #
# # # #
# TODO: quiet mode?
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd) dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd)
source "${dfp}/bin/lib/setup_helpers.bash" source "${dfp}/bin/lib/setup_helpers.bash"
edfp="${dfp}/.env" edfp="${dfp}/.env"
@ -39,6 +41,7 @@ links=(
"$dfp/apps/de/x/modmap" "$HOME/.xmodmap" "$dfp/apps/de/x/modmap" "$HOME/.xmodmap"
"$dfp/apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf" "$dfp/apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf"
"$dfp/apps/de/dunst/dunstrc" "$XDG_CONFIG_HOME/dunst/dunstrc" "$dfp/apps/de/dunst/dunstrc" "$XDG_CONFIG_HOME/dunst/dunstrc"
"$dfp/apps/de/mako/" "$XDG_CONFIG_HOME/mako"
"$dfp/bin/lib/colors/xresources" "$HOME/.Xresources.colors" "$dfp/bin/lib/colors/xresources" "$HOME/.Xresources.colors"
# shell files # shell files
@ -58,6 +61,10 @@ links=(
"$dfp/apps/de/gtk/2rc" "$HOME/.gtkrc" "$dfp/apps/de/gtk/2rc" "$HOME/.gtkrc"
"$dfp/apps/de/gtk/3settings.ini" "$XDG_CONFIG_HOME/gtk-3.0/settings.ini" "$dfp/apps/de/gtk/3settings.ini" "$XDG_CONFIG_HOME/gtk-3.0/settings.ini"
# bar files
"$dfp/apps/de/polybar/config" "$XDG_CONFIG_HOME/polybar/config"
"$dfp/apps/de/waybar/" "$XDG_CONFIG_HOME/waybar"
# irc files # irc files
"$dfp/apps/irssi/" "$HOME/.irssi" "$dfp/apps/irssi/" "$HOME/.irssi"
"$dfp/apps/weechat/" "$HOME/.weechat" "$dfp/apps/weechat/" "$HOME/.weechat"
@ -88,9 +95,6 @@ links=(
# rofi config # rofi config
"$dfp/apps/rofi/config" "$XDG_CONFIG_HOME/rofi/config" "$dfp/apps/rofi/config" "$XDG_CONFIG_HOME/rofi/config"
# bar files
"$dfp/apps/de/bar/polybar-config" "$XDG_CONFIG_HOME/polybar/config"
# ranger config # ranger config
"$dfp/apps/ranger/" "$XDG_CONFIG_HOME/ranger" "$dfp/apps/ranger/" "$XDG_CONFIG_HOME/ranger"
@ -116,6 +120,8 @@ mkdir -p "$edfp/"
mkdir -p "$edfp/bash.d/" mkdir -p "$edfp/bash.d/"
mkdir -p "$edfp/bin/" mkdir -p "$edfp/bin/"
mkdir -p "$edfp/x/" mkdir -p "$edfp/x/"
mkdir -p "$edfp/sway/waybar"
mkdir -p "$edfp/sway/config.d"
mkdir -p "$HOME/.bin/" mkdir -p "$HOME/.bin/"
touches=( touches=(
@ -125,7 +131,7 @@ touches=(
"$edfp/x/resources" "$edfp/x/resources"
"$edfp/vim" "$edfp/vim"
"$edfp/bspwm" "$edfp/bspwm"
"$edfp/bar" "$edfp/polybar"
"$edfp/app-launcher" "$edfp/app-launcher"
) )