Crates.io | xraise |
lib.rs | xraise |
version | 0.1.0 |
source | src |
created_at | 2017-01-03 14:55:22.886158 |
updated_at | 2017-01-03 14:55:22.886158 |
description | Fast X Window Raiser |
homepage | |
repository | https://github.com/k0kubun/xraise |
max_upload_size | |
id | 7903 |
size | 7,082 |
A command to raise X Window, which is like a following shell script but faster.
command="..."
while read line; do
pid="$(echo "$line" | cut -d" " -f4)"
if [ "x${command}" = "x$(cat "/proc/${pid}/cmdline")" ]; then
window_id="$(echo "$line" | cut -d" " -f1)"
exec wmctrl -i -R "$window_id"
fi
done <<< "$(wmctrl -l -p)"
exec "${command}"
$ cargo install xraise
$ xraise
24183 /opt/google/chrome/chrome: 'GitHub - Google Chrome'
24183 /opt/google/chrome/chrome: 'LINE'
22179 /usr/lib/slack/slack: 'Slack - k0kubun'
26781 /usr/share/nocturn/Nocturn: 'Nocturn'
27546 urxvt: 'urxvt'
# Activate or launch slack, urxvt
$ xraise /usr/lib/slack/slack
$ xraise urxvt
# Activate or launch Google Chrome, LINE
$ xraise /opt/google/chrome/chrome "Google Chrome" # tail match
$ xraise /opt/google/chrome/chrome LINE
MIT License