You are not logged in.

#1 2019-08-11 12:43:42

malm
jgmenu developer
Registered: 2016-10-13
Posts: 451
Website

xbindkeys pipemenu

Just a thought - would we want a pipemenu for xbindkeys?

#!/bin/bash

mapfile -t lines <"$HOME/.xbindkeysrc"

for i in "${!lines[@]}"; do

	# Look for the lines that begin with double quote
	[[ ${lines[i]} == \"* ]] || continue

	# Print the comment which @johnraff has helpfully added before
	# as well as the actual keybinding on the following line
	printf '%s\n' "${lines[i-1]/\# /}	${lines[i+1]/    /}"

done

2019-08-11-133827_1024x600_scrot.th.png

Offline

#2 2019-08-12 07:47:17

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,616
Website

Re: xbindkeys pipemenu

^Looks ideal. cool
Added to ToDo list - thanks!


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Online

#3 2019-08-12 17:34:34

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,799
Website

Re: xbindkeys pipemenu

@malm, What/Where is 'mapfile'?

Offline

#4 2019-08-12 20:21:34

malm
jgmenu developer
Registered: 2016-10-13
Posts: 451
Website

Re: xbindkeys pipemenu

@brontosaurusrex
It's a bash builtin which reads a file into an array.
See Bash-Builtins.html

It's fast and clean smile

Offline

#5 2019-08-12 20:45:02

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,799
Website

Re: xbindkeys pipemenu

Thanks ^.

Offline

Board footer

Powered by FluxBB