From 4195d867889c10b072022342384076d1578b0842 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 09:31:50 -0600 Subject: [PATCH 1/3] Lots of small fixes back in arch --- apps/de/sway/config | 3 +-- apps/git/config | 6 +++++- apps/kanshi/config | 4 ++-- apps/kanshi/desktop-H-workspaces.sh | 2 +- apps/ranger/.gitignore | 3 --- apps/ranger/rc.conf | 2 -- bin/floating-term | 1 + bin/setup-dotfiles | 2 +- env/arch-linux/provisioning/2-essentials.bash | 8 ++++---- env/common/sudo_setup | 4 ++-- env/nix/modules/de/sway.nix | 2 ++ Makefile => makefile | 0 12 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 apps/ranger/.gitignore delete mode 100644 apps/ranger/rc.conf rename Makefile => makefile (100%) diff --git a/apps/de/sway/config b/apps/de/sway/config index 4da7504..1e5b5f8 100644 --- a/apps/de/sway/config +++ b/apps/de/sway/config @@ -33,9 +33,8 @@ input type:touchpad { bindsym $mod+control+space exec makoctl dismiss bindsym $mod+shift+space exec makoctl invoke -bindsym $mod+return exec kitty +bindsym $mod+return exec kitty --single-instance bindsym $mod+shift+return exec $dfpbin/floating-term -bindsym $mod+t exec kitty bindsym $mod+shift+alt+return exec kitty bindsym $mod+c kill bindsym $mod+shift+c kill # TODO: kill -9? diff --git a/apps/git/config b/apps/git/config index 2d67dba..53ba4a3 100644 --- a/apps/git/config +++ b/apps/git/config @@ -51,7 +51,11 @@ [pager] branch = false # remove ansi codes, pad each file's diff with newlines, show as diff, remove top padding - diff = vimpager -c 'silent %sm/\\e[^mK]*[mK]//g' -c 'silent %s/^diff/\\r\\rdiff/' -c 'silent set ft=diff' -c 'silent execute \"normal gg2dd\"' + diff = nvim -c 'silent %sm/\\e[^mK]*[mK]//g' \ + -c 'silent %s/^diff/\\r\\rdiff/' \ + -c 'silent set ft=diff' \ + -c 'silent execute \"normal gg2dd\"' \ + -c 'silent setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile' [url "git@github.com:postmates"] insteadOf = https://github.com/postmates diff --git a/apps/kanshi/config b/apps/kanshi/config index 577763c..1092d09 100644 --- a/apps/kanshi/config +++ b/apps/kanshi/config @@ -1,7 +1,7 @@ profile desktop-H { output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 1440,560 scale 1 transform normal - output "Dell Inc. DELL U2719DC 5DL4QS2" enable mode 2560x1440@60Hz position 0,0 scale 1 transform 90 - output "Dell Inc. DELL U2719DC 9DL4QS2" enable mode 2560x1440@60Hz position 4880,0 scale 1 transform 270 + output "Dell Inc. DELL U2719DC 5DL4QS2" enable mode 2560x1440@60Hz position 0,0 scale 1 transform 270 + output "Dell Inc. DELL U2719DC 9DL4QS2" enable mode 2560x1440@60Hz position 4880,0 scale 1 transform 90 exec "$HOME/.config/lytedev-dotfiles/apps/kanshi/desktop-H-workspaces.sh" } diff --git a/apps/kanshi/desktop-H-workspaces.sh b/apps/kanshi/desktop-H-workspaces.sh index 977cd85..520959a 100755 --- a/apps/kanshi/desktop-H-workspaces.sh +++ b/apps/kanshi/desktop-H-workspaces.sh @@ -2,7 +2,7 @@ # kanshi will potentially run this more than once LOCKFILE="/tmp/kanshi-workspace-arranging.lock" -if ! (set -o noclobber; echo > "$LOCKFILE"); then exit 1; fi +if ! (set -o noclobber; echo > "$LOCKFILE" &>/dev/null) &>/dev/null; then echo "Already locked: $LOCKFILE" >&2; exit 0; fi touch "$LOCKFILE" # TODO: some way to ensure the lock file is cleaned up? # maybe check if the file is older than a minute? diff --git a/apps/ranger/.gitignore b/apps/ranger/.gitignore deleted file mode 100644 index 5faddf5..0000000 --- a/apps/ranger/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!rc.conf diff --git a/apps/ranger/rc.conf b/apps/ranger/rc.conf deleted file mode 100644 index 5d88e29..0000000 --- a/apps/ranger/rc.conf +++ /dev/null @@ -1,2 +0,0 @@ -set preview_images true -set preview_images_method kitty diff --git a/bin/floating-term b/bin/floating-term index 9cb8688..948023b 100755 --- a/bin/floating-term +++ b/bin/floating-term @@ -1,6 +1,7 @@ #!/usr/bin/env sh kitty \ + --single-instance \ -o remember_window_size=no \ -o initial_window_width=60c \ -o initial_window_height=12c \ diff --git a/bin/setup-dotfiles b/bin/setup-dotfiles index dbf0ee9..aeac6c4 100755 --- a/bin/setup-dotfiles +++ b/bin/setup-dotfiles @@ -128,7 +128,7 @@ links=( ) # TODO: pass interactive? -_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}" +_dotfiles_setup_run_setup "$HOME/.using-lytedev-dotfiles.lock" "${links[@]}" if [[ "$INTERACTIVE" = 1 ]]; then echo -n -e "Do you want to run the env/common/sudo_setup script for changes to /etc" diff --git a/env/arch-linux/provisioning/2-essentials.bash b/env/arch-linux/provisioning/2-essentials.bash index b98a9ac..0949e52 100755 --- a/env/arch-linux/provisioning/2-essentials.bash +++ b/env/arch-linux/provisioning/2-essentials.bash @@ -26,10 +26,10 @@ yay -S \ kitty `# Almost Better Terminal Emulator` \ feh `# Image Viewer & Wallpaper Manager` \ wlroots-git sway-git `# Wayland Compositor` \ - swaylock-git `# Wayland Compositor` \ - kanshi-git `# Monitor Management for Wayland` \ - waybar-git mako-git `# Wayland Bar & Notifications` \ - slurp grim wl-clipboard `# Wayland Screen Selection & Clipping` \ + swaylock-git swayidle-git `# Auto-Locking for Sway` \ + kanshi-git `# Monitor Management for Sway` \ + waybar-git mako-git `# Sway Bar & Notifications` \ + slurp grim wl-clipboard `# Sway Screen Selection & Clipping` \ ttf-iosevka `# Primary Fonts` \ ttf-font-awesome `# Icon Font` \ curl `# HTTP Utility` \ diff --git a/env/common/sudo_setup b/env/common/sudo_setup index 5742020..b74ea76 100755 --- a/env/common/sudo_setup +++ b/env/common/sudo_setup @@ -7,7 +7,7 @@ if [[ $UID -ne 0 ]]; then fi dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../../" && pwd) -source "${dfp}/bin/lib/setup_helpers.bash" +source "${dfp}/env/common/setup_helpers.bash" # cp "$dfp/apps/de/sway/dm-entry" "/usr/share/wayland-sessions/lsway.desktop" @@ -27,5 +27,5 @@ links=( "apps/de/gnome/gdm-tap-to-click" "/etc/dconf/db/gdm.d/06-tap-to-click" ) -_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-root-files.lock" "${links[@]}" +_dotfiles_setup_run_setup "$HOME/.using-lytedev-etcfiles.lock" "${links[@]}" diff --git a/env/nix/modules/de/sway.nix b/env/nix/modules/de/sway.nix index 2c2d381..946437c 100644 --- a/env/nix/modules/de/sway.nix +++ b/env/nix/modules/de/sway.nix @@ -23,6 +23,8 @@ in { unstable.kanshi unstable.gammastep ]; + # TODO: this should come from the user's homedir maybe through dotfiles + # somehow? home-manager? extraSessionCommands = '' systemctl --user import-environment export TERMINAL=kitty diff --git a/Makefile b/makefile similarity index 100% rename from Makefile rename to makefile From 83cf37032916aed87b8e1b15a95e55b34f1cf353 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 10:56:39 -0600 Subject: [PATCH 2/3] Sway workspace/output pinning is broken on desktop again --- apps/{ => de}/kanshi/config | 2 +- apps/de/kanshi/desktop-H-workspaces.sh | 36 ++++++ apps/de/sway/config | 2 +- apps/kanshi/desktop-H-workspaces.sh | 17 --- apps/rofi/config | 6 - apps/rofi/theme | 172 ------------------------- bin/setup-dotfiles | 2 +- 7 files changed, 39 insertions(+), 198 deletions(-) rename apps/{ => de}/kanshi/config (86%) create mode 100755 apps/de/kanshi/desktop-H-workspaces.sh delete mode 100755 apps/kanshi/desktop-H-workspaces.sh delete mode 100644 apps/rofi/config delete mode 100644 apps/rofi/theme diff --git a/apps/kanshi/config b/apps/de/kanshi/config similarity index 86% rename from apps/kanshi/config rename to apps/de/kanshi/config index 1092d09..f2edfbb 100644 --- a/apps/kanshi/config +++ b/apps/de/kanshi/config @@ -2,7 +2,7 @@ profile desktop-H { output "Samsung Electric Company CF791 HTRJ500315" enable mode 3440x1440@100Hz position 1440,560 scale 1 transform normal output "Dell Inc. DELL U2719DC 5DL4QS2" enable mode 2560x1440@60Hz position 0,0 scale 1 transform 270 output "Dell Inc. DELL U2719DC 9DL4QS2" enable mode 2560x1440@60Hz position 4880,0 scale 1 transform 90 - exec "$HOME/.config/lytedev-dotfiles/apps/kanshi/desktop-H-workspaces.sh" + exec "$HOME/.config/lytedev-dotfiles/apps/de/kanshi/desktop-H-workspaces.sh" } profile laptop-solo { diff --git a/apps/de/kanshi/desktop-H-workspaces.sh b/apps/de/kanshi/desktop-H-workspaces.sh new file mode 100755 index 0000000..b7514d2 --- /dev/null +++ b/apps/de/kanshi/desktop-H-workspaces.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# kanshi will potentially run this more than once +LOCKFILE="/tmp/lytedev-kanshi-workspace-arranging.lock" +if ! [[ -f $LOCKFILE ]]; then + touch "$LOCKFILE" + sleep 0.1 + echo "L: $(date)" >> /tmp/kanshilog + # TODO: some way to ensure the lock file is cleaned up? + # maybe check if the file is older than a minute? + + move_workspace() { swaymsg workspace "$1"; swaymsg move workspace to "'$2'"; } + setup_output() { out="$1"; shift; while (($#)); do move_workspace "$1" "$out"; shift; done; } + + 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 + + setup_output 'Dell Inc. DELL U2719DC 9DL4QS2' 9 8 + setup_output 'Dell Inc. DELL U2719DC 5DL4QS2' 6 5 + setup_output 'Samsung Electric Company CF791 HTRJ500315' 3 2 + setup_output 'Dell Inc. DELL U2719DC 9DL4QS2' 7 + setup_output 'Dell Inc. DELL U2719DC 5DL4QS2' 4 + setup_output 'Samsung Electric Company CF791 HTRJ500315' 1 + + # 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 + + rm "$LOCKFILE" +else + echo "F: $(date)" >> /tmp/kanshilog + echo "Already locked: $LOCKFILE" >&2 + exit 1 +fi diff --git a/apps/de/sway/config b/apps/de/sway/config index 1e5b5f8..dab9471 100644 --- a/apps/de/sway/config +++ b/apps/de/sway/config @@ -154,7 +154,7 @@ client.focused #66d9ef #66d9ef #66d9ef #66d9ef #66d9ef client.focused_inactive #111111 #111111 #ffffff #111111 #111111 client.unfocused #111111 #111111 #ffffff #111111 #111111 -exec_always kanshi +exec_always 'killall kanshi; kanshi &>/tmp/kanshilog2' exec mako exec_always notify-send -a "Sway" -i ~/.wallpaper "Sway configuration loaded." diff --git a/apps/kanshi/desktop-H-workspaces.sh b/apps/kanshi/desktop-H-workspaces.sh deleted file mode 100755 index 520959a..0000000 --- a/apps/kanshi/desktop-H-workspaces.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# kanshi will potentially run this more than once -LOCKFILE="/tmp/kanshi-workspace-arranging.lock" -if ! (set -o noclobber; echo > "$LOCKFILE" &>/dev/null) &>/dev/null; then echo "Already locked: $LOCKFILE" >&2; exit 0; fi -touch "$LOCKFILE" -# TODO: some way to ensure the lock file is cleaned up? -# maybe check if the file is older than a minute? - -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 U2719DC 9DL4QS2' 9 8 7 -setup_output 'Dell Inc. DELL U2719DC 5DL4QS2' 6 5 4 -setup_output 'Samsung Electric Company CF791 HTRJ500315' 3 2 1 - -rm "$LOCKFILE" diff --git a/apps/rofi/config b/apps/rofi/config deleted file mode 100644 index c44c453..0000000 --- a/apps/rofi/config +++ /dev/null @@ -1,6 +0,0 @@ -rofi.lines: 10 -rofi.width: 25 -rofi.matching: fuzzy -rofi.separator-style: none -rofi.hide-scrollbar: true -rofi.line-margin: 5 diff --git a/apps/rofi/theme b/apps/rofi/theme deleted file mode 100644 index e5a7355..0000000 --- a/apps/rofi/theme +++ /dev/null @@ -1,172 +0,0 @@ -/** - * rofi -dump-theme output. - * Rofi version: 1.6.0 - **/ -* { - red: rgba ( 220, 50, 47, 100 % ); - selected-active-foreground: var(background); - lightfg: rgba ( 88, 104, 117, 100 % ); - separatorcolor: var(foreground); - urgent-foreground: var(red); - alternate-urgent-background: var(lightbg); - lightbg: rgba ( 238, 232, 213, 100 % ); - background-color: rgba ( 0, 0, 0, 0 % ); - border-color: var(foreground); - normal-background: var(background); - selected-urgent-background: var(red); - alternate-active-background: var(lightbg); - spacing: 2; - blue: rgba ( 38, 139, 210, 100 % ); - alternate-normal-foreground: var(foreground); - urgent-background: var(background); - selected-normal-foreground: var(lightbg); - active-foreground: var(blue); - background: rgba ( 253, 246, 227, 100 % ); - selected-active-background: var(blue); - active-background: var(background); - selected-normal-background: var(lightfg); - alternate-normal-background: var(lightbg); - foreground: rgba ( 0, 43, 54, 100 % ); - selected-urgent-foreground: var(background); - normal-foreground: var(foreground); - alternate-urgent-foreground: var(red); - alternate-active-foreground: var(blue); -} -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: 1.2000ch ; - text-color: inherit; -} -window { - padding: 0; - background-color: var(background); - border: 0; - font: 'Iosevka Term'; -} -mainbox { - padding: 0; - border: 0; -} -message { - padding: 1px ; - border-color: var(separatorcolor); - border: 0px ; -} -textbox { - text-color: var(foreground); -} -listview { - padding: 2px 0px 0px ; - scrollbar: false; - border-color: var(separatorcolor); - spacing: 5px ; - fixed-height: 0; - border: 0px ; -} -scrollbar { - width: 4px ; - padding: 0; - handle-width: 8px ; - border: 0; - handle-color: var(normal-foreground); -} -sidebar { - border-color: var(separatorcolor); - border: 2px dash 0px 0px ; -} -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: 0px ; - 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 { - placeholder-color: rgba ( 128, 128, 128, 100 % ); - spacing: 0; - placeholder: "Type to filter"; - text-color: var(normal-foreground); -} -prompt { - spacing: 0; - text-color: var(normal-foreground); -} -textbox-prompt-colon { - margin: 0px 0.3000em 0.0000em 0.0000em ; - expand: false; - str: ":"; - text-color: inherit; -} -mode-switcher { - border: 0px ; -} diff --git a/bin/setup-dotfiles b/bin/setup-dotfiles index aeac6c4..8344469 100755 --- a/bin/setup-dotfiles +++ b/bin/setup-dotfiles @@ -124,7 +124,7 @@ links=( "env/nix/pkgs" "$XDG_CONFIG_HOME/nixpkgs" # Kanshi configuration - "apps/kanshi" "$XDG_CONFIG_HOME/kanshi" + "apps/de/kanshi" "$XDG_CONFIG_HOME/kanshi" ) # TODO: pass interactive? From 5ee08742905a680526668affbcb723680db68b99 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Nov 2020 10:58:10 -0600 Subject: [PATCH 3/3] Add note about nnn --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index f5f3efb..414752a 100644 --- a/readme.md +++ b/readme.md @@ -13,6 +13,7 @@ curl -s -L https://git.lyte.dev/lytedev/dotfiles/raw/branch/master/bin/init-dotf ## To Do ++ Setup `nnn` + Move to NixOS (WIP) or Guix? Declarative is the future! + Custom Iosevka font with kitty-compatible ligatures? + Makefile instead of setup script