[AGS] Fix Bluetooth crashes

This commit is contained in:
Janis Hutz 2025-04-26 09:38:15 +02:00
parent 33fcdd72f7
commit e19a1179d5
9 changed files with 54 additions and 35 deletions

View File

@ -10,7 +10,6 @@ const { treeWalker } = require('./util');
// TODO: Split up configs and buildables // TODO: Split up configs and buildables
// TODO: Make user choose if to use borders or not (otherwise border colour = background colour) // TODO: Make user choose if to use borders or not (otherwise border colour = background colour)
// Prompt user to select a wallpaper (if no path is passed as argument) // Prompt user to select a wallpaper (if no path is passed as argument)
const wallpapers = treeWalker( path.join( os.homedir(), '/NextCloud/Wallpapers' ), '*' ); const wallpapers = treeWalker( path.join( os.homedir(), '/NextCloud/Wallpapers' ), '*' );
// const wallpapers = fs.readdirSync( path.join( os.homedir(), '/NextCloud/Wallpapers' ) ); // const wallpapers = fs.readdirSync( path.join( os.homedir(), '/NextCloud/Wallpapers' ) );
@ -57,4 +56,6 @@ inquirer.default.prompt( [
chooseTheme chooseTheme
] ).then( answers => { ] ).then( answers => {
render( answers.wallpaper, answers.lockpaper, answers.theme ); render( answers.wallpaper, answers.lockpaper, answers.theme );
} ).catch( () => {
process.exit( 1 );
} ); } );

View File

