Add wofi support.

This commit is contained in:
Gabriel Ebner 2020-07-14 15:36:35 +02:00
parent 52844192b7
commit ff58229b23
3 changed files with 37 additions and 0 deletions

@ -5,6 +5,7 @@ FILES = bashrc bash_profile vimrc zshrc gitconfig screenrc commonshrc liquidprom
config/khal config/vdirsyncer/config config/khard \
config/rofi-pass gdbinit notmuch-config \
config/fish tridactylrc config/sway/config config/mpv/mpv.conf \
config/wofi \
$(wildcard sbt/0.13/*.sbt sbt/0.13/plugins/*.sbt) \
$(wildcard sbt/1.0/plugins/*.sbt)

26
config/wofi/style.css Normal file

@ -0,0 +1,26 @@
window {
margin: 0px;
border: 1px solid #666;
background-color: #222;
color: white;
font-family: "Fira Code";
}
#input {
padding: 5px;
border: none;
background-color: #333;
color: white;
}
#inner-box, #input, #outer-box, #text {
margin: 5px;
}
#scroll {
margin: 0px;
}
#entry:selected {
background-color: #555;
}

10
wofi_windows.sh Executable file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Get available windows
windows=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.type=="con"),select(.type=="floating_con")|(.id|tostring)+" "+.app_id+": "+.name')
# Select window with rofi
selected=$(echo "$windows" | wofi --show dmenu -i | awk '{print $1}')
# Tell sway to focus said window
swaymsg "[con_id=$selected]" focus