sway: use rofi

This commit is contained in:
Gabriel Ebner 2022-05-02 18:55:32 +02:00
parent e162a356e3
commit 542fe9eb4b
3 changed files with 30 additions and 5 deletions

View File

@ -24,10 +24,10 @@ bindsym $mod+Return exec alacritty
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill
bindsym $mod+d exec wofi --show run -i bindsym $mod+d exec rofi -show run
bindsym $mod+Tab exec ~/etc/wofi-windows bindsym $mod+Tab exec ~/etc/rofi-windows
bindsym $mod+shift+Tab exec ~/etc/wofi-windows movehere bindsym $mod+shift+Tab exec ~/etc/rofi-windows movehere
bindsym $mod+p exec ~/etc/wofi-pass bindsym $mod+p exec ~/etc/my-rofi-pass
define([dir_bind], [ define([dir_bind], [
bindsym $mod+$2 focus $1 bindsym $mod+$2 focus $1

View File

@ -13,7 +13,11 @@ list_accounts_beginning_with_blank_page() {
} }
do_type() { do_type() {
echo -n "$1" | xdotool type --delay=12 --file=- if [ -n "$WAYLAND_DISPLAY" ]; then
echo -n "$1" | wtype -s 100 -d 50 -
else
echo -n "$1" | xdotool type --delay=12 --file=-
fi
} }
get_passwd() { get_passwd() {

21
rofi-windows Executable file
View File

@ -0,0 +1,21 @@
#!/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')
case "$1" in
movehere)
cmd="move workspace current"
prompt="move window here"
;;
*)
cmd="focus"
prompt="go to window"
;;
esac
# Select window with rofi
selected=$(echo "$windows" | rofi -dmenu -p "$prompt" | awk '{print $1}')
# Tell sway to frobnicate said window
swaymsg "[con_id=$selected]" $cmd