mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
add qcode script
To make this script particularly useful, configure a keyboard shortcut
for it and tell i3 to float the feh window.
Example:
4f7c1c9ea6
Original script source:
https://raw.githubusercontent.com/lathan/dotfiles/master/scripts/clipqr.sh
This commit is contained in:
parent
009998dbb6
commit
9e9f078483
3 changed files with 33 additions and 0 deletions
22
roles/media/files/qcode.sh
Executable file
22
roles/media/files/qcode.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Generate a QR Code and display the resulting image.
|
||||
#
|
||||
# Data to encode may be provided either through standard input or as an
|
||||
# argument. If no data is provided, the clipboard content will be used.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
IMG_VIEWER="feh -x --title qcode -"
|
||||
|
||||
read -t 0 stdin
|
||||
|
||||
if [ -n "$stdin" ]; then
|
||||
source="$stdin"
|
||||
elif [ -n "$1" ]; then
|
||||
source="$1"
|
||||
else
|
||||
source=$(xclip -o -selection clipboard)
|
||||
fi
|
||||
|
||||
echo "$source" | qrencode --size=10 -o - | $IMG_VIEWER -
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
- include: teiler.yml
|
||||
- include: flac2all.yml
|
||||
- include: darktable.yml
|
||||
- include: qcode.yml
|
||||
|
||||
- name: Install misc media codecs and helpers
|
||||
pacman: name={{ item }} state=present
|
||||
|
|
|
|||
10
roles/media/tasks/qcode.yml
Normal file
10
roles/media/tasks/qcode.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Install qrencode
|
||||
pacman: name=qrencode state=present
|
||||
tags:
|
||||
- qcode
|
||||
|
||||
- name: Push qcode script
|
||||
copy: src=qcode.sh dest=/usr/local/bin/qcode mode=0755
|
||||
tags:
|
||||
- qcode
|
||||
Loading…
Add table
Add a link
Reference in a new issue