From f870de2adf9f29f05261ecc12df90d5b3a7e6efe Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 10 May 2021 13:29:39 -0500 Subject: [PATCH 1/7] Fixes from dragon install --- common/bin/clipshot | 1 + common/bin/dotfiles-link-environments | 1 + common/bin/dotfiles-setup | 5 +++-- os/linux/arch/provision.d/optional/ui-packages.bash | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/bin/clipshot b/common/bin/clipshot index c4b4d4d..8becd5a 100755 --- a/common/bin/clipshot +++ b/common/bin/clipshot @@ -5,6 +5,7 @@ set -x umask 077 d="$(date +"%Y-%m-%d_%H-%M-%S")" fn="$SCROTS_PATH/clipshot_$d.png" +mkdir -p "$SCROTS_PATH" if is_wayland; then dim="$(slurp -d)" diff --git a/common/bin/dotfiles-link-environments b/common/bin/dotfiles-link-environments index 8718fad..0d157d0 100755 --- a/common/bin/dotfiles-link-environments +++ b/common/bin/dotfiles-link-environments @@ -12,6 +12,7 @@ files $dfp/common/envs | \ --preview="ls -la --color=always {}" | \ string trim | \ read -a -d \n -z lines +mkdir -p $ENV_PATH for l in $lines test $l = "" && continue set ll (string replace -a / - $l) diff --git a/common/bin/dotfiles-setup b/common/bin/dotfiles-setup index 0e0b613..3a08509 100755 --- a/common/bin/dotfiles-setup +++ b/common/bin/dotfiles-setup @@ -8,7 +8,8 @@ set lock_file $HOME/.using-lytedev-dotfiles.lock if not test -f $lock_file echo This will delete existing files. Make sure you know what you\'re doing. - read -r -p "Are you sure you want to continue? [y/N] " response + printf 'Are you sure you want to continue? [y/N] ' + read response set response (string lower $response) if string match $response y echo "agreed" > "$lock_file" @@ -47,7 +48,7 @@ l common/kak $c/kak l common/gpg/agent.conf $h/.gnupg/gpg-agent.conf l common/htop/rc $c/htop/htoprc l common/kitty $c/kitty -l common/mutt/rc $c/.muttrc +l common/mutt/rc $h/.muttrc l common/git/config $h/.gitconfig l common/elixir/iex.exs $h/.iex.exs l common/data/user-dirs $c/user-dirs.dirs diff --git a/os/linux/arch/provision.d/optional/ui-packages.bash b/os/linux/arch/provision.d/optional/ui-packages.bash index c5bb29f..7eda7dd 100755 --- a/os/linux/arch/provision.d/optional/ui-packages.bash +++ b/os/linux/arch/provision.d/optional/ui-packages.bash @@ -11,7 +11,7 @@ fi # TODO: switch to Nautilus? -yay -Sy \ +yay -Sy --needed \ xf86-input-libinput \ libinput libinput-gestures `# Trackpad Control` \ bluez bluez-libs bluez-utils bluez-tools `# Bluetooth` \ @@ -46,7 +46,7 @@ yay -Sy \ firefox-nightly `# Default Web Browser` \ alsa-utils `# Audio Utilities` \ alsa-plugins `# Plugins for ALSA` \ - pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \ + pavucontrol pulsemixer `# Audio Backend and Controls` \ playerctl `# Media Keys Controls` \ feh `# Image Viewer & Wallpaper Manager` \ wlroots sway `# Wayland Compositor` \ @@ -57,7 +57,7 @@ yay -Sy \ slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \ pipewire pipewire-pulse pipewire-media-session `# Pipewire` \ xdg-desktop-portal xdg-desktop-portal-wlr `# Screensharing` \ - obs-studio-wayland obs-xdg-portal `# OBS` \ + obs-studio `# OBS` \ ttf-iosevka `# Primary Fonts` \ ttf-font-awesome `# Icon Font` \ ripcord `# Discord and Slack Client` From 33b57302a93a5434af36f77fa73b3a618ce278cc Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 13 May 2021 10:42:19 -0500 Subject: [PATCH 2/7] User dirs and sway cleanup --- common/bin/dotfiles-setup | 1 - common/htop/rc | 2 +- os/linux/kanshi/config | 31 +++++++------------- os/linux/kanshi/desktop-H-workspaces.sh | 39 +++++++++---------------- os/linux/sway/config | 3 ++ {common/data => os/linux}/user-dirs | 0 6 files changed, 28 insertions(+), 48 deletions(-) rename {common/data => os/linux}/user-dirs (100%) diff --git a/common/bin/dotfiles-setup b/common/bin/dotfiles-setup index 3a08509..0ffa144 100755 --- a/common/bin/dotfiles-setup +++ b/common/bin/dotfiles-setup @@ -51,7 +51,6 @@ l common/kitty $c/kitty l common/mutt/rc $h/.muttrc l common/git/config $h/.gitconfig l common/elixir/iex.exs $h/.iex.exs -l common/data/user-dirs $c/user-dirs.dirs popd for s in $c/lytedev-env/*/dotfiles-setup.d.fish diff --git a/common/htop/rc b/common/htop/rc index c340c95..9e52749 100644 --- a/common/htop/rc +++ b/common/htop/rc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 +sort_key=46 sort_direction=1 tree_sort_key=0 tree_sort_direction=1 diff --git a/os/linux/kanshi/config b/os/linux/kanshi/config index 5043f1d..6a21bae 100644 --- a/os/linux/kanshi/config +++ b/os/linux/kanshi/config @@ -1,20 +1,17 @@ -profile desktop-1x4kside { - output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 0,1200 scale 1 transform normal - output "Dell Inc. DELL U2720Q CWTM623" enable mode 3840x2160@60Hz position 3440,0 scale 1.5 transform 90 -} - -profile desktop-1x4kside2 { - output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 1440,800 scale 1 transform normal - output "Dell Inc. DELL U2720Q D3TM623" enable mode 3840x2160@60Hz position 0,0 scale 1.5 transform 270 -} - profile desktop-H-2x4kside2 { - output "Dell Inc. DELL U2720Q D3TM623" enable mode 3840x2160@60Hz position 0,0 scale 1.5 transform 270 - output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 1440,800 scale 1 transform normal - output "Dell Inc. DELL U2720Q CWTM623" enable mode 3840x2160@60Hz position 4880,0 scale 1.5 transform 90 + output "Dell Inc. DELL U2720Q D3TM623" enable mode 3840x2160@60Hz position 0,0 scale 1 transform 270 + output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 2160,1200 scale 1 transform normal + output "Dell Inc. DELL U2720Q CWTM623" enable mode 3840x2160@60Hz position 5600,0 scale 1 transform 90 exec "$DOTFILES_PATH/os/linux/kanshi/desktop-H-workspaces.sh" } +# profile desktop-H-2x4kside2 { +# output "Dell Inc. DELL U2720Q D3TM623" enable mode 3840x2160@60Hz position 0,0 scale 1.5 transform 270 +# output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 1440,800 scale 1 transform normal +# output "Dell Inc. DELL U2720Q CWTM623" enable mode 3840x2160@60Hz position 4880,0 scale 1.5 transform 90 +# exec "$DOTFILES_PATH/os/linux/kanshi/desktop-H-workspaces.sh" +# } + profile tv4k { output "Samsung Electric Company CF791 HTRJ500315" disable output "Samsung Electric Company SyncMaster H1AK500000" enable mode 4096x2160@60Hz position 0,0 scale 1 transform normal @@ -25,12 +22,6 @@ profile desktop-ultrawide { exec "$HOME/.config/lytedev-dotfiles/apps/de/kanshi/desktop-single-workspace.sh" } -profile laptop-solo { +profile laptop { output "Sharp Corporation 0x144A 0x00000000" enable mode 3200x1800@60Hz position 0,0 scale 2 transform normal } - -profile laptop-single-ext-mon { - output "Dell Inc. DELL U2719DC 9CL4QS2" enable mode 2560x1440@60Hz position 0,0 scale 1 transform normal - output "Sharp Corporation 0x144A 0x00000000" enable mode 3200x1800@60Hz position 0,1440 scale 2 transform normal - exec "$HOME/.config/lytedev-dotfiles/apps/de/kanshi/laptop-workspaces.sh" -} diff --git a/os/linux/kanshi/desktop-H-workspaces.sh b/os/linux/kanshi/desktop-H-workspaces.sh index e48ce03..2cb03a8 100755 --- a/os/linux/kanshi/desktop-H-workspaces.sh +++ b/os/linux/kanshi/desktop-H-workspaces.sh @@ -2,34 +2,21 @@ # kanshi will potentially run this more than once LOCKFILE="/tmp/lytedev-kanshi-workspace-arranging.lock" -if ! [[ -f $LOCKFILE ]]; then - touch "$LOCKFILE" - # TODO: something is pretty broken with sway/kanshi right now - sleep 0.1 - # TODO: some way to ensure the lock file is cleaned up? - # maybe check if the file is older than a minute? +[[ -f $LOCKFILE ]] && { echo "Already locked: $LOCKFILE" >&2; exit 1; } - move_workspace() { swaymsg workspace "$1"; swaymsg move workspace to "'$2'"; } - setup_output() { out="$1"; shift; while (($#)); do move_workspace "$1" "$out"; shift; done; } +touch "$LOCKFILE" +sleep 0.1 - set -x - # setup_output 'Dell Inc. DELL U2719DC 9DL4QS2' 7 8 9 - # setup_output 'Dell Inc. DELL U2719DC 5DL4QS2' 4 5 6 - # setup_output 'Samsung Electric Company CF791 HTRJ500315' 1 2 3 +move_workspace() { swaymsg workspace "$1"; swaymsg move workspace to "'$2'"; } +setup_output() { out="$1"; shift; while (($#)); do move_workspace "$1" "$out"; shift; done; } - setup_output 'Dell Inc. DELL U2720Q CWTM623' 9 8 - setup_output 'Dell Inc. DELL U2720Q D3TM623' 6 5 - setup_output 'Samsung Electric Company CF791 HTRJ500315' 3 2 - setup_output 'Dell Inc. DELL U2720Q CWTM623' 7 - setup_output 'Dell Inc. DELL U2720Q D3TM623' 4 - setup_output 'Samsung Electric Company CF791 HTRJ500315' 1 +set -x - # setup_output 'Dell Inc. DELL U2719DC 9DL4QS2' 8 9 7 - # setup_output 'Dell Inc. DELL U2719DC 5DL4QS2' 5 6 4 - # setup_output 'Samsung Electric Company CF791 HTRJ500315' 2 3 1 +setup_output 'Dell Inc. DELL U2720Q CWTM623' 9 8 +setup_output 'Dell Inc. DELL U2720Q D3TM623' 6 5 +setup_output 'Samsung Electric Company CF791 HTRJ500315' 3 2 +setup_output 'Dell Inc. DELL U2720Q CWTM623' 7 +setup_output 'Dell Inc. DELL U2720Q D3TM623' 4 +setup_output 'Samsung Electric Company CF791 HTRJ500315' 1 - rm "$LOCKFILE" -else - echo "Already locked: $LOCKFILE" >&2 - exit 1 -fi +rm "$LOCKFILE" diff --git a/os/linux/sway/config b/os/linux/sway/config index 6cbbf08..8cf5631 100644 --- a/os/linux/sway/config +++ b/os/linux/sway/config @@ -157,6 +157,9 @@ mode "resize" { bindsym escape mode "default" } +for_window [title="."] title_format "%title" +for_window [app_id="__focused__"] title_format "%title" + for_window [app_id="floating_terminal"] floating enable for_window [class="floating_terminal"] floating enable # for_window [class=".*"] layout splitv diff --git a/common/data/user-dirs b/os/linux/user-dirs similarity index 100% rename from common/data/user-dirs rename to os/linux/user-dirs From 300fd1b732ccdbe32b6d9a054549548476b29cba Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 May 2021 15:09:51 -0500 Subject: [PATCH 3/7] Use global instead of universal fish_user_paths --- common/fish/paths.fish | 12 ++++++------ common/git/config | 3 --- host/laptop/third/config.d.fish | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/common/fish/paths.fish b/common/fish/paths.fish index 868668d..bc5df33 100755 --- a/common/fish/paths.fish +++ b/common/fish/paths.fish @@ -2,7 +2,7 @@ set -Ux GOPATH $HOME/.go -set -U fish_user_paths \ +set -g fish_user_paths \ $HOME/.go \ $GOPATH/bin \ $DOTFILES_PATH/common/bin \ @@ -13,14 +13,14 @@ set -U fish_user_paths \ $HOME/.netlify/helper/bin for d in $ENV_PATH/*/bin - test -d $d && set -Ua fish_user_paths $d + test -d $d && set -ga fish_user_paths $d end -test -d $HOME/.local/bin && set -Ua fish_user_paths $HOME/.local/bin -test -d $HOME/.bin && set -Ua fish_user_paths $HOME/.local/bin +test -d $HOME/.local/bin && set -ga fish_user_paths $HOME/.local/bin +test -d $HOME/.bin && set -ga fish_user_paths $HOME/.local/bin -has_command python && set -Ua fish_user_paths (python -m site --user-base)/bin -has_command ruby && set -Ua fish_user_paths (ruby -e 'print Gem.user_dir')/bin +has_command python && set -ga fish_user_paths (python -m site --user-base)/bin +has_command ruby && set -ga fish_user_paths (ruby -e 'print Gem.user_dir')/bin if set -q NICE_HOME else diff --git a/common/git/config b/common/git/config index ad2210f..bf05120 100644 --- a/common/git/config +++ b/common/git/config @@ -1,6 +1,3 @@ -[push] - default = current - [user] name = Daniel Flanagan email = daniel@lyte.dev diff --git a/host/laptop/third/config.d.fish b/host/laptop/third/config.d.fish index 956d991..a3fce7c 100644 --- a/host/laptop/third/config.d.fish +++ b/host/laptop/third/config.d.fish @@ -1,2 +1,2 @@ set e $argv[1] -set -Ua fish_user_paths $e/bin +set -ga fish_user_paths $e/bin From 703a42a5f8454e2a4305f9dd56a17b5fff7fbf34 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 May 2021 15:13:43 -0500 Subject: [PATCH 4/7] For macOS --- common/bin/pass-otp | 2 +- common/fish/config.fish | 15 +++++++++------ common/fish/paths.fish | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/common/bin/pass-otp b/common/bin/pass-otp index 92f9a1d..023a8d3 100755 --- a/common/bin/pass-otp +++ b/common/bin/pass-otp @@ -5,7 +5,7 @@ key="$1"; shift args=("$@") -otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp.*: ?.*$' | cut -d ':' -f 2 | sed 's/ //g')" +otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp' | cut -d ':' -f 2 | sed 's/ //g')" otp_status="$?" [[ $otp_status != 0 ]] && { echo "pass command failed with exit code $otp_status"; exit 1; } [[ -z $otp ]] && { echo "No OTP secret found for pass entry '$key'"; exit 2; } diff --git a/common/fish/config.fish b/common/fish/config.fish index f3fa1b2..3604a90 100755 --- a/common/fish/config.fish +++ b/common/fish/config.fish @@ -40,6 +40,15 @@ function fish_greeting; test -f /proc/sys/kernel/pty/nr && printf "%6d PTYs open\n" (cat /proc/sys/kernel/pty/nr) end +if has_command brew && test -f (brew --prefix asdf)/lib/asdf.fish + set -Ux ASDF_DIR (brew --prefix asdf) + source (brew --prefix asdf)/lib/asdf.fish +else if test -f $HOME/.asdf/asdf.fish + source $HOME/.asdf/asdf.fish +else if test -f /opt/asdf-vm/asdf.fish + source /opt/asdf-vm/asdf.fish +end + # assume the user uses "$HOME" to just store their mess of dotfiles and other # nonsense that clutters it up and that they have a preferred starting # directory where they keep the stuff they actually care about @@ -47,9 +56,3 @@ end if test $PWD = $HOME; or test $PWD = $NICE_HOME; cd $NICE_HOME || cd end - -if test -f $HOME/.asdf/asdf.fish - source $HOME/.asdf/asdf.fish -else if test -f /opt/asdf-vm/asdf.fish - source /opt/asdf-vm/asdf.fish -end diff --git a/common/fish/paths.fish b/common/fish/paths.fish index bc5df33..a720dbd 100755 --- a/common/fish/paths.fish +++ b/common/fish/paths.fish @@ -2,7 +2,7 @@ set -Ux GOPATH $HOME/.go -set -g fish_user_paths \ +set paths_candidates \ $HOME/.go \ $GOPATH/bin \ $DOTFILES_PATH/common/bin \ @@ -12,7 +12,7 @@ set -g fish_user_paths \ $HOME/.yarn/bin \ $HOME/.netlify/helper/bin -for d in $ENV_PATH/*/bin +for d in $paths_candidates $ENV_PATH/*/bin test -d $d && set -ga fish_user_paths $d end From 916ac3c7d0779ea08af03b6c67f1bb424c298e77 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 May 2021 15:16:27 -0500 Subject: [PATCH 5/7] Only load vconsole for linux --- common/fish/config.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/fish/config.fish b/common/fish/config.fish index 3604a90..68d5af2 100755 --- a/common/fish/config.fish +++ b/common/fish/config.fish @@ -13,7 +13,7 @@ end status --is-interactive || exit -$DOTFILES_PATH/common/colors/vconsole +test (uname) = Linux && $DOTFILES_PATH/common/colors/vconsole for f in key-bindings colors prompt aliases source $FISH_PATH/$f.fish end From a8b20eb79cff13029d095573cd8e0ddf5aa29199 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 May 2021 15:20:44 -0500 Subject: [PATCH 6/7] Paths --- common/fish/paths.fish | 10 +++++----- host/laptop/third/config.d.fish | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/fish/paths.fish b/common/fish/paths.fish index a720dbd..6ee9655 100755 --- a/common/fish/paths.fish +++ b/common/fish/paths.fish @@ -13,14 +13,14 @@ set paths_candidates \ $HOME/.netlify/helper/bin for d in $paths_candidates $ENV_PATH/*/bin - test -d $d && set -ga fish_user_paths $d + test -d $d && set -gxa fish_user_paths $d end -test -d $HOME/.local/bin && set -ga fish_user_paths $HOME/.local/bin -test -d $HOME/.bin && set -ga fish_user_paths $HOME/.local/bin +test -d $HOME/.local/bin && set -gxa fish_user_paths $HOME/.local/bin +test -d $HOME/.bin && set -gxa fish_user_paths $HOME/.local/bin -has_command python && set -ga fish_user_paths (python -m site --user-base)/bin -has_command ruby && set -ga fish_user_paths (ruby -e 'print Gem.user_dir')/bin +has_command python && set -gxa fish_user_paths (python -m site --user-base)/bin +has_command ruby && set -gxa fish_user_paths (ruby -e 'print Gem.user_dir')/bin if set -q NICE_HOME else diff --git a/host/laptop/third/config.d.fish b/host/laptop/third/config.d.fish index a3fce7c..3e438fa 100644 --- a/host/laptop/third/config.d.fish +++ b/host/laptop/third/config.d.fish @@ -1,2 +1,2 @@ set e $argv[1] -set -ga fish_user_paths $e/bin +set -gxa fish_user_paths $e/bin From 2981d01c4f2f3629ab43de5454940a4152e92d71 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 May 2021 15:23:18 -0500 Subject: [PATCH 7/7] More paths --- common/fish/paths.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/common/fish/paths.fish b/common/fish/paths.fish index 6ee9655..e5256aa 100755 --- a/common/fish/paths.fish +++ b/common/fish/paths.fish @@ -12,6 +12,7 @@ set paths_candidates \ $HOME/.yarn/bin \ $HOME/.netlify/helper/bin +set -ge fish_user_paths for d in $paths_candidates $ENV_PATH/*/bin test -d $d && set -gxa fish_user_paths $d end