This commit is contained in:
sankalp committed 2024-12-12 16:34:41 +05:45
1 parent 40274dcab2
commit 75c0c46ca7
13 files changed
+13 -233

No files matched your search

+1 -2
View File
@@ -6,7 +6,6 @@ from fabric.widgets.button import Button
from fabric.widgets.centerbox import CenterBox
from fabric.widgets.datetime import DateTime
from fabric.widgets.wayland import WaylandWindow as Window
from modules.bar.widgets import (
BatteryLabel,
BluetoothIndicator,
@@ -50,7 +49,7 @@ class Bar(Window):
self.recording_indicator = Button(
name="bar-button",
child=MaterialIcon("screen_record", size="16px"),
child=MaterialIcon("screen_record", size=16),
visible=False,
on_clicked=lambda *_: self.screen_recorder.screencast_stop(),
)
-203
View File
@@ -1,203 +0,0 @@
/* we can use webcss variables, fabric compiles that to gtk css.
global variables can be stored in :vars */
:vars {
--background: #150d16;
--foreground: #f5dbc4;
--color0: #150d16;
--color1: #72448d;
--color2: #9c5995;
--color3: #d5719f;
--color4: #9a62f3;
--color5: #e075df;
--color6: #f98f9f;
--color7: #f5dbc4;
--color8: #ab9989;
--color9: #72448d;
--color10: #9c5995;
--color11: #d5719f;
--color12: #9a62f3;
--color13: #e075df;
--color14: #f98f9f;
--color15: #f5dbc4;
--window-bg: alpha(var(--background), 0.6);
--module-bg: alpha(var(--background), 0.4);
--border-color: var(--color11);
--ws-active: var(--color9);
--ws-inactive: var(--color3);
--ws-empty: var(--color8);
--ws-hover: var(--color1);
--ws-urgent: var(--color12);
}
@import url(../../../.cache/material/colors.css);
#bar {
background-color: @surface;
padding: 3px;
}
#bar label {
font-weight: bold;
}
#start-container,
#center-container,
#end-container {
padding-top: 6px;
padding-bottom: 6px;
margin-left: 12px;
margin-right: 12px;
}
#battery {
background-color: @surfaceContainer;
border-radius: 100px;
padding: 2px 10px 2px 10px;
}
#workspaces {
border-radius: 100px;
font-style: normal;
background: @surfaceContainer;
padding: 0px 10px 0px 10px;
}
#datetime {
background-color: @surfaceContainer;
border-radius: 100px;
padding: 8px;
}
#applets {
background-color: @surfaceContainer;
border-radius: 100px;
padding: 2px 10px 2px 10px;
margin: 0px;
}
#applets .icon {
color: @onSurface;
font-weight: 900;
}
#applets > button {
color: @onSurface;
margin: 0px;
padding: 0px;
}
#taskbar {
border-radius: 100px;
font-weight: bold;
font-style: normal;
color: @onSurface;
background: @surfaceContainer;
padding-left: 4px;
padding-right: 4px;
}
#taskbar .activated {
border-radius: 100px;
background: @surfaceVariant;
}
#taskbar > button {
padding: 0px 4px;
margin: 4px 0px;
border-radius: 100px;
border: 0px;
}
#taskbar > button:last-child {
margin-right: 0px;
}
#info {
background-color: @surfaceContainer;
border-radius: 100px;
padding: 2px 10px 0px 10px;
}
#info > button {
margin: 0px;
padding: 0px;
}
#info .progress {
color: lighter(@outlineVariant);
border: 2px solid @onSecondaryContainer;
}
#material_icon,
#material_icon * {
all: unset;
font-family: "Material Symbols Outlined", "Material Symbols Sharp";
}
/* unset so we can style everything from the ground up. */
* {
all: unset;
color: @foreground;
font-size: 16px;
font-family: "Product Sans", Roboto, "Font Awesome 6 Free", Helvetica, Arial,
sans-serif;
}
button {
background-size: 400% 400%;
}
menu > menuitem > label {
font-weight: 900;
}
/* system tray */
#system-tray {
padding: 2px 4px;
background-color: var(--module-bg);
}
/* menu and menu items (written for the system tray) */
menu {
border: solid 2px;
border-radius: 10px;
border-color: var(--border-color);
background-color: var(--window-bg);
}
menu > menuitem {
border-radius: 0px;
background-color: var(--module-bg);
padding: 6px;
margin-left: 2px;
margin-right: 2px;
}
menu > menuitem:first-child {
margin-top: 1px;
border-radius: 8px 8px 0px 0px;
}
menu > menuitem:last-child {
margin-bottom: 1px;
border-radius: 0px 0px 8px 8px;
}
menu > menuitem:hover {
background-color: var(--border-color);
}
tooltip {
background-color: @surfaceContainer;
border-radius: 11px;
outline: none;
border: none;
box-shadow: none;
}
tooltip label {
color: @onSurface;
outline: none;
border: none;
box-shadow: none;
font-weight: normal;
}
+1 -1
View File
@@ -50,7 +50,7 @@ class BatteryLabel(Box):
icons = self.ICONS_CHARGING if is_charging else self.ICONS_NOT_CHARGING
index = min(max(battery_percent // 10, 0), 10)
battery_icon = MaterialIcon(icons[index], size="16px")
battery_icon = MaterialIcon(icons[index], size=16)
self.children = (battery_icon, battery_label)
@@ -22,7 +22,7 @@ class BluetoothIndicator(Box):
self.ICON_ENABLED if self.bluetooth_client.enabled else self.ICON_DISABLED
)
new_icon = MaterialIcon(icon_label, size="16px")
new_icon = MaterialIcon(icon_label, size=16)
if self.bluetooth_icon:
self.remove(self.bluetooth_icon)
-16
View File
@@ -1,16 +0,0 @@
from fabric.widgets.label import Label
def MaterialIcon(icon_name: str, size: str = "24px", props: dict = None):
label_props = {
"label": icon_name, # Directly use the provided icon name
"name": "material_icon",
"style": f"font-size: {size}; ", # Set font family for Material Icons
"h_align": "center", # Align horizontally
"v_align": "center", # Align vertically
}
if props:
label_props.update(props)
return Label(**label_props)
+1 -1
View File
@@ -14,7 +14,7 @@ class IdleIndicator(Box):
self.children = [self.idle_icon]
def create_idle_icon(self):
return MaterialIcon("schedule", size="16px")
return MaterialIcon("schedule", size=16)
def check_idle_status(self, *_):
+1 -1
View File
@@ -49,7 +49,7 @@ class SystemInfo(Button):
return Label(style="font-size:14px; margin: 4px;")
def _create_icon(self, icon_name):
return MaterialIcon(icon_name, size="16px")
return MaterialIcon(icon_name, size=16)
def _refresh_system_info(self, *_):
usages = self._retrieve_system_data()
@@ -16,7 +16,7 @@ class MicrophoneIndicator(Box):
self.children = (self.microphone_icon,)
def create_microphone_icon(self):
return MaterialIcon("mic_off", size="16px")
return MaterialIcon("mic_off", size=16)
def update_microphone_status(self, *args):
current_microphone = self.audio_service.microphone
+1 -1
View File
@@ -25,7 +25,7 @@ class NetworkIndicator(Box):
return True
def update_icon(self, current_status):
self.icon_label = MaterialIcon(current_status, size="16px")
self.icon_label = MaterialIcon(current_status, size=16)
self.children = (self.icon_label,)
def get_network_status(self):
@@ -30,7 +30,7 @@ class PowerProfileIndicator(Box):
def update_icon(self, profile):
icon_name = PROFILE_ICONS.get(profile)
new_icon = MaterialIcon(icon_name, size="16px") if icon_name else None
new_icon = MaterialIcon(icon_name, size=16) if icon_name else None
if self.profile_icon:
self.remove(self.profile_icon)
+1 -1
View File
@@ -28,7 +28,7 @@ class VolumeIndicator(Box):
self.children = (self.volume_icon_button,)
def create_volume_icon(self):
icon = MaterialIcon(VOLUME_ICONS["muted"], size="16px")
icon = MaterialIcon(VOLUME_ICONS["muted"], size=16)
button = Button(child=icon)
button.icon_widget = icon
return button
+2 -2
View File
@@ -36,7 +36,7 @@ class BrightnessOSDContainer(Box):
def __init__(self, **kwargs):
super().__init__(**kwargs, orientation="h", spacing=12, name="osd")
self.brightness_service = Brightness()
self.icon = MaterialIcon(icon_name="brightness_7", size="28px")
self.icon = MaterialIcon(icon_name="brightness_7", size=28)
self.scale = AnimatedScale(
marks=(ScaleMark(value=i) for i in range(0, 101, 10)),
value=70,
@@ -102,7 +102,7 @@ class AudioOSDContainer(Box):
def __init__(self, **kwargs):
super().__init__(**kwargs, orientation="h", spacing=13, name="osd")
self.audio = Audio()
self.icon = MaterialIcon(icon_name="volume_up", size="28px")
self.icon = MaterialIcon(icon_name="volume_up", size=28)
self.scale = AnimatedScale(
marks=(ScaleMark(value=i) for i in range(1, 100, 10)),
value=70,
+2 -2
View File
@@ -1,11 +1,11 @@
from fabric.widgets.label import Label
def MaterialIcon(icon_name: str, size: str = "24px", props=None):
def MaterialIcon(icon_name: str, size: int = 24, props=None):
label_props = {
"label": str(icon_name), # Directly use the provided icon name
"name": "material_icon",
"style": f"font-size: {size}; ", # Set font family for Material Icons
"style": f"font-size: {size}px;", # Set font family for Material Icons
"h_align": "center", # Align horizontally
"v_align": "center", # Align vertically
}