Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ tdrop -ma -n signal --class=signal flatpak run org.signal.Signal
tdrop -ma -n firefox --class=firefox flatpak run org.mozilla.firefox
#+end_example

** Firefoxpwa

Tdrop finds the wrong pid when running firefoxpwa applications with the [Firefox pwa extension](https://addons.mozilla.org/en-US/firefox/addon/pwas-for-firefox/). Use the `--class` to find the correct window.

#+begin_example
tdrop --class "FFPWA-01JGKHRGAFKGFRJZ99Z0GTKNX4" firefoxpwa site launch 01JGKHRGAFKGFRJZ99Z0GTKNX4
#+end_example

** Flicker
For some window managers that require a window to be repositioned after re-mapping it, some flicker may be noticeable. This flicker has been mostly fixed for some window managers (e.g. in the Gnome Shell and Cinnamon DEs) and improved for others. It is usually worse on tiling managers where the window must be re-floated every time it is mapped. The way around this is to use rules to either always have the class or name (see =--name=) floated or one-time rules to only float the next instance of a class. For example, since bspwm has oneshot rules and generally doesn't alter the size/position of a window, there isn't any movement flicker.

Expand Down
8 changes: 8 additions & 0 deletions tdrop
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ set_class() {
elif [[ $program == wezterm ]]; then
# wezterm is normally installed through flatpak
class=org.wezfurlong.wezterm
elif [[ $program == firefoxpwa ]]; then
# firefoxpwa sets a custom class
# I don't know why it doesn't work if you don't set a class
error "--class is required with firefoxpwa but was not given."
elif [[ $program == flatpak ]]; then
# flatpak jails the application, the PID cannot be used to find
# the window. A specific class has to be given by the user.
Expand Down Expand Up @@ -819,6 +823,8 @@ create_win_return_wid() {
pid=$(pgrep -xa chrome | gawk '!/--type/ {print $1}')
elif [[ $program == firefox ]]; then
blacklist=$(xdotool search --name firefox)
elif [[ $program == firefoxpwa ]]; then
blacklist=$(xdotool search --classname "$class")
elif [[ $program =~ ^emacsclient ]]; then
blacklist=$(xdotool search --classname emacs)
elif [[ $program =~ ^(strawberry|clementine)$ ]]; then
Expand Down Expand Up @@ -861,6 +867,8 @@ create_win_return_wid() {
wids=$(xdotool search --classname "$class")
elif [[ $program == firefox ]]; then
wids=$(xdotool search --name firefox)
elif [[ $program == firefoxpwa ]]; then
wids=$(xdotool search --classname "$class")
elif [[ $program == tabbed ]]; then
wids=$(head -n 1 "$MUTDROP_PATH/program-output")
elif [[ $program =~ ^(postman|todoist)$ ]]; then
Expand Down