[AGS] Bar: Done (WiFi still missing, will be added at some later point)
This commit is contained in:
		
							
								
								
									
										26
									
								
								config/astal/components/bar/modules/Calendar.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								config/astal/components/bar/modules/Calendar.tsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| import { GLib, Variable } from "astal"; | ||||
| import { Gtk } from "astal/gtk4"; | ||||
|  | ||||
| const Time = ({ format = "%a, %e.%m %H:%M:%S" }) => { | ||||
|     const time = Variable<string>("").poll( | ||||
|         1000, | ||||
|         () => GLib.DateTime.new_now_local().format(format)!, | ||||
|     ); | ||||
|  | ||||
|     return ( | ||||
|         <menubutton | ||||
|             cssClasses={["time", "bar-button"]} | ||||
|             hexpand | ||||
|             halign={Gtk.Align.CENTER} | ||||
|         > | ||||
|             <label onDestroy={() => time.drop()} label={time()} halign={Gtk.Align.CENTER}></label> | ||||
|             <popover> | ||||
|                 <Gtk.Calendar /> | ||||
|             </popover> | ||||
|         </menubutton> | ||||
|     ); | ||||
| }; | ||||
|  | ||||
| export default { | ||||
|     Time, | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user