@ -114,15 +114,26 @@ const openBTPicker = () => {
}; };
const BluetoothPickerList = () => { const BluetoothPickerList = () => {
let btEnableState = readFile("./btconf") === "true" ? true : false; let btEnableState = false;
try {
btEnableState = readFile("./btconf") === "true" ? true : false;
} catch (_) { }
if (bt.get_adapter()) { if (bt.get_adapter()) {
print( 'Setting BT state to ' + btEnableState ); print('Setting BT state to ' + btEnableState);
bt.adapter.set_powered(btEnableState); bt.adapter.set_powered(btEnableState);
} else { } else {
timeout(5000, () => { timeout(5000, () => {
if (bt.get_adapter()) { if (bt.get_adapter()) {
print( 'Setting BT state to ' + btEnableState ); print('Setting BT state to ' + btEnableState);
bt.adapter.set_powered(btEnableState); bt.adapter.set_powered(btEnableState);
} else {
timeout(5000, () => {
try {
bt.adapter.set_powered(btEnableState);
} catch (_) { }
})
} }
}) })
} }

View File

@ -1,4 +1,4 @@
$fg-color: #E6E6E6; $fg-color: #E6E6E6;
$bg-color: #141414; $bg-color: #141414;
$accent-color: #B27BD1; $accent-color: #040E1D;
$accent-color-2: #5F50A6; $accent-color-2: #0868BA;

View File

@ -4,10 +4,10 @@
# ╰────────────────────────────────────────────────╯ # ╰────────────────────────────────────────────────╯
# ──────────────────────────────────────────────────────────────────── # ────────────────────────────────────────────────────────────────────
exec = swaybg -m fill -i /home/janis/NextCloud/Wallpapers/dark/colour-explosion.jpg exec = swaybg -m fill -i /home/janis/NextCloud/Wallpapers/hyprland/hyprland-pcs.png
general { general {
col.active_border = rgba(b27bd1cc) rgba(5f50a6cc) rgba(050406cc) 45deg col.active_border = rgba(040e1dcc) rgba(0868bacc) rgba(0fb3d9cc) 45deg
col.inactive_border = rgb(000000) col.inactive_border = rgb(000000)
} }

View File

@ -13,8 +13,10 @@ exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = hypridle exec-once = hypridle
exec-once = nm-applet exec-once = nm-applet
exec-once = nextcloud --background exec-once = nextcloud --background
exec-once = sleep 2 && bash -c "ags run -d ~/projects/active/dotfiles/config/astal/ --gtk4 >> ~/log 2>&1" # exec-once = sleep 2 && bash -c "ags run -d ~/projects/active/dotfiles/config/astal/ --gtk4 >> ~/log 2>&1"
exec-once = bash -c "ags run -d ~/projects/active/dotfiles/config/ags/notifications/ >> ~/logn 2>&1" exec-once = sleep 2 && bash -c "ags run -d ~/projects/active/dotfiles/config/astal/ --gtk4"
# exec-once = bash -c "ags run -d ~/projects/active/dotfiles/config/ags/notifications/ >> ~/logn 2>&1"
exec-once = bash -c "ags run -d ~/projects/active/dotfiles/config/ags/notifications/"

View File

@ -18,7 +18,7 @@ general {
# └ ┘ # └ ┘
background { background {
monitor = monitor =
path = /home/janis/NextCloud/Wallpapers/dark/mountains.jpg # Or screenshot path = /home/janis/NextCloud/Wallpapers/dark/colour-splash.jpg # Or screenshot
blur_passes = 1 blur_passes = 1
} }
@ -33,7 +33,7 @@ input-field {
dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8 dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = false dots_center = false
outer_color = rgb(178, 123, 209) outer_color = rgb(4, 14, 29)
inner_color = rgb(200, 200, 200) inner_color = rgb(200, 200, 200)
font_color = rgb(10, 10, 10) font_color = rgb(10, 10, 10)
fade_on_empty = true fade_on_empty = true

View File

@ -25,7 +25,7 @@ button:hover {
} }
button:focus { button:focus {
background-color: rgb(178, 123, 209); background-color: rgb(4, 14, 29);
color: rgb(230, 230, 230); color: rgb(230, 230, 230);
} }

View File

@ -40,40 +40,40 @@
/* /*
* Accent colour * Accent colour
*/ */
@define-color accent #B27BD1; @define-color accent #040E1D;
@define-color accent_rgba_05 rgba(178, 123, 209, 0.5); @define-color accent_rgba_05 rgba(4, 14, 29, 0.5);
@define-color accent_rgba_03 rgba(178, 123, 209, 0.3); @define-color accent_rgba_03 rgba(4, 14, 29, 0.3);
@define-color accent_rgba_02 rgba(178, 123, 209, 0.2); @define-color accent_rgba_02 rgba(4, 14, 29, 0.2);
@define-color accent_rgba_015 rgba(178, 123, 209, 0.15); @define-color accent_rgba_015 rgba(4, 14, 29, 0.15);
@define-color accent_rgba_011 rgba(178, 123, 209, 0.11); @define-color accent_rgba_011 rgba(4, 14, 29, 0.11);
@define-color accent_rgba_007 rgba(178, 123, 209, 0.07); @define-color accent_rgba_007 rgba(4, 14, 29, 0.07);
/* /*
* Accent Gradient * Accent Gradient
*/ */
@define-color accent_gradient_1 #724F86; @define-color accent_gradient_1 #030913;
@define-color accent_gradient_2 #5B3F6B; @define-color accent_gradient_2 #02070F;
@define-color accent_gradient_3 #493256; @define-color accent_gradient_3 #02060C;
@define-color accent_gradient_4 #3A2844; @define-color accent_gradient_4 #01050A;
@define-color accent_gradient_5 #2F2037; @define-color accent_gradient_5 #010408;
@define-color accent_gradient_inverse_1 #FFC0FF; @define-color accent_gradient_inverse_1 #06162D;
@define-color accent_gradient_inverse_2 #FFC0FF; @define-color accent_gradient_inverse_2 #06162D;
@define-color accent_gradient_inverse_3 #FFC0FF; @define-color accent_gradient_inverse_3 #06162D;
/* /*
* Secondary accent colour * Secondary accent colour
*/ */
@define-color accent2 #5F50A6; @define-color accent2 #0868BA;
@define-color accent2_rgba_05 rgba(95, 80, 166, 0.5); @define-color accent2_rgba_05 rgba(8, 104, 186, 0.5);
@define-color accent2_rgba_03 rgba(95, 80, 166, 0.3); @define-color accent2_rgba_03 rgba(8, 104, 186, 0.3);
@define-color accent2_rgba_02 rgba(95, 80, 166, 0.2); @define-color accent2_rgba_02 rgba(8, 104, 186, 0.2);
@define-color accent2_rgba_015 rgba(95, 80, 166, 0.15); @define-color accent2_rgba_015 rgba(8, 104, 186, 0.15);
@define-color accent2_rgba_01 rgba(95, 80, 166, 0.1); @define-color accent2_rgba_01 rgba(8, 104, 186, 0.1);
/* /*
* Tertiary accent colour * Tertiary accent colour
*/ */
@define-color accent3 #050406; @define-color accent3 #0FB3D9;
/* /*
* Inactive Colour * Inactive Colour

5
setup
View File

@ -23,6 +23,7 @@ echo "
" "
trap 'echo -e "\nCaught Ctrl+C, exiting..."; exit 1' SIGINT
# Read platform to install on (only if no platform file present in ~/.config/) # Read platform to install on (only if no platform file present in ~/.config/)
platform="" platform=""
@ -41,6 +42,10 @@ read -p "Would you like to regenerate styling? (y/N) " regen
if [ $regen == "y" ]; then if [ $regen == "y" ]; then
cd build cd build
node build.js node build.js
if [ $? -ne 0 ]; then
echo -e "\nCaught Ctrl+C, exiting...."
exit 130
fi
cd .. cd ..
fi fi