diff options
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/ya/yambar/config/config.yml | 42 | ||||
-rw-r--r-- | modules/by-name/ya/yambar/module.nix | 65 | ||||
-rwxr-xr-x | modules/by-name/ya/yambar/scripts/disk.sh (renamed from modules/home.legacy/conf/yambar/scripts/disk.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/ya/yambar/scripts/mpd_song_name.sh (renamed from modules/home.legacy/conf/yambar/scripts/mpd_song_name.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/ya/yambar/scripts/network.sh (renamed from modules/home.legacy/conf/yambar/scripts/network.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/ya/yambar/scripts/sound-volume.sh (renamed from modules/home.legacy/conf/yambar/scripts/sound-volume.sh) | 0 | ||||
-rw-r--r-- | modules/by-name/ya/yambar/settings/default.nix | 370 | ||||
-rw-r--r-- | modules/home.legacy/conf/default.nix | 1 | ||||
-rw-r--r-- | modules/home.legacy/conf/yambar/config/config.yml | 243 | ||||
-rw-r--r-- | modules/home.legacy/conf/yambar/config/laptop.yml | 243 | ||||
-rw-r--r-- | modules/home.legacy/conf/yambar/default.nix | 50 |
11 files changed, 477 insertions, 537 deletions
diff --git a/modules/by-name/ya/yambar/config/config.yml b/modules/by-name/ya/yambar/config/config.yml new file mode 100644 index 00000000..442135aa --- /dev/null +++ b/modules/by-name/ya/yambar/config/config.yml @@ -0,0 +1,42 @@ +--- +# Config file for yambar +# Note that this may be version-dependent, this file is written for v1.8.0 + +bar: + right: + # - network: + # name: wlp5s0 + # poll-interval: 10 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: {empty: {}} + # carrier: + # string: {text: " {ssid} ", deco: *combutil} + # - network: + # name: enp4s0 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: + # string: {text: " Eth failed ", deco: *combutil} + # carrier: {empty: {}} + # - script: # Grade average + # path: grade_average_script + # content: + # string: + # text: " {grade} " + # deco: *combmem + # - script: # tray + # path: /home/dt/.config/yambar/scripts/yambar-tray + # content: + # empty: {} + # - script: + # path: /home/dt/.config/yambar/scripts/yambar-tray-width + # poll-interval: 10 + # content: + # string: + # text: "{padding}" + # deco: *combmem diff --git a/modules/by-name/ya/yambar/module.nix b/modules/by-name/ya/yambar/module.nix new file mode 100644 index 00000000..2f6ea22f --- /dev/null +++ b/modules/by-name/ya/yambar/module.nix @@ -0,0 +1,65 @@ +{ + config, + sysLib, + pkgs, + lib, + ... +}: let + cfg = config.soispha.programs.yambar; + + makeScript = { + name, + dependencies, + ... + }: + sysLib.writeShellScript { + inherit name; + src = ./scripts/${name}.sh; + dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); + } + + "/bin/${name}"; +in { + options.soispha.programs.yambar = { + enable = lib.mkEnableOption "yambar"; + + laptop = lib.mkEnableOption "laptop specific settings"; + backlight = lib.mkOption { + type = lib.types.str; + example = "intel_backlight"; + description = "Which backlight to query for the screen brightness"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + programs.yambar = { + enable = true; + settings = import ./settings { + inherit lib; + inherit (cfg) laptop; + laptopBacklightName = cfg.backlight; + scripts = { + mpd_song_name_script = makeScript { + dependencies = [pkgs.mpc]; + name = "mpd_song_name"; + }; + + volume_script = makeScript { + dependencies = with pkgs; [pulseaudio gawk coreutils]; + name = "sound-volume"; + }; + + cpu_script = "${lib.getExe pkgs.yambar-modules} cpu"; + + memory_script = "${lib.getExe pkgs.yambar-modules} memory"; + + disk_script = makeScript { + dependencies = with pkgs; [gawk btrfs-progs coreutils]; + name = "disk"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/yambar/scripts/disk.sh b/modules/by-name/ya/yambar/scripts/disk.sh index a5547a74..a5547a74 100755 --- a/modules/home.legacy/conf/yambar/scripts/disk.sh +++ b/modules/by-name/ya/yambar/scripts/disk.sh diff --git a/modules/home.legacy/conf/yambar/scripts/mpd_song_name.sh b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh index 7d294781..7d294781 100755 --- a/modules/home.legacy/conf/yambar/scripts/mpd_song_name.sh +++ b/modules/by-name/ya/yambar/scripts/mpd_song_name.sh diff --git a/modules/home.legacy/conf/yambar/scripts/network.sh b/modules/by-name/ya/yambar/scripts/network.sh index adfc93df..adfc93df 100755 --- a/modules/home.legacy/conf/yambar/scripts/network.sh +++ b/modules/by-name/ya/yambar/scripts/network.sh diff --git a/modules/home.legacy/conf/yambar/scripts/sound-volume.sh b/modules/by-name/ya/yambar/scripts/sound-volume.sh index 8a98daf7..8a98daf7 100755 --- a/modules/home.legacy/conf/yambar/scripts/sound-volume.sh +++ b/modules/by-name/ya/yambar/scripts/sound-volume.sh diff --git a/modules/by-name/ya/yambar/settings/default.nix b/modules/by-name/ya/yambar/settings/default.nix new file mode 100644 index 00000000..041ac88e --- /dev/null +++ b/modules/by-name/ya/yambar/settings/default.nix @@ -0,0 +1,370 @@ +# TODO: This should not do something depending on whether the host is a laptop or not. It +# should instead match on monitor-width or scale factor. <2024-11-29> +{ + lib, + laptop ? false, + laptopBacklightName ? null, + scripts, +}: let + mkUnderline = color: { + underline = { + inherit color; + size = "3"; + }; + }; + + shellExec = cmd: ''sh -c "${cmd}"''; + + values = { + foreground = { + blue = "99d1dbff"; + focus = "e78284ff"; + green = "a6e3a1dd"; + lavendar = "b4befedd"; + mauve = "cba6f7dd"; + none = "0"; + normal = "c6ceefff"; + peach = "fab387dd"; + sapphire = "74c7ecdd"; + teal = "94e2d5dd"; + }; + font = { + main = "Source Code Pro:pixelsize=${ + if laptop + then "22" + else "26" + }"; + aws = "Font Awesome 5 Free:style=solid:pixelsize=${ + if laptop + then "20" + else "23" + }"; + }; + background = { + normal = "303446ff"; + tag = "585b70ff"; + tag2 = "45475aff"; + urgent = "e78284ff"; + }; + backgroundBlock = { + normal = {background = {color = values.background.normal;};}; + urgent = {background = {color = values.background.urgent;};}; + }; + underline = { + battery = mkUnderline values.foreground.sapphire; + clock = mkUnderline values.foreground.teal; + focused = mkUnderline values.foreground.focus; + resources = mkUnderline values.foreground.green; + title = mkUnderline values.background.tag; + urgent = mkUnderline values.foreground.blue; + utils = mkUnderline values.foreground.peach; + weather = mkUnderline values.foreground.lavendar; + }; + combination = { + battery.stack = [ + values.backgroundBlock.normal + values.underline.battery + ]; + clock.stack = [ + values.backgroundBlock.normal + values.underline.clock + ]; + resources.stack = [ + values.backgroundBlock.normal + values.underline.resources + ]; + utils.stack = [ + values.backgroundBlock.normal + values.underline.utils + ]; + weather.stack = [ + values.backgroundBlock.normal + values.underline.weather + ]; + }; + }; +in { + bar = { + background = values.foreground.none; + foreground = values.foreground.normal; + + font = values.font.main; + height = + if laptop + then "25" + else "45"; + margin = + if laptop + then "5" + else "10"; + location = "top"; + layer = "bottom"; + spacing = "0"; + + border = { + margin = "0"; + top-margin = "10"; + }; + + left = [ + { + river = let + tag_base_setting = { + map = let + normal = { + string = { + margin = "10"; + text = "{id}"; + }; + }; + in { + default = normal; + conditions = { + "state == focused" = { + string = { + deco = { + stack = [ + {background = {color = values.background.tag;};} + values.underline.focused + ]; + }; + margin = "10"; + text = "{id}"; + }; + }; + "state == invisible" = { + map = { + conditions = { + occupied = { + string = { + deco = {background = {color = values.background.tag2;};}; + margin = "10"; + text = "{id}"; + }; + }; + "~occupied" = normal; + }; + }; + }; + "state == unfocused" = { + string = { + deco = {background = {color = values.background.tag2;};}; + margin = "10"; + text = "{id}"; + }; + }; + "state == urgent" = { + string = { + deco = { + stack = [ + {background = {color = values.background.urgent;};} + values.underline.urgent + ]; + }; + margin = "10"; + text = "{id}"; + }; + }; + }; + }; + }; + in { + content = { + map = { + conditions = { + "id == 1" = tag_base_setting; + "id == 2" = tag_base_setting; + "id == 3" = tag_base_setting; + "id == 4" = tag_base_setting; + "id == 5" = tag_base_setting; + "id == 6" = tag_base_setting; + "id == 7" = tag_base_setting; + "id == 8" = tag_base_setting; + "id == 9" = tag_base_setting; + }; + on-click = { + left = shellExec "riverctl set-focused-tags $((1 << ({id} - 1)))"; + middle = shellExec "riverctl toggle-view-tags $((1 << ({id} -1)))"; + right = shellExec "riverctl toggle-focused-tags $((1 << ({id} -1)))"; + }; + }; + }; + title = { + map = { + conditions = {"title == \"\"" = {string = {text = "";};};}; + default = { + string = { + max = "35"; + deco = values.underline.title; + left-margin = "12"; + right-margin = "12"; + text = "{title}"; + }; + }; + }; + }; + }; + } + ]; + + center = [ + { + clock = { + date-format = "%d/%m/%y (%a)"; + time-format = "%H:%M:%S %Z"; + foreground = values.foreground.blue; + content = { + string = { + deco = values.combination.clock; + text = " {date} {time} "; + }; + }; + }; + } + ]; + + right = + [ + { + script = { + path = scripts.mpd_song_name_script; + content.map.conditions = { + playing = { + string = { + deco = values.combination.weather; + text = "{song} "; + }; + }; + "~playing" = { + string = { + deco = values.combination.weather; + text = ""; + }; + }; + }; + }; + } + { + script = { + path = scripts.volume_script; + content.map = { + on-click = shellExec "pavucontrol"; + conditions = { + muted = { + string = { + deco = values.backgroundBlock.urgent; + text = " "; + }; + }; + "~muted" = { + string = { + deco = values.combination.utils; + text = " {volume}% "; + }; + }; + }; + }; + }; + } + { + script = { + path = scripts.cpu_script; + content.string = { + deco = values.combination.resources; + text = " {cpu}% "; + }; + }; + } + { + script = { + path = scripts.memory_script; + content.map.conditions = { + swapstate = { + string = { + deco = values.combination.resources; + text = " {memperc}%({swapperc}%) "; + }; + }; + "~swapstate" = { + string = { + deco = values.combination.resources; + text = " {memperc}% "; + }; + }; + }; + }; + } + { + script = { + path = scripts.disk_script; + content.string = { + deco = values.combination.resources; + text = " {diskspace}({diskperc})"; + }; + }; + } + ] + ++ lib.optionals laptop [ + { + backlight = { + name = laptopBacklightName; + content.string = { + text = " {percent}% "; + deco = values.combination.utils; + }; + }; + } + { + battery = { + name = "BAT0"; + poll-interval = "300"; + content.list.items = [ + { + ramp = { + tag = "capacity"; + items = let + stack = [ + values.backgroundBlock.normal + values.underline.battery + ]; + in [ + { + string = { + text = " {capacity}%({estimate}) "; + deco = + values.backgroundBlock.urgent; + }; + } + { + string = { + text = " {capacity}%({estimate}) "; + deco.stack = stack; + }; + } + { + string = { + text = " {capacity}%({estimate}) "; + deco.stack = stack; + }; + } + { + string = { + text = " {capacity}%({estimate}) "; + deco.stack = stack; + }; + } + { + string = { + text = " {capacity}%({estimate}) "; + deco.stack = stack; + }; + } + ]; + }; + } + ]; + }; + } + ]; + }; +} diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index 9d6d00ed..ac343349 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -34,7 +34,6 @@ ./timewarrior ./tridactyl ./xdg - ./yambar ./yt ./ytcc ]; diff --git a/modules/home.legacy/conf/yambar/config/config.yml b/modules/home.legacy/conf/yambar/config/config.yml deleted file mode 100644 index 3d9f0687..00000000 --- a/modules/home.legacy/conf/yambar/config/config.yml +++ /dev/null @@ -1,243 +0,0 @@ ---- -# Config file for yambar -# Note that this may be version-dependent, this file is written for v1.8.0 - - -# Font anchors -font-main: &fontmain Source Code Pro:pixelsize=26 -font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=23 - -# Color anchors -fg-none: &fgnone 00000000 -fg-1: &fg1 c6ceefff -fg-blue: &fgblue 99d1dbff -fg-sapphire: &fgsapp 74c7ecdd -fg-green: &fggreen a6e3a1dd -fg-peach: &fgpeach fab387dd -fg-mauve: &fgmauve cba6f7dd -fg-teal: &fgteal 94e2d5dd -fg-lavendar: &fglav b4befedd -fg-focus: &fgfocus e78284ff -bg-1: &bg1 303446ff -bg-tag: &bgtag 585b70ff -bg-tag2: &bgtag2 45475aff -bg-urgent: &bgurgent e78284ff - -# Background blocks -background-block: &bgcblock {background: {color: *bg1 }} -background-block-urgent: &bgcurg {background: {color: *bgurgent }} - -# Underlines -underline-focused: &line {underline: { size: 3, color: *fgfocus}} -underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} -underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} -underline-resources: &linemem {underline: { size: 3, color: *fggreen}} -underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} -underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} -underline-weather: &linewea {underline: { size: 3, color: *fglav}} -underline-title: &linetitle {underline: { size: 3, color: *bgtag}} - -# Combined decorations -combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} -combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} -combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} -combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} -combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} - - -### Main - -bar: - location: top - height: 45 - layer: bottom - spacing: 0 - margin: 10 - border: {margin: 0, top-margin: 10} - foreground: *fg1 - background: *fgnone - font: *fontmain - - ### Left, river tags - left: - - river: - anchors: - - id: &name { text: "{id}" } - - string: &focus { stack: [ {background: {color: *bg1}} ] } - - string: &normal { string: { <<: *name, margin: 10 } } - - string: - &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } - - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } - - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - base: &river_base - default: *normal - conditions: - state == focused: *focused - state == unfocused: *unfocused - state == urgent: *urgent - state == invisible: - map: - conditions: - occupied: *occupied - ~occupied: *normal - content: - map: - on-click: - left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" - right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" - middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" - conditions: - id == 1: { map: { <<: *river_base } } - id == 2: { map: { <<: *river_base } } - id == 3: { map: { <<: *river_base } } - id == 4: { map: { <<: *river_base } } - id == 5: { map: { <<: *river_base } } - id == 6: { map: { <<: *river_base } } - id == 7: { map: { <<: *river_base } } - id == 8: { map: { <<: *river_base } } - id == 9: { map: { <<: *river_base } } - title: - map: - default: - { - string: - { - text: "{title}", - left-margin: 12, - right-margin: 12, - # max: 35, - deco: *linetitle - }, - } - conditions: - title == "": { string: { text: "" } } - - ### Center, clock & weather gadget - center: - - clock: - time-format: "%H:%M:%S %Z" - date-format: "%d/%m/%y (%a)" - foreground: *fgblue - content: - string: - text: " {date} {time} " - deco: *combclock - - ### Right, system tray - right: - #- network: - # name: wlp5s0 - # poll-interval: 10 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: {empty: {}} - # carrier: - # string: {text: " {ssid} ", deco: *combutil} - #- network: - # name: enp4s0 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: - # string: {text: " Eth failed ", deco: *combutil} - # carrier: {empty: {}} - - - script: # mpd song name - path: @mpd_song_name_script@ - content: - map: - conditions: - playing: - string: {text: "{song} ", deco: *combwea} - ~playing: - string: {text: "", deco: *combwea} - - script: # Sound volume - path: @volume_script@ - content: - map: - on-click: /bin/sh -c "pavucontrol" - conditions: - muted: - string: - text: " " - deco: *bgcurg - ~muted: - string: {text: " {volume}% ", deco: *combutil} - - # - script: # Grade average - # path: @grade_average_script@ - # content: - # string: - # text: " {grade} " - # deco: *combmem - - #- backlight: - # name: intel_backlight - # content: - # - string: {text: " {percent}% ", deco: *combutil} - - - script: # CPU - path: @cpu_script@ - content: - string: - text: " {cpu}% " - deco: *combmem - - - script: # Memory info - path: @memory_script@ - content: - map: - conditions: - swapstate: - string: - text: " {memperc}%({swapperc}%) " - deco: *combmem - ~swapstate: - string: - text: " {memperc}% " - deco: *combmem - - script: # Disk space - path: @disk_script@ - content: - string: - text: " {diskspace}({diskperc})" - deco: *combmem - #- battery: - # name: BAT0 - # poll-interval: 30 - # content: - # list: - # items: - # - ramp: - # tag: capacity - # items: - # - string: - # text: " {capacity}%({estimate}) " - # deco: *bgcurg - # - string: - # text: " {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - # - string: - # text: " {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - # - string: - # text: " {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - # - string: - # text: " {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - #- script: # tray - # path: /home/dt/.config/yambar/scripts/yambar-tray - # content: - # empty: {} - #- script: - # path: /home/dt/.config/yambar/scripts/yambar-tray-width - # poll-interval: 10 - # content: - # string: - # text: "{padding}" - # deco: *combmem diff --git a/modules/home.legacy/conf/yambar/config/laptop.yml b/modules/home.legacy/conf/yambar/config/laptop.yml deleted file mode 100644 index 8de2f508..00000000 --- a/modules/home.legacy/conf/yambar/config/laptop.yml +++ /dev/null @@ -1,243 +0,0 @@ ---- -# Config file for yambar -# Note that this may be version-dependent, this file is written for v1.8.0 - - -# Font anchors -font-main: &fontmain Source Code Pro:pixelsize=22 -font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=20 - -# Color anchors -fg-none: &fgnone 00000000 -fg-1: &fg1 c6ceefff -fg-blue: &fgblue 99d1dbff -fg-sapphire: &fgsapp 74c7ecdd -fg-green: &fggreen a6e3a1dd -fg-peach: &fgpeach fab387dd -fg-mauve: &fgmauve cba6f7dd -fg-teal: &fgteal 94e2d5dd -fg-lavendar: &fglav b4befedd -fg-focus: &fgfocus e78284ff -bg-1: &bg1 303446ff -bg-tag: &bgtag 585b70ff -bg-tag2: &bgtag2 45475aff -bg-urgent: &bgurgent e78284ff - -# Background blocks -background-block: &bgcblock {background: {color: *bg1 }} -background-block-urgent: &bgcurg {background: {color: *bgurgent }} - -# Underlines -underline-focused: &line {underline: { size: 3, color: *fgfocus}} -underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} -underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} -underline-resources: &linemem {underline: { size: 3, color: *fggreen}} -underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} -underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} -underline-weather: &linewea {underline: { size: 3, color: *fglav}} -underline-title: &linetitle {underline: { size: 3, color: *bgtag}} - -# Combined decorations -combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} -combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} -combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} -combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} -combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} - - -### Main - -bar: - location: top - height: 25 - layer: bottom - spacing: 0 - margin: 10 - border: {margin: 0, top-margin: 5} - foreground: *fg1 - background: *fgnone - font: *fontmain - - ### Left, river tags - left: - - river: - anchors: - - id: &name { text: "{id}" } - - string: &focus { stack: [ {background: {color: *bg1}} ] } - - string: &normal { string: { <<: *name, margin: 10 } } - - string: - &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } - - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } - - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - base: &river_base - default: *normal - conditions: - state == focused: *focused - state == unfocused: *unfocused - state == urgent: *urgent - state == invisible: - map: - conditions: - occupied: *occupied - ~occupied: *normal - content: - map: - on-click: - left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" - right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" - middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" - conditions: - id == 1: { map: { <<: *river_base } } - id == 2: { map: { <<: *river_base } } - id == 3: { map: { <<: *river_base } } - id == 4: { map: { <<: *river_base } } - id == 5: { map: { <<: *river_base } } - id == 6: { map: { <<: *river_base } } - id == 7: { map: { <<: *river_base } } - id == 8: { map: { <<: *river_base } } - id == 9: { map: { <<: *river_base } } - title: - map: - default: - { - string: - { - text: "{title}", - left-margin: 12, - right-margin: 12, - # max: 35, - deco: *linetitle - }, - } - conditions: - title == "": { string: { text: "" } } - - ### Center, clock & weather gadget - center: - - clock: - time-format: "%H:%M:%S %Z" - date-format: "%d/%m/%y (%a)" - foreground: *fgblue - content: - string: - text: " {date} {time} " - deco: *combclock - - ### Right, system tray - right: - #- network: - # name: wlp5s0 - # poll-interval: 10 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: {empty: {}} - # carrier: - # string: {text: " {ssid} ", deco: *combutil} - #- network: - # name: enp4s0 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: - # string: {text: " Eth failed ", deco: *combutil} - # carrier: {empty: {}} - - - script: # mpd song name - path: @mpd_song_name_script@ - content: - map: - conditions: - playing: - string: {text: "{song} ", deco: *combwea} - ~playing: - string: {text: "", deco: *combwea} - - script: # Sound volume - path: @volume_script@ - content: - map: - on-click: /bin/sh -c "pavucontrol" - conditions: - muted: - string: - text: " " - deco: *bgcurg - ~muted: - string: {text: " {volume}% ", deco: *combutil} - - # - script: # Grade average - # path: @grade_average_script@ - # content: - # string: - # text: " {grade} " - # deco: *combmem - - - backlight: - name: @backlight@ - content: - - string: {text: " {percent}% ", deco: *combutil} - - - script: # CPU - path: @cpu_script@ - content: - string: - text: " {cpu}% " - deco: *combmem - - - script: # Memory info - path: @memory_script@ - content: - map: - conditions: - swapstate: - string: - text: " {memperc}%({swapperc}%) " - deco: *combmem - ~swapstate: - string: - text: " {memperc}% " - deco: *combmem - - script: # Disk space - path: @disk_script@ - content: - string: - text: " {diskspace}({diskperc})" - deco: *combmem - - battery: - name: BAT0 - poll-interval: 300 - content: - list: - items: - - ramp: - tag: capacity - items: - - string: - text: " {capacity}%({estimate}) " - deco: *bgcurg - - string: - text: " {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - - string: - text: " {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - - string: - text: " {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - - string: - text: " {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - #- script: # tray - # path: /home/dt/.config/yambar/scripts/yambar-tray - # content: - # empty: {} - #- script: - # path: /home/dt/.config/yambar/scripts/yambar-tray-width - # poll-interval: 10 - # content: - # string: - # text: "{padding}" - # deco: *combmem diff --git a/modules/home.legacy/conf/yambar/default.nix b/modules/home.legacy/conf/yambar/default.nix deleted file mode 100644 index 72dcaa8e..00000000 --- a/modules/home.legacy/conf/yambar/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - nixosConfig, - sysLib, - pkgs, - lib, - ... -}: let - makeScript = { - name, - dependencies, - ... - }: - sysLib.writeShellScript { - inherit name; - src = ./scripts/${name}.sh; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); - } - + "/bin/${name}"; -in { - xdg.configFile."yambar/config.yml".source = pkgs.substituteAll { - src = - if nixosConfig.soispha.laptop.enable - then ./config/laptop.yml - else ./config/config.yml; - - backlight = - if nixosConfig.soispha.laptop.enable - then nixosConfig.soispha.laptop.backlight - else ""; - - mpd_song_name_script = makeScript { - dependencies = builtins.attrValues {inherit (pkgs) mpc;}; - name = "mpd_song_name"; - }; - - volume_script = makeScript { - dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk coreutils;}; - name = "sound-volume"; - }; - - cpu_script = lib.getExe pkgs.yambar-cpu; - - memory_script = lib.getExe pkgs.yambar-memory; - - disk_script = makeScript { - dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;}; - name = "disk"; - }; - }; -} |