save point
This commit is contained in:
parent
795f72db03
commit
d60d417579
9 changed files with 48 additions and 1 deletions
0
README.md
Normal file → Executable file
0
README.md
Normal file → Executable file
3
config.json
Normal file
3
config.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"bashini": "new"
|
||||||
|
}
|
0
modules/config.ini
Normal file → Executable file
0
modules/config.ini
Normal file → Executable file
0
modules/config.json
Normal file → Executable file
0
modules/config.json
Normal file → Executable file
7
modules/gui.bash
Normal file
7
modules/gui.bash
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Function to show a notification using zenity
|
||||||
|
show_notification() {
|
||||||
|
local message="$1"
|
||||||
|
zenity --info --text="$message" --title="Notification"
|
||||||
|
}
|
0
modules/keydb.bash
Normal file → Executable file
0
modules/keydb.bash
Normal file → Executable file
12
modules/ntfy.bash
Normal file → Executable file
12
modules/ntfy.bash
Normal file → Executable file
|
@ -10,5 +10,15 @@ then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ntfyserver="http://192.168.168:83"
|
|
||||||
|
|
||||||
|
# Function to send a message to a NTFY server
|
||||||
|
send_ntfy_message() {
|
||||||
|
local message="$1"
|
||||||
|
local topic="$2"
|
||||||
|
ntfyserver="192.168.1.112:83"
|
||||||
|
local url="http://${ntfyserver}/${topic:-default}"
|
||||||
|
|
||||||
|
curl -X POST -d "$message" "$url"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
20
modules/zellij.bash
Normal file
20
modules/zellij.bash
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
config="main" # default config
|
||||||
|
export ZELLIJ_CONFIG="$config"
|
||||||
|
|
||||||
|
# Function to check if zellij is installed
|
||||||
|
is_zellij_installed() {
|
||||||
|
if ! command -v zellij &> /dev/null
|
||||||
|
then
|
||||||
|
echo "This module needs zellij to be installed."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_zellij_installed
|
||||||
|
|
||||||
|
# check if a session is already running
|
||||||
|
if pgrep -x "zellij" > /dev/null
|
||||||
|
then
|
||||||
|
zellij attach "$config"
|
|
@ -19,6 +19,13 @@ cleanup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
source ./modules/config_json.bash # can be json or ini, I preffer json
|
source ./modules/config_json.bash # can be json or ini, I preffer json
|
||||||
|
source ./modules/gui.bash
|
||||||
|
source ./modules/ntfy.bash
|
||||||
|
#source ./modules/keydb.bash
|
||||||
|
|
||||||
# Keydb / Redis interaction functions, works for both
|
# Keydb / Redis interaction functions, works for both
|
||||||
|
|
||||||
|
|
||||||
|
show_notification "Hello World!"
|
||||||
|
|
||||||
|
send_ntfy_message "Hello World!" "kuma"
|
Loading…
Add table
Add a link
Reference in a new issue