dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

[BUG] ml4w-cliphist ignores parameters 'w' (wipe) and 'd' (delete) when walker is set as launcher

Open tetam01 opened this issue 5 months ago • 0 comments

Describe the bug

When walker is configured as the default launcher, running the script ~/.config/ml4w/scripts/ml4w-cliphist with arguments (such as w for wipe or d for delete) completely ignores them. Instead, it always launches the standard Walker clipboard selector (launch.sh -m clipboard -N -H).

This prevents Waybar actions like middle-click (wipe) and right-click (delete) from working when using Walker.

Steps to reproduce

  1. Set launcher to walker in ML4W settings.
  2. Middle-click the cliphist module in Waybar (which executes ml4w-cliphist w).
  3. Instead of wiping the history, the standard Walker clipboard launcher opens.

Expected behavior

Running ml4w-cliphist w should clear the clipboard history database without opening any launcher window. Since Walker doesn't use cliphist but its own daemon elephant with a custom binary database (~/.cache/elephant/clipboard.gob), the wipe action should clear both databases. Running ml4w-cliphist d should handle the deletion of a single item. For Walker, since there is no CLI way to delete a single item from the .gob cache, it should launch the normal Walker clipboard UI so the user can delete the highlighted item interactively using Ctrl+D. Running ml4w-cliphist without parameters should launch the clipboard manager menu (Rofi or Walker) to copy items.

Screenshots

No response

Distribution

Arch Linux

If Other, specify

No response

Additional context

To resolve this issue, replace the contents of ~/.config/ml4w/scripts/ml4w-cliphist with

#!/usr/bin/env bash
#   ____ _ _       _     _     _
#  / ___| (_)_ __ | |__ (_)___| |_
# | |   | | | '_ \| '_ \| / __| __|
# | |___| | | |_) | | | | \__ \ |_
#  \____|_|_| .__/|_| |_|_|___/\__|
#           |_|
#

# -----------------------------------------------------
# Load Launcher
# -----------------------------------------------------
launcher=$(cat $HOME/.config/ml4w/settings/launcher)

case $1 in
    d)
        if [ "$launcher" == "walker" ]; then
            # Walker uses its own database. Deletion is done via Ctrl+D in the UI.
            $HOME/.config/walker/launch.sh -m clipboard -N -H
        else
            cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi | cliphist delete
        fi
    ;;
    w)
        cliphist wipe
        if [ "$launcher" == "walker" ]; then
            pkill elephant
            rm -f $HOME/.cache/elephant/clipboard.gob
            rm -rf $HOME/.cache/elephant/clipboardimages/*
        fi
    ;;
    *)
        if [ "$launcher" == "walker" ]; then
            $HOME/.config/walker/launch.sh -m clipboard -N -H
        else
            cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi | cliphist decode | wl-copy
        fi
    ;;
esac

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

tetam01 avatar Jun 21 '26 08:06 tetam01