diff --git a/apps/rofi/config b/apps/rofi/config new file mode 100644 index 0000000..c44c453 --- /dev/null +++ b/apps/rofi/config @@ -0,0 +1,6 @@ +rofi.lines: 10 +rofi.width: 25 +rofi.matching: fuzzy +rofi.separator-style: none +rofi.hide-scrollbar: true +rofi.line-margin: 5 diff --git a/de/app-launcher b/de/app-launcher deleted file mode 100755 index 32d3b0e..0000000 --- a/de/app-launcher +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -LAUNCHER_FONT=$(xrdb -query | sed -ne 's/.*font:\s*xft:\([^-]*\).*$/\1/p' | head -n 1) -LAUNCHER_FONT_SIZE=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\([^-]*\)$/\1/p' | head -n 1) -HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*color1*:\s*\(.*\)$/\1/p' | head -n 1) -BACKGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1) -FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*foreground:\s*\(.*\)$/\1/p' | head -n 1) - -rofi -show run -font "$LAUNCHER_FONT $LAUNCHER_FONT_SIZE" -lines 16 -width 25 -padding 8 -fuzzy -bw "$BORDER_WIDTH" -color-enabled -color-window "$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$HIGHLIGHT_COLOR","$BACKGROUND_COLOR" -color-normal "$BACKGROUND_COLOR","$FOREGROUND_COLOR","$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$FOREGROUND_COLOR" -separator-style none -hide-scrollbar diff --git a/de/compton.conf b/de/compton.conf index c9929c7..9bf0f3a 100644 --- a/de/compton.conf +++ b/de/compton.conf @@ -3,7 +3,7 @@ no-dnd-shadow = true; no-dock-shadow = false; clearshadow = true; shadow-radius = 7; -shadow-offset-x = -12; +shadow-offset-x = -10; shadow-offset-y = -7; shadow-opacity = 1.0; shadow-red = 0.0; @@ -22,6 +22,9 @@ fade-in-step = 0.06; fade-out-step = 0.06; alpha-step = 0.1; inactive-dim = 0.5; +focus-exclude = [ + "n:e:rofi" +] mark-wmwin-focused = true; mark-ovredir-focused = false; diff --git a/de/sxhkdrc b/de/sxhkdrc index c2cd398..8051256 100755 --- a/de/sxhkdrc +++ b/de/sxhkdrc @@ -166,7 +166,7 @@ super + shift + Return # spawn the app launcher super + space - "$DOTFILES_PATH/de/app-launcher" + "$DOTFILES_PATH/scripts/bin/app-launcher" -modi run -show run # lock the desktop super + ctrl + shift + l @@ -212,6 +212,10 @@ XF86AudioPrev {_,shift + }XF86MonBrightnessDown xbacklight - 10 +# open rofi as a window switcher +super + w + "$DOTFILES_PATH/scripts/bin/app-launcher" -modi window,run -show window + # close the current application super + c bspc node -c diff --git a/scripts/bin/app-launcher b/scripts/bin/app-launcher new file mode 100755 index 0000000..9451219 --- /dev/null +++ b/scripts/bin/app-launcher @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +source "$DOTFILES_PATH/de/bar/bar.bash" --just-vars + +LAUNCHER_FONT=$(xrdb -query | sed -ne 's/.*font:\s*xft:\([^-]*\).*$/\1/p' | head -n 1) +LAUNCHER_FONT_SIZE=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\([^-]*\)$/\1/p' | head -n 1) +HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*color4*:\s*\(.*\)$/\1/p' | head -n 1) +HIGHLIGHT_FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1) +BACKGROUND_COLOR=$(xrdb -query | sed -ne 's/.*background:\s*\(.*\)$/\1/p' | head -n 1) +FOREGROUND_COLOR=$(xrdb -query | sed -ne 's/.*foreground:\s*\(.*\)$/\1/p' | head -n 1) + +for i in "$@"; +do + params=" $params $i" +done + +echo "$params" >> "$HOME/.sxhkd.log" + +rofi -font "$LAUNCHER_FONT $LAUNCHER_FONT_SIZE" -padding $GAP -bw "$BORDER_WIDTH" -color-enabled -color-window "$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$FOREGROUND_COLOR","$BACKGROUND_COLOR" -color-normal "$BACKGROUND_COLOR","$FOREGROUND_COLOR","$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$HIGHLIGHT_FOREGROUND_COLOR" -color-normal "$BACKGROUND_COLOR","$FOREGROUND_COLOR","$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$HIGHLIGHT_FOREGROUND_COLOR" -color-active "$BACKGROUND_COLOR","$FOREGROUND_COLOR","$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$HIGHLIGHT_FOREGROUND_COLOR" -color-urgent "$BACKGROUND_COLOR","$FOREGROUND_COLOR","$BACKGROUND_COLOR","$HIGHLIGHT_COLOR","$HIGHLIGHT_FOREGROUND_COLOR" -monitor -4 $params diff --git a/scripts/bin/wifi-list b/scripts/bin/wifi-list new file mode 100755 index 0000000..f340fad --- /dev/null +++ b/scripts/bin/wifi-list @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# wip + +SSID=$(nmcli device wifi | tail -n +2 | "$DOTFILES_PATH/scripts/bin/app-launcher" -i --display-mode "wifi" -p "wifi:" -dmenu -width 50 | sed -re 's/^\s*\*//' | awk '{print $1}') + +RESULT=$(nmcli device wifi connect "$SSID") +if echo "$RESULT" | grep -q -E '^Error: Connection activation failed: \(7\)'; then + # TODO: currently, the first attempt to connect fails and then we wait for + # a rescan before trying again + sleep 10 + PASSWORD=$(: | "$DOTFILES_PATH/scripts/bin/app-launcher" --display-mode "Password:" -dmenu -p "wifi_password:" -width 50) + nmcli device wifi connect "$SSID" password "$PASSWORD" +fi diff --git a/setup b/setup index aa4cb34..0a3a45e 100755 --- a/setup +++ b/setup @@ -64,6 +64,9 @@ links=( # terminal emulator "$dfp/apps/alacritty/" "$XDG_CONFIG_HOME/alacritty" + # rofi config + "$dfp/apps/rofi/config" "$XDG_CONFIG_HOME/rofi/config" + # bar files "$dfp/de/bar/polybar-config" "$XDG_CONFIG_HOME/polybar/config" diff --git a/shell/paths b/shell/paths index f783ae1..a22118d 100644 --- a/shell/paths +++ b/shell/paths @@ -4,7 +4,7 @@ export GOPATH="$HOME/.go" # PATH=$PATH:$APPENDED_PATH PATH=$PATH:"$GOPATH/bin" -PATH=$PATH:"$DOTFILES_PATH/bin" +PATH=$PATH:"$DOTFILES_PATH/scripts/bin" if [ -d "$HOME/.bin" ]; then PATH=$PATH:"$HOME/.bin"