Skip to content

Commit

Permalink
Merge pull request #56 from metacoma/fvwm
Browse files Browse the repository at this point in the history
Fvwm
  • Loading branch information
metacoma authored Nov 23, 2023
2 parents ab14b68 + cc63466 commit 5b76621
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 6 deletions.
1 change: 1 addition & 0 deletions files/fvwm/config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Module FvwmMLF
30 changes: 30 additions & 0 deletions files/fvwm/rabbitmq-osd-debug.py
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()
3 changes: 2 additions & 1 deletion inventory/classes/neo4j/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parameters:
neo4j_ip4_port: 7687
neo4j_release_name: neo4j
neo4j_namespace: neo4j
neo4j_version: 5.11.0
neo4j_version: 5.13.0
#neo4j_version: 4.4.0
neo4j_user: neo4j
neo4j_password: password
6 changes: 4 additions & 2 deletions inventory/classes/neo4j/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ classes:
- helm
- neo4j.common
parameters:
neo4j_chart_version: 5.11.0
neo4j_chart_version: 5.13.0
neo4j_chart_name: neo4j
# neo4j_chart_version: 4.4.27
neo4j_helm_chart_path: files/helm-charts/neo4j

bash:
Expand All @@ -18,4 +20,4 @@ parameters:
type: helm
source: https://helm.neo4j.com/neo4j
version: ${neo4j_chart_version}
chart_name: neo4j
chart_name: ${neo4j_chart_name}
8 changes: 8 additions & 0 deletions inventory/classes/rabbitmq/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ parameters:
name: openai
type: fanout
durable: true
clipboard:
name: clipboard
type: fanout
durable: true
events:
name: events
type: fanout
durable: true

rabbitmq_version: 3.12.4
rabbitmq_user: user
Expand Down
4 changes: 4 additions & 0 deletions inventory/classes/vector/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
parameters:
vector_http_server_port: 31398

80 changes: 80 additions & 0 deletions inventory/targets/fvwm.yml
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
18 changes: 18 additions & 0 deletions inventory/targets/neo4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ parameters:
neo4j:
name: ${neo4j_release_name}
password: ${neo4j_password}
config:
server.directories.plugins: "/var/lib/neo4j/labs"
dbms.security.procedures.unrestricted: "apoc.*"
server.config.strict_validation.enabled: "false"
dbms.security.procedures.allowlist: "apoc.*"
apoc_config:
apoc.export.file.enabled: "true"
apoc.trigger.enabled: "true"
apoc.import.file.enabled: "true"
env:
NEO4J_apoc_export_file_enabled: "true"
NEO4J_apoc_import_file_enabled: "true"
NEO4J_apoc_import_file_use__neo4j__config: "true"
NEO4J_PLUGINS: '["apoc-extended"]'
serviceMonitor:
enabled: false
podDisruptionBudget:
enabled: false
volumes:
data:
mode: defaultStorageClass
Expand Down
12 changes: 11 additions & 1 deletion inventory/targets/vector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classes:
# - vector.tmux-kafka
# - vector.console-output
- opensearch
- vector.common
- vector.config
- helm
- vector.helm
Expand Down Expand Up @@ -57,7 +58,6 @@ parameters:
)
vector_aggregator_port: ${mindwm:k8s:vector_aggregator_port}
vector_http_server_port: 31398



Expand Down Expand Up @@ -313,6 +313,16 @@ parameters:
encoding:
codec: json

events:
type: amqp
inputs:
- http_server
connection:
connection_string: "amqp://${rabbitmq_user}:${rabbitmq_password}@${rabbitmq_release_name}.${rabbitmq_namespace}:5672/%2f?timeout=10"
exchange: ${rabbitmq_exchanges:events:name}
encoding:
codec: json


# opensearch-tmux-io-context:
# type: elasticsearch
Expand Down
2 changes: 1 addition & 1 deletion lib/jsonnet/bash/scripts.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local p = inventory.parameters;
{
[func_name + ".sh"]: kap.jinja2_template("templates/bash/script.sh", {
inventory: inventory,
script: p.bash.functions[func_name] + " $*"
script: p.bash.functions[func_name]
}) for func_name in std.objectFieldsAll(p.bash.functions)
}

1 change: 0 additions & 1 deletion templates/bash/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ set -eo pipefail
. {{ p.compiled_dir }}/functions.bash

{{ script }}

0 comments on commit 5b76621

Please sign in to comment.