org
This commit is contained in:
parent
b78fce30e2
commit
7f1c39f413
8
.config/systemd/user/org-mount.service
Normal file
8
.config/systemd/user/org-mount.service
Normal file
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Org start rclone
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/t/.org.tool/rclone.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@ -1,17 +1,32 @@
|
||||
{
|
||||
"layer": "top", // Waybar at top layer
|
||||
"position": "bottom", // Waybar at the bottom of your screen
|
||||
"height": 24, // Waybar height
|
||||
// "width": 1366, // Waybar width
|
||||
// Choose the order of the modules
|
||||
"modules-left": ["hyprland/workspaces", "hyprland/mode", "custom/spotify"],
|
||||
"layer": "bottom",
|
||||
"position": "bottom",
|
||||
"height": "24px",
|
||||
"modules-left": ["hyprland/workspaces"],
|
||||
"modules-right": [
|
||||
"custom/org-lock",
|
||||
"pulseaudio",
|
||||
"backlight",
|
||||
"network",
|
||||
"battery",
|
||||
"clock",
|
||||
"battery",
|
||||
"power-profiles-daemon",
|
||||
],
|
||||
"custom/org-lock": {
|
||||
"exec": "/home/t/.org.tool/waybar-lock.sh",
|
||||
"on-click": "/home/t/.org.tool/waybar-click.sh",
|
||||
"format": "org {}",
|
||||
},
|
||||
"power-profiles-daemon": {
|
||||
"format": "{icon}",
|
||||
"tooltip": false,
|
||||
"format-icons": {
|
||||
"default": "",
|
||||
"performance": "",
|
||||
"balanced": "",
|
||||
"power-saver": ""
|
||||
}
|
||||
},
|
||||
"backlight": {
|
||||
"device": "intel_backlight",
|
||||
"format": "{percent}% {icon}",
|
||||
@ -21,7 +36,7 @@
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
"",
|
||||
]
|
||||
},
|
||||
"clock": {
|
||||
@ -33,13 +48,11 @@
|
||||
"battery": {
|
||||
"bat": "BAT0",
|
||||
"states": {
|
||||
// "good": 95,
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
// "good": "95px",
|
||||
"warning": "30px",
|
||||
"critical": "15px"
|
||||
},
|
||||
"format": "{capacity}% {icon}",
|
||||
// "format-good": "", // An empty format will hide the module
|
||||
// "format-full": "",
|
||||
"format-icons": ["", "", "", "", ""]
|
||||
},
|
||||
"network": {
|
||||
@ -48,7 +61,6 @@
|
||||
"format-disconnected": "DISCONNECTED"
|
||||
},
|
||||
"pulseaudio": {
|
||||
//"scroll-step": 1,
|
||||
"format": "{volume}% {icon}",
|
||||
"format-bluetooth": "{volume}% {icon}",
|
||||
"format-muted": "",
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
* {
|
||||
min-height: 0;
|
||||
min-height: 13px;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: -1;
|
||||
margin: -1px;
|
||||
font-family: "Intel one mono";
|
||||
font-size: 11px;
|
||||
}
|
||||
@ -30,13 +30,15 @@ window#waybar {
|
||||
|
||||
color: rgb(0, 204, 255);
|
||||
}
|
||||
#clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode, #backlight {
|
||||
#custom-org-lock, #clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode, #backlight, #power-profiles-daemon {
|
||||
padding: 0 8px;
|
||||
margin: -1 2px;
|
||||
margin: 0px 2px;
|
||||
}
|
||||
#custom-org-lock {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-weight: bold;
|
||||
margin-right: -5px;
|
||||
}
|
||||
|
||||
#battery {
|
||||
@ -101,15 +103,22 @@ window#waybar {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
}
|
||||
|
||||
#custom-spotify {
|
||||
color: rgb(102, 220, 105);
|
||||
}
|
||||
|
||||
#tray {
|
||||
}
|
||||
#power-profiles-daemon {
|
||||
margin-left: -5px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
#power-profiles-daemon.performance {
|
||||
color: purple;
|
||||
}
|
||||
#power-profiles-daemon.balanced {
|
||||
color: rgb(0, 204, 255);
|
||||
}
|
||||
#power-profiles-daemon.power-saver {
|
||||
color: rgb(102, 220, 105);
|
||||
}
|
||||
|
||||
5
.org.tool/download.sh
Executable file
5
.org.tool/download.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
echo DOWNLOADING > "/home/t/.org.offline.status"
|
||||
rclone copy org: /home/t/org/
|
||||
restic backup /home/t/org/ --insecure-no-password -r /home/t/.org.backup/
|
||||
echo "DONE" > "/home/t/.org.offline.status"
|
||||
16
.org.tool/lock_offline.sh
Executable file
16
.org.tool/lock_offline.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Listening to changes"
|
||||
wait_to_upload=false
|
||||
inotifywait -qmr -e modify,delete,create /home/t/org | while read DIRECTORY EVENT FILE; do
|
||||
STATUS=$(cat "/home/t/.org.offline.status")
|
||||
if [ wait_to_upload ]; then
|
||||
echo UPLOAD
|
||||
echo "UPLOAD" > "/home/t/.org.offline.status"
|
||||
elif [ $STATUS = "DONE" ]; then
|
||||
echo UPLOAD
|
||||
echo "UPLOAD" > "/home/t/.org.offline.status"
|
||||
else
|
||||
wait_to_upload=true
|
||||
fi
|
||||
done
|
||||
4
.org.tool/master.sh
Executable file
4
.org.tool/master.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
inotifywait -qmr -e modify,delete,create /home/t/org | while read DIRECTORY EVENT FILE; do
|
||||
echo "UPLOAD" > "/home/t/.org.offline.status"
|
||||
done
|
||||
6
.org.tool/rclone.sh
Executable file
6
.org.tool/rclone.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
rclone mount \
|
||||
org: \
|
||||
/home/t/.org.mnt \
|
||||
--vfs-cache-mode full \
|
||||
--poll-interval 15s
|
||||
5
.org.tool/upload.sh
Executable file
5
.org.tool/upload.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
echo "UPLOADING" > "/home/t/.org.offline.status"
|
||||
rclone copy /home/t/org/ org:
|
||||
restic backup /home/t/org/ --insecure-no-password -r /home/t/.org.backup/
|
||||
echo "DONE" > "/home/t/.org.offline.status"
|
||||
15
.org.tool/waybar-click.sh
Executable file
15
.org.tool/waybar-click.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
case $(cat "/home/t/.org.offline.status") in
|
||||
"DONE")
|
||||
echo to download
|
||||
/home/t/.org.tool/download.sh >&1
|
||||
;;
|
||||
"UPLOAD")
|
||||
echo to upload
|
||||
/home/t/.org.tool/upload.sh
|
||||
;;
|
||||
*)
|
||||
echo to nothing$(cat "/home/t/.org.offline.status")
|
||||
;;
|
||||
esac
|
||||
28
.org.tool/waybar-lock.sh
Executable file
28
.org.tool/waybar-lock.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
inotifywait -qmr -e modify,delete,create /home/t/org | while read DIRECTORY EVENT FILE; do
|
||||
echo "UPLOAD" > "/home/t/.org.offline.status"
|
||||
done &
|
||||
|
||||
print() {
|
||||
case $1 in
|
||||
"UPLOAD")
|
||||
echo ""
|
||||
;;
|
||||
"UPLOADING")
|
||||
echo ""
|
||||
;;
|
||||
"DOWNLOADING")
|
||||
echo ""
|
||||
;;
|
||||
"DONE")
|
||||
echo
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
print $(cat "/home/t/.org.offline.status")
|
||||
|
||||
inotifywait -qm -e modify "/home/t/.org.offline.status" | while read DIRECTORY EVENT FILE; do
|
||||
print $(cat "/home/t/.org.offline.status")
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user