Commit graph

4 commits

Author SHA1 Message Date
Chris Down 333ebc513d clipctl: Fix tests
We now use clipctl in tests and must account for using the local
version.
2021-01-29 01:22:21 +00:00
Axel Dahlberg 17823bacea
Added commands to clipctl to check the status, toggle, get version and directory (#152) 2021-01-21 15:15:00 +00:00
Chris Down 9c16837227 clipctl: Make pgrep regex less taxing
For some reason, .* is really taxing for pgrep, but if you remove it
it's way faster...

    % \time -v pgrep -nf '.*clipmenud$'
    325286
	    Command being timed: "pgrep -nf .*clipmenud$"
	    User time (seconds): 0.83
	    System time (seconds): 0.00
	    Percent of CPU this job got: 100%
	    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.83
	    Average shared text size (kbytes): 0
	    Average unshared data size (kbytes): 0
	    Average stack size (kbytes): 0
	    Average total size (kbytes): 0
	    Maximum resident set size (kbytes): 7632
	    Average resident set size (kbytes): 0
	    Major (requiring I/O) page faults: 0
	    Minor (reclaiming a frame) page faults: 1418
	    Voluntary context switches: 1
	    Involuntary context switches: 3
	    Swaps: 0
	    File system inputs: 0
	    File system outputs: 0
	    Socket messages sent: 0
	    Socket messages received: 0
	    Signals delivered: 0
	    Page size (bytes): 4096
	    Exit status: 0
    % \time -v pgrep -nf 'clipmenud$'
    325286
	    Command being timed: "pgrep -nf clipmenud$"
	    User time (seconds): 0.04
	    System time (seconds): 0.00
	    Percent of CPU this job got: 100%
	    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.04
	    Average shared text size (kbytes): 0
	    Average unshared data size (kbytes): 0
	    Average stack size (kbytes): 0
	    Average total size (kbytes): 0
	    Maximum resident set size (kbytes): 7320
	    Average resident set size (kbytes): 0
	    Major (requiring I/O) page faults: 0
	    Minor (reclaiming a frame) page faults: 1257
	    Voluntary context switches: 1
	    Involuntary context switches: 7
	    Swaps: 0
	    File system inputs: 0
	    File system outputs: 0
	    Socket messages sent: 0
	    Socket messages received: 0
	    Signals delivered: 0
	    Page size (bytes): 4096
	    Exit status: 0
2020-03-28 14:12:49 +00:00
Chris Down 84fd3614ab clipmenud: Allow disable with USR1 and enable with USR2
This allows avoiding having to delete after the fact for things like
issues #57 and #98.

Why have this over just stopping clipmenud? Well:

1. Stopping clipmenud should usually be an init system action, but we
   are init-system agnostic. If we just exit, we don't have a way of
   reliably starting again.
2. Even if we *do* do it using the init system, we don't want some
   things (like a lingering xsel which owns the selection for
   CM_OWN_CLIPBOARD) being killed as well.
3. This is a nicer interface for things like password managers to stop
   clipmenu rather than stopping clipmenu entirely.
2020-03-25 19:13:22 +00:00