Add custom linux-hardened deny_new_usb module

This commit is contained in:
theanonymousexyz 2022-04-16 18:51:22 +02:00
parent 3e00aa03f8
commit 3ab7c6aad7
No known key found for this signature in database
GPG key ID: 35EE09F5481049BB
3 changed files with 37 additions and 4 deletions

View file

@ -4,7 +4,7 @@
"height": 36, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["idle_inhibitor", "sway/workspaces", "sway/mode"],
"modules-left": ["idle_inhibitor", "sway/workspaces", "custom/usb", "sway/mode"],
"modules-center": ["clock"],
"modules-right": ["custom/ivpn", "network", "pulseaudio", "backlight", "cpu", "memory", "battery", "tray"],
// Modules configuration
@ -113,5 +113,11 @@
"return-type": "json",
"interval": 1,
"on-click": "$HOME/.config/waybar/ivpn-reconnect.sh"
},
"custom/usb": {
"format": "{} USB",
"exec": "$HOME/.config/waybar/usb-status.sh",
"return-type": "json",
"interval": 1,
}
}

View file

@ -30,8 +30,7 @@
* {
border: none;
border-radius: 0;
/* `otf-font-awesome` is required to be installed for icons */
/* Find Ubuntu Condensed font somewhere and install it in your system, it is NOT installed by default */
/* `ttf-font-awesome` is required to be installed for icons */
font-family: "Fira Sans Condensed SemiBold", "Font Awesome 6 Free Solid", "Font Awesome 6 Free Regular", "Font Awesome 6 Brands Regular", sans-serif;
font-size: 16px;
min-height: 0;
@ -47,6 +46,10 @@ window#waybar.hidden {
opacity: 0.5;
}
#workspaces {
margin: 0 5px;
}
#workspaces button {
background: transparent;
padding: 0px;
@ -86,7 +89,8 @@ window#waybar.hidden {
#mode,
#idle_inhibitor,
#mpd,
#custom-ivpn{
#custom-ivpn,
#custom-usb {
padding: 0 4px;
margin: 0 4px;
color: @white;
@ -205,3 +209,13 @@ label:focus {
color: @green;
box-shadow: inset 0 3px @green;
}
#custom-usb {
color: @orange;
box-shadow: inset 0 3px @orange;
}
#custom-usb.unprotected {
color: @red;
box-shadow: inset 0 3px @red;
}

View file

@ -0,0 +1,13 @@
#!/usr/bin/env dash
if usbctl check; then
TEXT="\uf023"
TOOLTIP="PROTECTED"
CLASS="protected"
else
TEXT="\uf3c1"
TOOLTIP="UNPROTECTED"
CLASS="unprotected"
fi
env echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}"