[AGS] Fix crashing
This commit is contained in:
		| @@ -3,6 +3,7 @@ import style from "./style.scss" | ||||
| import Bar from "./components/bar/Bar"; | ||||
| import AstalHyprland from "gi://AstalHyprland?version=0.1"; | ||||
| import { hyprToGdk } from "./util/hyprland"; | ||||
| import { writeFile } from "astal"; | ||||
|  | ||||
| App.start({ | ||||
|     instanceName: "runner", | ||||
| @@ -40,6 +41,12 @@ App.start({ | ||||
|                 bars.delete( monitor ); | ||||
|             } | ||||
|         } ); | ||||
|  | ||||
|         // const monitors = App.get_monitors(); | ||||
|         // print( "adding bar to monitors" ); | ||||
|         // for (let index = 0; index < monitors.length; index++) { | ||||
|         //     Bar.BarLauncher( monitors[ index ] ); | ||||
|         // } | ||||
|     }, | ||||
|     requestHandler(request, res) { | ||||
|         const args = request.trimStart().split( ' ' ); | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { bind, readFile, writeFile } from "astal"; | ||||
| import { bind, exec, interval, readFile, timeout, writeFile } from "astal"; | ||||
| import { Gtk } from "astal/gtk4"; | ||||
| import AstalBluetooth from "gi://AstalBluetooth"; | ||||
| import BTDevice from "./Device"; | ||||
| @@ -70,12 +70,34 @@ const openBTPicker = () => { | ||||
|     picker.popup(); | ||||
|     try { | ||||
|         bt.adapter.start_discovery(); | ||||
|     } catch (_) {} | ||||
|     } catch (_) { } | ||||
| }; | ||||
|  | ||||
| const BluetoothPickerList = () => { | ||||
|     let btEnableState = readFile(`${DATADIR}./btconf`) === "true" ? true : false; | ||||
|     bt.adapter.set_powered(btEnableState); | ||||
|     let btEnableState = readFile("./btconf") === "true" ? true : false; | ||||
|     if (bt.adapter) { | ||||
|         bt.adapter.set_powered(btEnableState); | ||||
|     } else { | ||||
|         timeout( 1000, () => { | ||||
|             if (bt.adapter) { | ||||
|                 bt.adapter.set_powered(btEnableState); | ||||
|             } else { | ||||
|                 timeout( 2000, () => { | ||||
|                     if ( bt.adapter ) { | ||||
|                         bt.adapter.set_powered(btEnableState); | ||||
|                     } else { | ||||
|                         timeout( 10000, () => { | ||||
|                             if ( bt.adapter ) { | ||||
|                                 bt.adapter.set_powered(btEnableState); | ||||
|                             } else { | ||||
|                                 exec( `/bin/bash -c "notify-send 'Failed to connect to bluetooth adapter'"` ); | ||||
|                             } | ||||
|                         } ) | ||||
|                     } | ||||
|                 } ) | ||||
|             } | ||||
|         } ); | ||||
|     } | ||||
|  | ||||
|     const updateState = () => { | ||||
|         btEnableState = !btEnableState; | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| project('bar-launcher-tools', version: '1.0') | ||||
| pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name() | ||||
| main = meson.project_name() + '.wrapped' | ||||
| main = meson.project_name() + '.built' | ||||
|  | ||||
| custom_target( | ||||
|   command: [ | ||||
|   | ||||
							
								
								
									
										2789
									
								
								config/astal/runner
									
									
									
									
									
								
							
							
						
						
									
										2789
									
								
								config/astal/runner
									
									
									
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1,2 +0,0 @@ | ||||
| #!/bin/bash | ||||
| LD_PRELOAD="@LAYER_SHELL_LIBDIR@/libgtk4-layer-shell.so" @MAIN_PROGRAM@ $@ | ||||
		Reference in New Issue
	
	Block a user