summaryrefslogtreecommitdiff
path: root/common/modules/mango
diff options
context:
space:
mode:
Diffstat (limited to 'common/modules/mango')
-rw-r--r--common/modules/mango/default.nix3
-rw-r--r--common/modules/mango/scripts.nix121
2 files changed, 71 insertions, 53 deletions
diff --git a/common/modules/mango/default.nix b/common/modules/mango/default.nix
index be210ed..95066e3 100644
--- a/common/modules/mango/default.nix
+++ b/common/modules/mango/default.nix
@@ -302,7 +302,8 @@ in
bind=ALT,x,switch_proportion_preset,
# switch layout
- bind=SUPER,n,switch_layout
+ # bind=SUPER,n,switch_layout
+ bind=SUPER,n,spawn,beesettings layout
# tag switch
bind=SUPER,1,view,1,0
diff --git a/common/modules/mango/scripts.nix b/common/modules/mango/scripts.nix
index 28a388e..fd12ddd 100644
--- a/common/modules/mango/scripts.nix
+++ b/common/modules/mango/scripts.nix
@@ -71,7 +71,7 @@ let
init_settings() {
if [ ! -f "$CONFIG_FILE" ]; then
mkdir -p "$(dirname "$CONFIG_FILE")"
- echo -e "theme=dark\nnightlight=off\nwallpaper=$WALL_DIR/default.jpg" > "$CONFIG_FILE"
+ echo -e "theme=dark\nnightlight=off\nwallpaper=$WALL_DIR/default.jpg\ncolor_type=scheme-tonal-spot" > "$CONFIG_FILE"
fi
}
@@ -82,16 +82,17 @@ let
apply_all() {
local theme=$(get_val "theme")
local wall=$(get_val "wallpaper")
+ local color_type=$(get_val "color_type")
local mode_flag="dark"
[ "$theme" == "light" ] && mode_flag="light"
- matugen image "$wall" -m "$mode_flag" -t scheme-content --source-color-index 0 2>/dev/null
+ matugen image "$wall" -m "$mode_flag" -t "$color_type" --source-color-index 0 2>/dev/null
wallust -q -s run "$wall" 2>/dev/null
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$mode_flag'"
if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$DISPLAY" ]; then
- xrdb -merge "$HOME/.Xresources"
+ xrdb -merge "$HOME/.Xresources"
fi
[ -f "$HOME/.config/sequences" ] && sh "$HOME/.config/sequences"
}
@@ -113,7 +114,7 @@ let
if [ -n "$SELECTED" ]; then
FULL_PATH="$WALL_DIR/$SELECTED"
set_val "wallpaper" "$FULL_PATH"
-
+
if [ -n "$WAYLAND_DISPLAY" ]; then
if command -v swww >/dev/null 2>&1; then
swww img "$FULL_PATH" --transition-type grow --transition-fps 120 --transition-step 60 --transition-duration 1.5
@@ -128,68 +129,83 @@ let
fi
}
+ clr_type() {
+ local types=(
+ "scheme-tonal-spot"
+ "scheme-content"
+ "scheme-expressive"
+ "scheme-fidelity"
+ "scheme-fruit-salad"
+ "scheme-monochrome"
+ "scheme-neutral"
+ "scheme-rainbow"
+ "scheme-vibrant"
+ )
+
+ local selection
+ selection=$(printf "%s\n" "''${types[@]}" | rofi -dmenu -i -p "Coloscheme Types")
+
+ if [[ -n "$selection" ]]; then
+ set_val "color_type" "$selection"
+ apply_all
+ fi
+ }
+
+ cmd_layout() {
+ declare -A layouts=(
+ ["tile"]="T"
+ ["monocle"]="M"
+ ["scroller"]="S"
+ ["tgmix"]="TG"
+ ["grid"]="G"
+ ["deck"]="K"
+ ["center tile"]="CT"
+ ["right tile"]="RT"
+ ["vertical scroller"]="VS"
+ ["vertical tile"]="VT"
+ ["vertical grid"]="VG"
+ ["vertical deck"]="VK"
+ )
+
+ local selection
+ selection=$(printf "%s\n" "''${!layouts[@]}" | sort | rofi -dmenu -i -p "Layout")
+
+ if [[ -n "''${layouts[$selection]}" ]]; then
+ set_layout "''${layouts[$selection]}"
+ fi
+ }
+
cmd_settings() {
local theme=$(get_val "theme")
local nl=$(get_val "nightlight")
+ local ct=$(get_val "color_type")
- CHOICE=$(echo -e "Mode: $theme\nNight Light: $nl\nWallpaper\nLayouts" | rofi -dmenu -p "Settings" -i)
+ local options=(
+ "Mode: $theme"
+ "Night Light: $nl"
+ "Wallpaper"
+ "Colorscheme Type: $ct"
+ "Layouts"
+ )
- case "$CHOICE" in
+ local choice
+ choice=$(printf "%s\n" "''${options[@]}" | rofi -dmenu -p "Settings" -i)
+
+ case "$choice" in
"Mode: "*)
- [ "$theme" == "dark" ] && set_val "theme" "light" || set_val "theme" "dark"
+ [[ "$theme" == "dark" ]] && set_val "theme" "light" || set_val "theme" "dark"
apply_all
;;
"Night Light: "*)
- if [ "$nl" == "on" ]; then
+ if [[ "$nl" == "on" ]]; then
set_val "nightlight" "off"; pkill wlsunset
else
set_val "nightlight" "on"; wlsunset -T 4500 &
fi
;;
- "Wallpaper")
- cmd_wall
- ;;
- "Layouts")
- L=$(echo -e "tile\nmonocle\nscroller\ntgmix\ngrid\ndeck\ncenter tile\nright tile\nvertical scroller\nvertical tile\nvertical grid\nvertical deck" | rofi -dmenu -p "Layout")
- case "$L" in
- "tile")
- set_layout "T"
- ;;
- "monocle")
- set_layout "M"
- ;;
- "scroller")
- set_layout "S"
- ;;
- "tgmix")
- set_layout "TG"
- ;;
- "grid")
- set_layout "G"
- ;;
- "deck")
- set_layout "K"
- ;;
- "center tile")
- set_layout "CT"
- ;;
- "right tile")
- set_layout "RT"
- ;;
- "vertical grid")
- set_layout "VG"
- ;;
- "vertical tile")
- set_layout "VT"
- ;;
- "vertical deck")
- set_layout "VK"
- ;;
- "vertical scroller")
- set_layout "VS"
- ;;
- esac
- ;;
+ "Wallpaper") cmd_wall ;;
+ "Colorscheme Type:"*) clr_type ;;
+ "Layouts") cmd_layout ;;
esac
}
@@ -198,6 +214,7 @@ let
case "$1" in
wall) cmd_wall ;;
settings) cmd_settings ;;
+ layout) cmd_layout ;;
apply) apply_all ;;
*) echo "Usage: bee {wall|settings|apply}" ;;
esac