#!/bin/sh
current_layout=$(dbus-send --print-reply=literal --dest=org.kde.keyboard \
	/Layouts org.kde.KeyboardLayouts.getLayout | xargs | tr " " ":")

trap reset_layout 1 2 3 6 15
reset_layout() {
	dbus-send --type=method_call --dest=org.kde.keyboard /Layouts org.kde.KeyboardLayouts.setLayout "$current_layout"
}

dbus-send --type=method_call --dest=org.kde.keyboard /Layouts org.kde.KeyboardLayouts.setLayout uint32:0

rofi-rbw --typer=dotool --target=totp

reset_layout