Compare commits
4 Commits
7297ba1a5c
...
5314c171f9
| Author | SHA1 | Date | |
|---|---|---|---|
| 5314c171f9 | |||
| f62cb382a8 | |||
| 35e64c371b | |||
| 507d84c16d |
60
flake.lock
60
flake.lock
@ -40,11 +40,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739098586,
|
||||
"narHash": "sha256-08FW+tVGWQKdiPZqXk6FO1JNB/Zybi7IYSWSGpp8V0Y=",
|
||||
"lastModified": 1740813555,
|
||||
"narHash": "sha256-GvkG6zoBsWgI7pbt92NZjGcOZMYC1C6pW8Lc4W1xMBU=",
|
||||
"owner": "AdnanHodzic",
|
||||
"repo": "auto-cpufreq",
|
||||
"rev": "e6bbd2c8335a33f25a3fcb3bd2376e790f460ba2",
|
||||
"rev": "6be154724337fa74236ee811150872304db21d8b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -129,11 +129,11 @@
|
||||
},
|
||||
"locked": {
|
||||
"dir": "pkgs/firefox-addons",
|
||||
"lastModified": 1740212040,
|
||||
"narHash": "sha256-Gpvn9Z+ZgKPyb6qaAbahLbo6ZVj7VuLzSCmHZRvsACA=",
|
||||
"lastModified": 1741147406,
|
||||
"narHash": "sha256-sXP9Iz+DSfnS45XzlVIxnsGw3SOwlGWGogJB0MxALEw=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "9a8a0914000e4453c99a4c12e9862a0a40075851",
|
||||
"rev": "b8236b71159b0090b722eb686ec38612de854ddb",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
@ -408,11 +408,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740699498,
|
||||
"narHash": "sha256-r9hkKzX99CGiP1ZqH0e+SWKK4CMsRNRLyotuwrUjhTI=",
|
||||
"lastModified": 1741174782,
|
||||
"narHash": "sha256-dYRebJk58/d5Ej1G6xTOadTfG6tU5zFgXYrLsRJlrgw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "b71edac7a3167026aabea82a54d08b1794088c21",
|
||||
"rev": "def0dbbcea715d4514ca343ab4d6d7f3a1742da0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -539,11 +539,11 @@
|
||||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740707551,
|
||||
"narHash": "sha256-khQu5pduq+KTid2lHYQpVkFPR3WigOdtE5/95PijxU4=",
|
||||
"lastModified": 1741203213,
|
||||
"narHash": "sha256-q8RZy0nUhx3cocQBs7Tvg/+xNA6H8oXIV+M7iwuzH04=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "445337d03dce7c9aef10ff4d57fc516ac8c1b24d",
|
||||
"rev": "b51ab182ae3e8d88426af856b59dd28c6a9722ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -817,11 +817,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740390822,
|
||||
"narHash": "sha256-UnMANgi2Zf4gf4p49cXM4fDRrPEpN6oJJMXT4Z2BW/U=",
|
||||
"lastModified": 1740995332,
|
||||
"narHash": "sha256-SELnZZg9LOhw+kz60yEAr3l1plu70rBLInMRszLHtuc=",
|
||||
"owner": "Mic92",
|
||||
"repo": "nix-ld",
|
||||
"rev": "4c86e9f94553bceba004c48be6f2691971d2a6f7",
|
||||
"rev": "090c2003e3faa739e5a94e0a3cd782a1ccc40964",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -959,11 +959,11 @@
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1740603184,
|
||||
"narHash": "sha256-t+VaahjQAWyA+Ctn2idyo1yxRIYpaDxMgHkgCNiMJa4=",
|
||||
"lastModified": 1741048562,
|
||||
"narHash": "sha256-W4YZ3fvWZiFYYyd900kh8P8wU6DHSiwaH0j4+fai1Sk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f44bd8ca21e026135061a0a57dcf3d0775b67a49",
|
||||
"rev": "6af28b834daca767a7ef99f8a7defa957d0ade6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -975,11 +975,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1740560979,
|
||||
"narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
|
||||
"lastModified": 1741010256,
|
||||
"narHash": "sha256-WZNlK/KX7Sni0RyqLSqLPbK8k08Kq7H7RijPJbq9KHM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5135c59491985879812717f4c9fea69604e7f26f",
|
||||
"rev": "ba487dbc9d04e0634c64e3b1f0d25839a0a68246",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -1257,11 +1257,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739262228,
|
||||
"narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=",
|
||||
"lastModified": 1741043164,
|
||||
"narHash": "sha256-9lfmSZLz6eq9Ygr6cCmvQiiBEaPb54pUBcjvbEMPORc=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975",
|
||||
"rev": "3f2412536eeece783f0d0ad3861417f347219f4d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -1278,11 +1278,11 @@
|
||||
"systems": "systems_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740284169,
|
||||
"narHash": "sha256-Ne+3kEyOFD2sNfw3cnKk+Zi/tTk+WkmnsfE7PDLNEXU=",
|
||||
"lastModified": 1740889006,
|
||||
"narHash": "sha256-A1iyKVvZrLdLwqWPC9OvPjC85ADQn2R1EGfCzJBl+wI=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "spicetify-nix",
|
||||
"rev": "fd31f20e2bd2bf3894d729590bf578c02c252239",
|
||||
"rev": "f8d3757d4ae3af2175a631fb9598a42d30ee75fc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -1315,11 +1315,11 @@
|
||||
"tinted-zed": "tinted-zed"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740769934,
|
||||
"narHash": "sha256-iyxUwII/NQNClT77VqQiDpaXJz1r0Z8tNVxgY64mLak=",
|
||||
"lastModified": 1741112087,
|
||||
"narHash": "sha256-dBGwN4aHmX2QUXolZDhV+p06+WM5ZykL4wd9BD6bT7k=",
|
||||
"owner": "danth",
|
||||
"repo": "stylix",
|
||||
"rev": "de4ee5899042801b62f988687acd454d4d411075",
|
||||
"rev": "11780517948f214b9f93d1bf5a2d29bc181d3a33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
blueman.enable = false;
|
||||
media-player-control.enable = false;
|
||||
};
|
||||
autoUpdate.enable = false;
|
||||
autoCleanup.enable = true;
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
blueman.enable = true;
|
||||
media-player-control.enable = true;
|
||||
};
|
||||
|
||||
autoUpdate.enable = true;
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
vitetris
|
||||
steam
|
||||
superTuxKart
|
||||
wine
|
||||
wineWowPackages.stable
|
||||
|
||||
(writeShellScriptBin "gs" ''
|
||||
set -xeuo pipefail
|
||||
|
||||
@ -246,6 +246,18 @@ in {
|
||||
margin: 10px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.bt_bluetooth {
|
||||
color: #${config.lib.stylix.colors.base02};
|
||||
font-size: 22px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.bt_toggle {
|
||||
font-size: 52px;
|
||||
font-weight: normal;
|
||||
color: #${config.lib.stylix.colors.base16};
|
||||
}
|
||||
|
||||
/** Weather ***************************************/
|
||||
.iconweather {
|
||||
font-family: Iosevka Nerd Font;
|
||||
@ -472,6 +484,61 @@ in {
|
||||
home.packages = with pkgs; [
|
||||
brightnessctl
|
||||
|
||||
(writeShellScriptBin "bluetooth-toggle" ''
|
||||
# Check if MAC address is provided
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <MAC_ADDRESS>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MAC_ADDRESS="$1"
|
||||
|
||||
# Get connection status
|
||||
CONNECTED=$(bluetoothctl info "$MAC_ADDRESS" | grep "Connected" | awk '{print $2}')
|
||||
|
||||
if [ "$CONNECTED" = "yes" ]; then
|
||||
echo "Device $MAC_ADDRESS is connected. Disconnecting..."
|
||||
bluetoothctl disconnect "$MAC_ADDRESS"
|
||||
else
|
||||
echo "Device $MAC_ADDRESS is not connected. Connecting..."
|
||||
bluetoothctl connect "$MAC_ADDRESS"
|
||||
fi
|
||||
'')
|
||||
|
||||
(writeShellScriptBin "bluetooth-status" ''
|
||||
# Check if MAC address is provided as an argument
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <MAC_ADDRESS>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run bluetoothctl command and check if the device is connected
|
||||
status=$(bluetoothctl info "$1" | grep "Connected" | awk '{print $2}')
|
||||
|
||||
if [ "$status" == "yes" ]; then
|
||||
echo "Connected"
|
||||
else
|
||||
echo "Offline"
|
||||
fi
|
||||
'')
|
||||
|
||||
(writeShellScriptBin "bluetooth-battery" ''
|
||||
# Check if MAC address is provided as an argument
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <MAC_ADDRESS>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run bluetoothctl command and check if the device is connected
|
||||
status=$(bluetoothctl info "$1" | grep "Connected" | awk '{print $2}')
|
||||
|
||||
if [ "$status" == "yes" ]; then
|
||||
battery=$(bluetoothctl info "$1" | grep "Battery Percentage" | awk '{print $4}')
|
||||
echo " ''${battery:1:-1}%"
|
||||
else
|
||||
echo ""
|
||||
fi'')
|
||||
|
||||
(writeShellScriptBin "eww-dashboard-toggle" ''
|
||||
FILE="$HOME/${EWW_CACHE}"
|
||||
CFG="$HOME/${EWW_PATH}"
|
||||
@ -490,7 +557,8 @@ in {
|
||||
system \
|
||||
clock \
|
||||
uptime \
|
||||
music
|
||||
music \
|
||||
bluetooth
|
||||
}
|
||||
|
||||
## Launch or close widgets accordingly
|
||||
@ -499,7 +567,7 @@ in {
|
||||
run_eww
|
||||
else
|
||||
${EWW} --config "$CFG" close \
|
||||
background profile system clock uptime music apps logout sleep reboot poweroff folders
|
||||
background profile system clock uptime music apps logout sleep reboot poweroff folders bluetooth
|
||||
rm "$FILE"
|
||||
fi
|
||||
'')
|
||||
|
||||
@ -38,6 +38,13 @@
|
||||
;; Files vars
|
||||
(defpoll FREE :interval "5s" `df -h / | awk '{print $4}' | tail -n 1 | sed 's/G/GB/'`)
|
||||
|
||||
;; Bluetooth vars
|
||||
;; Headphones
|
||||
(defpoll BLUETOOTH_HEADPHONES_STATUS :interval "5s" `bluetooth-status EF:DD:5D:31:76:F0`)
|
||||
(defpoll BLUETOOTH_HEADPHONES_BATTERY :interval "5s" `bluetooth-battery EF:DD:5D:31:76:F0`)
|
||||
(defpoll BLUETOOTH_MOUSE_STATUS :interval "5s" `bluetooth-status D9:2E:B4:70:BF:D6`)
|
||||
(defpoll BLUETOOTH_MOUSE_BATTERY :interval "5s" `bluetooth-battery D9:2E:B4:70:BF:D6`)
|
||||
|
||||
|
||||
;; ** Widgets *************************************************************************
|
||||
|
||||
@ -82,7 +89,7 @@
|
||||
;; uptime
|
||||
(defwidget uptime []
|
||||
(box :class "genwin"
|
||||
(box :orientation "h" :halign "center" :spacing 40 :space-evenly "false" :vexpand "false" :hexpand "false"
|
||||
(box :orientation "h" :halign "center" :spacing 5 :space-evenly "false" :vexpand "false" :hexpand "false"
|
||||
(label :class "icontimer" :valign "center" :text " ")
|
||||
(box :orientation "v" :valign "center" :spacing 0 :space-evenly "false" :vexpand "false" :hexpand "false"
|
||||
(label :class "uphour" :halign "start" :wrap "true" :limit-width 25 :text UPHOUR)
|
||||
@ -102,6 +109,19 @@
|
||||
(box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false"
|
||||
(scale :onscroll "playerctl position 1+" :min 0 :active "true" :max 100 :value CURRENT)))))
|
||||
|
||||
;; Bluetooth
|
||||
(defwidget bluetooth []
|
||||
(box :class "genwin" :orientation "v" :spacing 10
|
||||
(box :orientation "h" :spacing 5 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "true"
|
||||
(button :class "bt_toggle" :onclick "bluetooth-toggle EF:DD:5D:31:76:F0" ""))
|
||||
(box :orientation "v" :spacing 10 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "true"
|
||||
(label :class "bt_bluetooth" :text BLUETOOTH_HEADPHONES_STATUS)
|
||||
(label :class "bt_bluetooth" :text BLUETOOTH_HEADPHONES_BATTERY))
|
||||
(box :orientation "h" :spacing 5 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "true"
|
||||
(button :class "bt_toggle" :onclick "bluetooth-toggle D9:2E:B4:70:BF:D6" ""))
|
||||
(box :orientation "v" :spacing 10 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "true"
|
||||
(label :class "bt_bluetooth" :text BLUETOOTH_MOUSE_STATUS)
|
||||
(label :class "bt_bluetooth" :text BLUETOOTH_MOUSE_BATTERY))))
|
||||
;; folders
|
||||
(defwidget folders []
|
||||
(box :class "genwin" :orientation "v" :space-evenly "false" :vexpand "false" :hexpand "false"
|
||||
@ -164,6 +184,11 @@
|
||||
:geometry (geometry :x 515 :y 490 :width 610 :height 280)
|
||||
(music))
|
||||
|
||||
;; bluetooth
|
||||
(defwindow bluetooth :stacking "fg" :focusable "false" :monitor 0
|
||||
:geometry (geometry :x 880 :y 150 :width 220 :height 325)
|
||||
(bluetooth))
|
||||
|
||||
;; folders
|
||||
(defwindow folders :stacking "fg" :focusable "false" :monitor 0
|
||||
:geometry (geometry :x 1445 :y 490 :width 325 :height 440)
|
||||
|
||||
@ -2,12 +2,14 @@
|
||||
lib,
|
||||
config,
|
||||
userSettings,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
sys.network.enable = lib.mkEnableOption "Enable networking";
|
||||
sys.bluetooth.enable = lib.mkEnableOption "Enable Bluetooth support";
|
||||
sys.bluetooth.blueman.enable = lib.mkEnableOption "Enable Blueman App";
|
||||
sys.bluetooth.media-player-control.enable = lib.mkEnableOption "Enable Media Player Control";
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
@ -35,5 +37,15 @@
|
||||
services.blueman.enable = true;
|
||||
}
|
||||
)
|
||||
(
|
||||
lib.mkIf config.sys.bluetooth.media-player-control.enable {
|
||||
systemd.user.services.mpris-proxy = {
|
||||
description = "Mpris proxy";
|
||||
after = ["network.target" "sound.target"];
|
||||
wantedBy = ["default.target"];
|
||||
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
bluetooth = {
|
||||
enable = lib.mkDefault true;
|
||||
blueman.enable = lib.mkDefault true;
|
||||
media-player-control.enable = lib.mkDefault false;
|
||||
};
|
||||
|
||||
autoUpdate.enable = lib.mkDefault true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user