Adds bitwarden
This commit is contained in:
parent
e798bb5e1f
commit
a301315f2a
8 changed files with 84 additions and 15 deletions
|
|
@ -392,7 +392,7 @@ class Orchestrator {
|
||||||
this.#actFiles()
|
this.#actFiles()
|
||||||
|
|
||||||
if (this.#support.isValid) {
|
if (this.#support.isValid) {
|
||||||
this.#support.update(this.#fileMap.values().toArray());
|
this.#support.update([...this.#fileMap.values()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
|
|
@ -439,7 +439,7 @@ class Orchestrator {
|
||||||
}
|
}
|
||||||
await directory.close();
|
await directory.close();
|
||||||
|
|
||||||
this.#fileMap.values()
|
[...this.#fileMap.values()]
|
||||||
.filter(fileContainer => !availableFiles.includes(fileContainer.filepath))
|
.filter(fileContainer => !availableFiles.includes(fileContainer.filepath))
|
||||||
.forEach(value => {
|
.forEach(value => {
|
||||||
this.#fileMap.set(value.filepath, {
|
this.#fileMap.set(value.filepath, {
|
||||||
|
|
@ -473,7 +473,7 @@ class Orchestrator {
|
||||||
/**
|
/**
|
||||||
* @type {Device}
|
* @type {Device}
|
||||||
*/
|
*/
|
||||||
const selectedDevice = this.#devices.values().find((device) => device.name === deviceName) ?? { name: deviceName }
|
const selectedDevice = [...this.#devices.values()].find((device) => device.name === deviceName) ?? { name: deviceName }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
filepath: path,
|
filepath: path,
|
||||||
|
|
@ -499,7 +499,7 @@ class Orchestrator {
|
||||||
deviceMap.get(value.device.name).push(value);
|
deviceMap.get(value.device.name).push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const duplicates = deviceMap.values().filter(devices => devices.some(device => device.state !== 'invalid') && devices.length > 1);
|
const duplicates = [...deviceMap.values()].filter(devices => devices.some(device => device.state !== 'invalid') && devices.length > 1);
|
||||||
for (let duplicate of duplicates) {
|
for (let duplicate of duplicates) {
|
||||||
const container = duplicate[0];
|
const container = duplicate[0];
|
||||||
this.#notifications.sendNotification(
|
this.#notifications.sendNotification(
|
||||||
|
|
@ -530,7 +530,7 @@ ${duplicate.map((file) => `- ${file.filepath}`).join('\n')}\`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousDuplicates = deviceMap.values().filter(devices => devices[0].state === 'invalid' && devices.length < 2);
|
const previousDuplicates = [...deviceMap.values()].filter(devices => devices[0].state === 'invalid' && devices.length < 2);
|
||||||
previousDuplicates.forEach((previousDuplicate) => {
|
previousDuplicates.forEach((previousDuplicate) => {
|
||||||
const duplicate = previousDuplicate[0];
|
const duplicate = previousDuplicate[0];
|
||||||
this.#fileMap.set(duplicate.filepath, {
|
this.#fileMap.set(duplicate.filepath, {
|
||||||
|
|
@ -539,7 +539,7 @@ ${duplicate.map((file) => `- ${file.filepath}`).join('\n')}\`
|
||||||
})
|
})
|
||||||
|
|
||||||
this.#logger.log(
|
this.#logger.log(
|
||||||
`==> Marking device ${duplicate.device} as valid, due to having only one file`,
|
`==> Marking device ${duplicate.device.name} as valid, due to having only one file`,
|
||||||
'ORCHESTRATOR',
|
'ORCHESTRATOR',
|
||||||
'INFO'
|
'INFO'
|
||||||
);
|
);
|
||||||
|
|
@ -618,7 +618,7 @@ s
|
||||||
|
|
||||||
const message = this.#notifications.sendReplaceableNotification({
|
const message = this.#notifications.sendReplaceableNotification({
|
||||||
summary: "Please wait...",
|
summary: "Please wait...",
|
||||||
message: Orchestrator.NOTIFICATION_STARTING.replace('{device}', file.device),
|
message: Orchestrator.NOTIFICATION_STARTING.replace('{device}', file.device.name),
|
||||||
urgency: "critical",
|
urgency: "critical",
|
||||||
});
|
});
|
||||||
this.#logger.log(
|
this.#logger.log(
|
||||||
|
|
@ -709,15 +709,15 @@ s
|
||||||
switch (reason) {
|
switch (reason) {
|
||||||
default:
|
default:
|
||||||
case "GENERIC":
|
case "GENERIC":
|
||||||
notificationMessage = Orchestrator.NOTIFICATION_GENERIC_PROCESS_STOP.replace('{device}', file.device)
|
notificationMessage = Orchestrator.NOTIFICATION_GENERIC_PROCESS_STOP.replace('{device}', file.device.name)
|
||||||
logMessage = `Removing process for device '${file.device.name}' from file '${file.filepath}', due to unknown reason`
|
logMessage = `Removing process for device '${file.device.name}' from file '${file.filepath}', due to unknown reason`
|
||||||
break;
|
break;
|
||||||
case "REMOVED_FILE":
|
case "REMOVED_FILE":
|
||||||
notificationMessage = Orchestrator.NOTIFICATION_MISSING_FILE_PROCESS_STOP.replace('{device}', file.device)
|
notificationMessage = Orchestrator.NOTIFICATION_MISSING_FILE_PROCESS_STOP.replace('{device}', file.device.name)
|
||||||
logMessage = `Removing process for device '${file.device.name}' from file '${file.filepath}', due to a removed file`
|
logMessage = `Removing process for device '${file.device.name}' from file '${file.filepath}', due to a removed file`
|
||||||
break;
|
break;
|
||||||
case "INVALID_FILE":
|
case "INVALID_FILE":
|
||||||
notificationMessage = Orchestrator.NOTIFICATION_INVALID_FILE_PROCESS_STOP.replace('{device}', file.device)
|
notificationMessage = Orchestrator.NOTIFICATION_INVALID_FILE_PROCESS_STOP.replace('{device}', file.device.name)
|
||||||
logMessage = `Removing process for device '${file.device.name}' from file '${file.filepath}', due to a invalid file`
|
logMessage = `Removing process for device '${file.device.name}' from file '${file.filepath}', due to a invalid file`
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ bind = $mainMod, N, exec, $scriptsDir/LockScreen.sh # screen lock
|
||||||
bind = , Print, exec, $scriptsDir/ScreenShot.sh --area # screenshot (area)
|
bind = , Print, exec, $scriptsDir/ScreenShot.sh --area # screenshot (area)
|
||||||
bind = , F12, exec, $scriptsDir/ScreenShot.sh --active # screenshot (active window only)
|
bind = , F12, exec, $scriptsDir/ScreenShot.sh --active # screenshot (active window only)
|
||||||
|
|
||||||
bind = $mainMod SHIFT, N, exec, swaync-client -t -sw # swayNC notification panel
|
bind = $mainMod SHIFT, N, exec, $scriptsDir/Toolkit.sh # swayNC notification panel
|
||||||
|
|
||||||
|
|
||||||
bind = $mainMod SHIFT, L, movecurrentworkspacetomonitor, r
|
bind = $mainMod SHIFT, L, movecurrentworkspacetomonitor, r
|
||||||
|
|
@ -118,6 +118,7 @@ bind = $mainMod Shift, Return, exec, hyprdrop ghostty --identifier term_hyprdrop
|
||||||
bind = $mainMod, T, exec, $files
|
bind = $mainMod, T, exec, $files
|
||||||
|
|
||||||
bind = $mainMod, R, focusurgentorlast
|
bind = $mainMod, R, focusurgentorlast
|
||||||
|
bind = $mainMod, P, exec, $scriptsDir/Bitwarden.sh
|
||||||
|
|
||||||
# Master Layout Keybinds
|
# Master Layout Keybinds
|
||||||
bind = $mainMod, A, layoutmsg,swapwithmaster master
|
bind = $mainMod, A, layoutmsg,swapwithmaster master
|
||||||
|
|
|
||||||
|
|
@ -43,4 +43,4 @@ exec-once = hyprswitch init --show-title --size-factor 5.5 --workspaces-per-row
|
||||||
exec-once = hyprsunset &
|
exec-once = hyprsunset &
|
||||||
exec-once = hyprshade auto
|
exec-once = hyprshade auto
|
||||||
exec-once = sleep 1 && darkman run &
|
exec-once = sleep 1 && darkman run &
|
||||||
|
exec-once = bitwarden-daemon &
|
||||||
|
|
|
||||||
42
.config/hypr/scripts/Bitwarden.sh
Executable file
42
.config/hypr/scripts/Bitwarden.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/env sh
|
||||||
|
|
||||||
|
declare -A actions
|
||||||
|
actions['Sync']="sync"
|
||||||
|
actions["Logout"]="logout"
|
||||||
|
actions["Lock"]="lock"
|
||||||
|
|
||||||
|
printSelection() {
|
||||||
|
echo "$1"
|
||||||
|
for key in "${!fruits[@]}"
|
||||||
|
do
|
||||||
|
echo "Action: $key"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
formattedIDs=$(echo "format:[NAME] ([USERNAME])" | nc -U /tmp/bitwarden-daemon.sock)
|
||||||
|
|
||||||
|
selectionList=$(echo "$formattedIDs" | jq 'keys | map("\(.)\n") | add' -r)
|
||||||
|
actionSelectionList=$(printf "Actions: %s\n" ${!actions[@]})
|
||||||
|
selection=$(printf "%s\n" "$selectionList" "$actionSelectionList" | anyrun --plugins libstdin.so)
|
||||||
|
|
||||||
|
echo "$selection"
|
||||||
|
|
||||||
|
if [[ $selection == '' ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $selection == Actions:* ]]; then
|
||||||
|
actionKey="${selection:9}"
|
||||||
|
action="${actions[$actionKey]}"
|
||||||
|
echo "Performing: $action"
|
||||||
|
|
||||||
|
echo "$action:" | nc -U /tmp/bitwarden-daemon.sock
|
||||||
|
else
|
||||||
|
id=$(echo "$formattedIDs" | jq ".[\"${selection}\"]" -r)
|
||||||
|
echo "lookupPassword:$id" | nc -U /tmp/bitwarden-daemon.sock | wl-copy
|
||||||
|
|
||||||
|
notify-send "Password copied" "Copied password for '$selection' to clipboard."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0;
|
||||||
|
|
||||||
15
.config/hypr/scripts/Toolkit.sh
Executable file
15
.config/hypr/scripts/Toolkit.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/env sh
|
||||||
|
|
||||||
|
SCRIPTS_DIR="$HOME/.config/hypr/scripts"
|
||||||
|
|
||||||
|
declare -A scripts
|
||||||
|
scripts["Shutdown"]="systemctl poweroff"
|
||||||
|
scripts["Reboot"]="systemctl reboot"
|
||||||
|
scripts["Logout"]="logout terminate-user $USER"
|
||||||
|
scripts["Lock"]="$SCRIPTS_DIR/LockScreen.sh"
|
||||||
|
scripts["Notification Center (SwayNC)"]="swaync-client -t -sw"
|
||||||
|
|
||||||
|
selected=$(printf "%s\n" "${!scripts[@]}" | anyrun --plugins libstdin.so)
|
||||||
|
|
||||||
|
command="${scripts[$selected]}"
|
||||||
|
$command
|
||||||
|
|
@ -20,12 +20,11 @@ entry {
|
||||||
padding: $input-padding;
|
padding: $input-padding;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
color: $foreground
|
color: $foreground;
|
||||||
}
|
}
|
||||||
|
|
||||||
list#main {
|
list#main {
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
//padding: 0.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
list#plugin {
|
list#plugin {
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,5 @@ addApplications neovim \
|
||||||
btop \
|
btop \
|
||||||
zoxide fzf \
|
zoxide fzf \
|
||||||
wifi-qr neovim \
|
wifi-qr neovim \
|
||||||
brightnessctl
|
brightnessctl \
|
||||||
|
nodejs-lts-iron
|
||||||
|
|
|
||||||
11
.config/yadm/bootstrap.v2/applications/40-Bitwarden.sh
Executable file
11
.config/yadm/bootstrap.v2/applications/40-Bitwarden.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/env sh
|
||||||
|
|
||||||
|
addApplications bitwarden-cli zenity
|
||||||
|
|
||||||
|
addGitInstall "bitwarden-daemon" "ssh://git@git.php.fail:2222/neintonine/bitwarden-daemon.git" setupBitwardenDaemon
|
||||||
|
|
||||||
|
setupBitwardenDaemon() {
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
sudo npm install -g .
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue