From 28dcc7ab4f78c7b39521bcb5267ab59db20c62d9 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Wed, 27 May 2020 16:00:52 +0800 Subject: [PATCH] Improve utilities for sway and wofi --- .config/sway/config | 7 ++++++- .config/wofi/style.css | 22 ++++++++++++++++++---- .local/bin/brightness | 2 +- .local/bin/wofi_run | 15 ++++++++++++++- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index e942a0d..9604602 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -14,7 +14,12 @@ set $term kitty --single-instance -d ~ # Your preferred application launcher set $menu ~/.local/bin/wofi_run -### Output configuration +### Mouse +# +# Please tweak wofi_run when enabling this +focus_follows_mouse yes + +### Output configuratjon # # Default wallpaper #output * bg ~/.wallpaper/dark.png tile diff --git a/.config/wofi/style.css b/.config/wofi/style.css index b9ef027..07e6c36 100644 --- a/.config/wofi/style.css +++ b/.config/wofi/style.css @@ -5,7 +5,7 @@ } #input { - padding: 8px 12px; + padding: 8px 16px; border-radius: 0; border: none; background: rgba(32, 32, 32, 0); @@ -17,17 +17,31 @@ .entry#selected, .entry#unselected { - padding: 8px 12px; + padding: 8px 38px; } #selected, row > #selected { background: rgba(203, 75, 22, 0.73); - text: #fff; + color: #fff; } #unselected, row > #unselected { background: none; - text: #fff; + color: #fff; +} + +image { + margin-right: 8px; +} + +expander .entry#selected, +expander .entry#unselected { + padding: 8px 22px; +} + +list .entry#selected, +list .entry#unselected { + padding: 8px 62px; } flowboxchild { diff --git a/.local/bin/brightness b/.local/bin/brightness index eae8289..daac33e 100755 --- a/.local/bin/brightness +++ b/.local/bin/brightness @@ -1,7 +1,7 @@ #!/bin/sh if [[ "$(uname -s)" == "Linux" ]]; then - echo $1 | tee /sys/class/backlight/intel_backlight/brightness + echo $1 | sudo tee /sys/class/backlight/intel_backlight/brightness else echo "only works on linux" fi diff --git a/.local/bin/wofi_run b/.local/bin/wofi_run index f298db7..d90438d 100755 --- a/.local/bin/wofi_run +++ b/.local/bin/wofi_run @@ -1,5 +1,18 @@ #!/bin/zsh export PATH="$PATH:$HOME/.local/bin" +cd ~ -wofi --normal-window --show drun +wofi \ + --width 600 \ + --prompt search \ + --normal-window \ + --allow-images --allow-markup \ + --hide-scroll \ + --matching contains \ + --insensitive \ + --term kitty \ + --show drun,run + +# TIPS: +# - Hold shift to open in terminal