@ -31,6 +31,7 @@
# include "stringop.h"
# include "stringop.h"
# include "list.h"
# include "list.h"
# include "log.h"
# include "log.h"
# include "util.h"
struct sway_config * config = NULL ;
struct sway_config * config = NULL ;
@ -192,13 +193,6 @@ static void destroy_removed_seats(struct sway_config *old_config,
}
}
}
}
static void set_color ( float dest [ static 4 ] , uint32_t color ) {
dest [ 0 ] = ( ( color > > 16 ) & 0xff ) / 255.0 ;
dest [ 1 ] = ( ( color > > 8 ) & 0xff ) / 255.0 ;
dest [ 2 ] = ( color & 0xff ) / 255.0 ;
dest [ 3 ] = 1.0 ;
}
static void config_defaults ( struct sway_config * config ) {
static void config_defaults ( struct sway_config * config ) {
if ( ! ( config - > swaynag_command = strdup ( " swaynag " ) ) ) goto cleanup ;
if ( ! ( config - > swaynag_command = strdup ( " swaynag " ) ) ) goto cleanup ;
config - > swaynag_config_errors = ( struct swaynag_instance ) { 0 } ;
config - > swaynag_config_errors = ( struct swaynag_instance ) { 0 } ;
@ -300,37 +294,37 @@ static void config_defaults(struct sway_config *config) {
config - > hide_lone_tab = false ;
config - > hide_lone_tab = false ;
// border colors
// border colors
set_ color( config - > border_colors . focused . border , 0x4C7899 ) ;
color_to_rgba ( config - > border_colors . focused . border , 0x4C7899 FF ) ;
set_ color( config - > border_colors . focused . background , 0x285577 ) ;
color_to_rgba ( config - > border_colors . focused . background , 0x285577 FF ) ;
set_ color( config - > border_colors . focused . text , 0xFFFFFFFF ) ;
color_to_rgba ( config - > border_colors . focused . text , 0xFFFFFFFF ) ;
set_ color( config - > border_colors . focused . indicator , 0x2E9EF4 ) ;
color_to_rgba ( config - > border_colors . focused . indicator , 0x2E9EF4 FF ) ;
set_ color( config - > border_colors . focused . child_border , 0x285577 ) ;
color_to_rgba ( config - > border_colors . focused . child_border , 0x285577 FF ) ;
set_ color( config - > border_colors . focused_inactive . border , 0x333333 ) ;
color_to_rgba ( config - > border_colors . focused_inactive . border , 0x333333 FF ) ;
set_ color( config - > border_colors . focused_inactive . background , 0x5F676A ) ;
color_to_rgba ( config - > border_colors . focused_inactive . background , 0x5F676A FF ) ;
set_ color( config - > border_colors . focused_inactive . text , 0xFFFFFFFF ) ;
color_to_rgba ( config - > border_colors . focused_inactive . text , 0xFFFFFFFF ) ;
set_ color( config - > border_colors . focused_inactive . indicator , 0x484E50 ) ;
color_to_rgba ( config - > border_colors . focused_inactive . indicator , 0x484E50 FF ) ;
set_ color( config - > border_colors . focused_inactive . child_border , 0x5F676A ) ;
color_to_rgba ( config - > border_colors . focused_inactive . child_border , 0x5F676A FF ) ;
set_ color( config - > border_colors . unfocused . border , 0x333333 ) ;
color_to_rgba ( config - > border_colors . unfocused . border , 0x333333 FF ) ;
set_ color( config - > border_colors . unfocused . background , 0x222222 ) ;
color_to_rgba ( config - > border_colors . unfocused . background , 0x222222 FF ) ;
set_ color( config - > border_colors . unfocused . text , 0x88888888 ) ;
color_to_rgba ( config - > border_colors . unfocused . text , 0x88888888 ) ;
set_ color( config - > border_colors . unfocused . indicator , 0x292D2E ) ;
color_to_rgba ( config - > border_colors . unfocused . indicator , 0x292D2E FF ) ;
set_ color( config - > border_colors . unfocused . child_border , 0x222222 ) ;
color_to_rgba ( config - > border_colors . unfocused . child_border , 0x222222 FF ) ;
set_ color( config - > border_colors . urgent . border , 0x2F343A ) ;
color_to_rgba ( config - > border_colors . urgent . border , 0x2F343A FF ) ;
set_ color( config - > border_colors . urgent . background , 0x900000 ) ;
color_to_rgba ( config - > border_colors . urgent . background , 0x900000 FF ) ;
set_ color( config - > border_colors . urgent . text , 0xFFFFFFFF ) ;
color_to_rgba ( config - > border_colors . urgent . text , 0xFFFFFFFF ) ;
set_ color( config - > border_colors . urgent . indicator , 0x900000 ) ;
color_to_rgba ( config - > border_colors . urgent . indicator , 0x900000 FF ) ;
set_ color( config - > border_colors . urgent . child_border , 0x900000 ) ;
color_to_rgba ( config - > border_colors . urgent . child_border , 0x900000 FF ) ;
set_ color( config - > border_colors . placeholder . border , 0x000000 ) ;
color_to_rgba ( config - > border_colors . placeholder . border , 0x000000 FF ) ;
set_ color( config - > border_colors . placeholder . background , 0x0C0C0C ) ;
color_to_rgba ( config - > border_colors . placeholder . background , 0x0C0C0C FF ) ;
set_ color( config - > border_colors . placeholder . text , 0xFFFFFFFF ) ;
color_to_rgba ( config - > border_colors . placeholder . text , 0xFFFFFFFF ) ;
set_ color( config - > border_colors . placeholder . indicator , 0x000000 ) ;
color_to_rgba ( config - > border_colors . placeholder . indicator , 0x000000 FF ) ;
set_ color( config - > border_colors . placeholder . child_border , 0x0C0C0C ) ;
color_to_rgba ( config - > border_colors . placeholder . child_border , 0x0C0C0C FF ) ;
set_ color( config - > border_colors . background , 0x FFFFFF) ;
color_to_rgba ( config - > border_colors . background , 0x FF FFFFFF) ;
// Security
// Security
if ( ! ( config - > command_policies = create_list ( ) ) ) goto cleanup ;
if ( ! ( config - > command_policies = create_list ( ) ) ) goto cleanup ;