mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-04 06:10:40 -04:00
updates
This commit is contained in:
parent
1f8cb3c145
commit
610604e80f
253 changed files with 27055 additions and 44 deletions
26
.config/ags/old/modules/quicksettings/widgets/MicMute.js
Normal file
26
.config/ags/old/modules/quicksettings/widgets/MicMute.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { SimpleToggleButton } from "../ToggleButton.js"
|
||||
import icons from "../../../lib/icons.js"
|
||||
const { microphone } = await Service.import("audio")
|
||||
|
||||
const icon = () => microphone.is_muted || microphone.stream?.is_muted
|
||||
? icons.audio.mic.muted
|
||||
: icons.audio.mic.high
|
||||
|
||||
const label = () => microphone.is_muted || microphone.stream?.is_muted
|
||||
? "Muted"
|
||||
: "Unmuted"
|
||||
|
||||
// TODO: Variable watch option
|
||||
const ico = Variable(icon())
|
||||
microphone.connect("changed", () => ico.value = icon())
|
||||
|
||||
// TODO: Variable watch option
|
||||
const lbl = Variable(label())
|
||||
microphone.connect("changed", () => lbl.value = label())
|
||||
|
||||
export const MicMute = () => SimpleToggleButton({
|
||||
icon: ico.bind(),
|
||||
label: lbl.bind(),
|
||||
toggle: () => microphone.is_muted = !microphone.is_muted,
|
||||
connection: [microphone, () => microphone?.is_muted || false],
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue