-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from metacoma/fvwm
Fvwm
- Loading branch information
Showing
11 changed files
with
159 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Module FvwmMLF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pika | ||
import pprint | ||
import json | ||
import re | ||
import libtmux | ||
import os | ||
import subprocess | ||
|
||
rabbitmq_url = "amqp://user:[email protected]:30466/%2f" | ||
|
||
connection = pika.BlockingConnection(pika.URLParameters(rabbitmq_url)) | ||
rabbitmq_channel = connection.channel() | ||
|
||
exchange_name = "events" | ||
result = rabbitmq_channel.queue_declare(queue="", exclusive=True) | ||
queue_name = result.method.queue | ||
|
||
rabbitmq_channel.queue_bind(exchange=exchange_name, queue=queue_name) | ||
|
||
def display_message(message): | ||
command = f'echo "{message}" | bash /home/bebebeko/mindwm/compiled/fvwm/bin/aosd_show.sh' | ||
subprocess.run(command, shell=True) | ||
|
||
def callback(ch, method, properties, body): | ||
pprint.pprint(body.decode()) | ||
display_message(body.decode()) | ||
|
||
rabbitmq_channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True) | ||
print("Waiting for messages. To exit, press Ctrl+C") | ||
rabbitmq_channel.start_consuming() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
parameters: | ||
vector_http_server_port: 31398 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
classes: | ||
- vim | ||
- bash.functions | ||
- bash.kapitan | ||
- bash.script | ||
- common | ||
- tmuxinator | ||
- tmuxinator.kapitan | ||
- vector.common | ||
parameters: | ||
target_name: fvwm | ||
|
||
bash: | ||
functions: | ||
aosd_show: | | ||
aosd_cat -x 700 -y -600 -e 1 -f 0 -u 1000 | ||
fvwm_send: | | ||
FvwmCommand -c -f /tmp/fvwm_mfl.sock | ||
clipnotify_run: | | ||
clipboard_type=$1 | ||
while ${clipnotify_bin} -s $clipboard_type; do | ||
cat<<EOF | jq | curl -X POST -d@- http://`minikube ip`:${vector_http_server_port}/event | ||
{ | ||
"event": { | ||
"type": "clipboard", | ||
"clipboard_type": "$clipboard_type", | ||
"clipboard": "$(xclip -out -selection $clipboard_type | base64 -w0)" | ||
} | ||
} | ||
EOF | ||
xclip -out -selection $clipboard_type 2>/dev/null | ||
done | ||
clipnotify_primary: | ||
clipnotify_run primary | ||
clipnotify_secondary: | ||
clipnotify_run secondary | ||
clipnotify_clipboard: | ||
clipnotify_run clipboard | ||
|
||
|
||
clipnotify_path: ${kapitan_root}/files/github.com/cdown/clipnotify | ||
clipnotify_bin: ${clipnotify_path}/clipnotify | ||
|
||
kapitan: | ||
dependencies: | ||
- source: https://github.com/cdown/clipnotify | ||
type: git | ||
output_path: ${clipnotify_path} | ||
ref: 25ba143c7da8ae0f196cb0db2797d30e6d04e15c | ||
|
||
tmuxinator: | ||
windows: | ||
fvwm: | ||
panes: | ||
- | ||
- cd ${kapitan_root}/files/fvwm | ||
- | ||
- cd ${kapitan_root}/files/fvwm | ||
- | ||
- cd ${kapitan_root}/files/fvwm | ||
clipnotify: | ||
panes: | ||
- | ||
- cd ${clipnotify_path} | ||
- # make | ||
- | ||
- cd ${clipnotify_path} | ||
- | ||
- clipnotify_primary | ||
- | ||
- clipnotify_secondary | ||
- | ||
- clipnotify_clipboard | ||
aosd-debug: | ||
panes: | ||
- | ||
- cd ${kapitan_root}/files/fvwm/ | ||
- . venv/bin/activate | ||
- python3 ./rabbitmq-osd-debug.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,3 @@ set -eo pipefail | |
. {{ p.compiled_dir }}/functions.bash | ||
|
||
{{ script }} | ||
|