sway-specific folder
This commit is contained in:
parent
861ee63c92
commit
f53eaf80c0
5 changed files with 56 additions and 77 deletions
|
@ -1,41 +1,33 @@
|
|||
#!/bin/sh
|
||||
# Script for using either bemenu or dmenu
|
||||
# with preconfigured options
|
||||
PROMPT="$1" ; MODE="$2"
|
||||
PROMPT="$1" MODE="$2"
|
||||
if [ "$PROMPT" = "" -o "$PROMPT" = "-h" ] ; then printf "Usage: menu [prompt] [run/pass]\n" ; return 0 ; fi
|
||||
[ "$MODE" = "pass" ] && BPASS="-x" DPASS="-P"
|
||||
BRUN="-run" DRUN="_run" TRUN="-run" FRUN=""
|
||||
[ "$MODE" != "run" ] && BRUN="" DRUN="" TRUN="" FRUN=""
|
||||
|
||||
# Configuration
|
||||
MENU="tofi" # Default to fzf
|
||||
menu="menu_bemenu"
|
||||
font="JetbrainsMono"
|
||||
font_size="10"
|
||||
col_white="#ffffff" # White
|
||||
col_nb="#121212" # Normal background
|
||||
col_nf="#665c54" # Normal foreground
|
||||
col_sb="#121212" # Selected background
|
||||
col_sf="#2e9ef4" # Selected foreground
|
||||
font="JetbrainsMono"
|
||||
font_size="10"
|
||||
|
||||
[ -e "$HOME/.config/menu-config" ] && MENU="$(cat "$HOME/.config/menu-config")"
|
||||
|
||||
# Print help
|
||||
if [ "$PROMPT" = "" -o "$PROMPT" = "-h" ] ; then
|
||||
printf "Usage: menu [prompt] [run/pass/empty]"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check for 'pass' arg
|
||||
[ "$MODE" = "pass" ] &&
|
||||
BPASS="-x" && DPASS="-P"
|
||||
|
||||
# bemenu opts
|
||||
BEMENU_OPTS=$(printf " \
|
||||
-c \
|
||||
menu_bemenu() {
|
||||
bemenu$BRUN \
|
||||
--no-exec \
|
||||
-i \
|
||||
-c \
|
||||
-l 10 \
|
||||
-W 0.3 \
|
||||
-W 0.4 \
|
||||
-B 1 \
|
||||
--cw 1 \
|
||||
--tb $col_sb \
|
||||
--tf $col_nf \
|
||||
--fb $col_nb \
|
||||
--ff $col_nf \
|
||||
--ff $col_white \
|
||||
--cb $col_nb \
|
||||
--cf $col_nf \
|
||||
--nb $col_nb \
|
||||
|
@ -45,13 +37,13 @@ BEMENU_OPTS=$(printf " \
|
|||
--ab $col_nb \
|
||||
--af $col_nf \
|
||||
--bdr $col_sf \
|
||||
--fn "$font" \
|
||||
--fn "$font $font_size" \
|
||||
-p "$PROMPT" \
|
||||
$BPASS \
|
||||
")
|
||||
$BPASS
|
||||
}
|
||||
|
||||
# dmenu opts
|
||||
DMENU_OPTS=" \
|
||||
menu_dmenu() {
|
||||
dmenu$DRUN \
|
||||
-i \
|
||||
-l 10 \
|
||||
-nb $col_nb \
|
||||
|
@ -60,41 +52,18 @@ DMENU_OPTS=" \
|
|||
-sf $col_sf \
|
||||
-fn "$font:size=$font_size" \
|
||||
-p "$PROMPT" \
|
||||
$DPASS \
|
||||
"
|
||||
$DPASS
|
||||
}
|
||||
|
||||
# tofi opts
|
||||
TOFI_OPTS=" \
|
||||
--prompt-text "$PROMPT " \
|
||||
"
|
||||
menu_tofi() {
|
||||
tofi$TRUN \
|
||||
--prompt-text "$PROMPT"
|
||||
}
|
||||
|
||||
# fzf opts
|
||||
FZF_OPTS=" \
|
||||
menu_fzf() {
|
||||
fzf \
|
||||
--cycle \
|
||||
--reverse \
|
||||
"
|
||||
--reverse
|
||||
}
|
||||
|
||||
# If chosen bemenu, use this args
|
||||
[ "$MENU" = "bemenu" ] &&
|
||||
OPTS="$BEMENU_OPTS" &&
|
||||
RUN="-run"
|
||||
|
||||
# If chosen dmenu, use this args
|
||||
[ "$MENU" = "dmenu" ] &&
|
||||
OPTS="$DMENU_OPTS" &&
|
||||
RUN="_run"
|
||||
|
||||
# If chosen tofi, use this args
|
||||
[ "$MENU" = "tofi" ] &&
|
||||
OPTS="$TOFI_OPTS" &&
|
||||
RUN="-run"
|
||||
|
||||
# If chosen fzf, use this args
|
||||
[ "$MENU" = "fzf" ] &&
|
||||
OPTS="$FZF_OPTS" &&
|
||||
RUN=""
|
||||
|
||||
[ "$MODE" = "run" ] && $MENU$RUN $OPTS
|
||||
[ "$MODE" = "pass" ] && < /dev/null | $MENU $OPTS
|
||||
[ "$MODE" = "empty" ] && < /dev/null | $MENU $OPTS
|
||||
[ -z "$MODE" ] && $MENU $OPTS
|
||||
$menu
|
||||
|
|
5
scripts/sway/swayotp
Executable file
5
scripts/sway/swayotp
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
password="$(~/.config/scripts/menu/menu-pass)"
|
||||
[ -z "$password" ] && exit
|
||||
ydotool type $(pass otp "$password")
|
5
scripts/sway/swaypass
Executable file
5
scripts/sway/swaypass
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
password="$(~/.config/scripts/menu/menu-pass)"
|
||||
[ -z "$password" ] && exit
|
||||
ydotool type $(pass "$password" | head -n 1)
|
|
@ -26,8 +26,8 @@ set $up k
|
|||
set $right l
|
||||
set $term foot
|
||||
set $menu ~/.config/scripts/menu/menu "Run:" run | xargs swaymsg exec --
|
||||
set $passmgr ydotool type $(pass $(~/.config/scripts/menu/menu-pass) | head -n 1)
|
||||
set $passotp ydotool type $(pass otp $(~/.config/scripts/menu/menu-pass))
|
||||
set $passmgr ~/.config/scripts/sway/swaypass
|
||||
set $passotp ~/.config/scripts/sway/swayotp
|
||||
set $volup ~/.config/scripts/volup
|
||||
set $voldown ~/.config/scripts/voldown
|
||||
set $mute ~/.config/scripts/mute
|
||||
|
@ -101,7 +101,7 @@ gaps inner 5
|
|||
bar {
|
||||
position bottom
|
||||
font pango:JetBrainsMono Bold 9
|
||||
status_command ~/.config/scripts/status/sway
|
||||
status_command ~/.config/scripts/sway/swaystatus
|
||||
height 20
|
||||
|
||||
colors {
|
||||
|
|
Loading…
Reference in a new issue