Compare commits

...

6 commits

13 changed files with 233 additions and 207 deletions

View file

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1711099426,
"narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=",
"lastModified": 1713532798,
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"owner": "numtide",
"repo": "devshell",
"rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8",
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"type": "github"
},
"original": {
@ -64,16 +64,16 @@
]
},
"locked": {
"lastModified": 1710888565,
"narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=",
"lastModified": 1716736833,
"narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce",
"rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
@ -101,26 +101,26 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1711668574,
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1711233294,
"narHash": "sha256-eEu5y4J145BYDw9o/YEmeJyqh8blgnZwuz9k234zuWc=",
"lastModified": 1717265169,
"narHash": "sha256-IITcGd6xpNoyq9SZBigCkv4+qMHSqot0RDPR4xsZ2CA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ac6bdf6181666ebb4f90dd20f31e2fa66ede6b68",
"rev": "3b1b4895b2c5f9f5544d02132896aeb9ceea77bc",
"type": "github"
},
"original": {
@ -132,11 +132,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"lastModified": 1716948383,
"narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
"type": "github"
},
"original": {
@ -230,11 +230,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1711249319,
"narHash": "sha256-N+Pp3/8H+rd7cO71VNV/ovV/Kwt+XNeUHNhsmyTabdM=",
"lastModified": 1717297459,
"narHash": "sha256-cZC2f68w5UrJ1f+2NWGV9Gx0dEYmxwomWN2B0lx0QRA=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "405987a66cce9a4a82f321f11b205982a7127c88",
"rev": "ab2a43b0d21d1d37d4d5726a892f714eaeb4b075",
"type": "github"
},
"original": {
@ -316,11 +316,11 @@
]
},
"locked": {
"lastModified": 1696331477,
"narHash": "sha256-YkbRa/1wQWdWkVJ01JvV+75KIdM37UErqKgTf0L54Fk=",
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "bfc53579db89de750b25b0c5e7af299e0c06d7d3",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {

View file

@ -2,7 +2,7 @@
description = "System configuration of my machines using flakes";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
devshell = {
@ -11,7 +11,7 @@
};
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
openconnect-sso = {

View file

@ -80,7 +80,7 @@
xkbVariant = "altgr-intl";
};
system.stateVersion = "23.11";
system.stateVersion = "24.05";
time.timeZone = "Europe/Brussels";

View file

@ -19,7 +19,7 @@
networking = {
networkmanager.enable = true;
openconnect-sso.enable = true;
# openconnect-sso.enable = true;
};
nix = {
@ -97,16 +97,17 @@
lidSwitchDocked = "ignore";
};
xserver = {
xserver.xkb = {
# Keyboard layout
layout = "us";
xkbVariant = "altgr-intl";
# Touchpad
libinput.enable = true;
variant = "altgr-intl";
};
# Touchpad
libinput.enable = true;
};
system.stateVersion = "23.11";
system.stateVersion = "24.05";
time.timeZone = "Europe/Brussels";

View file

@ -8,9 +8,10 @@ in {
config = lib.mkIf cfg.enable {
virtualisation.docker = {
enable = true;
enableNvidia = true;
# Because these are made for development purposes and not for servers
enableOnBoot = false;
};
hardware.nvidia-container-toolkit.enable = true;
};
}

View file

@ -25,10 +25,12 @@ in {
};
guest = {
enable = true;
x11 = true;
clipboard = true;
seamless = true;
};
};
# Define the group
users.groups.vboxusers = {};
sisyphus.users.wantedGroups = [

View file

@ -76,7 +76,6 @@ in {
nsxiv # Lightweight image viewer
qalculate-gtk # Calculator
spotify
tea # Gitea CLI
unzip
vifm # File manager
zathura # PDF viewer

View file

@ -30,8 +30,9 @@
"name": "keep",
"position": "top",
"height": 25,
"modules-left": ["sway/mode"],
"modules-left": ["sway/mode", "keyboard-state"],
"modules-center": ["clock"],
"modules-right": ["privacy"],
"include": [
// Import modules (!)

View file

@ -1,7 +1,7 @@
{
"modules-left": [
"idle_inhibitor",
"custom/media"
"mpris"
],
"modules-center": [
"sway/workspaces"

View file

@ -1,16 +1,12 @@
{
"modules-left": [
"modules-left": [
"sway/workspaces",
"idle_inhibitor",
"custom/light-dark-toggle",
"custom/night-light-toggle",
"custom/toggle-notifications",
"custom/media"
"custom/scratchpad-indicator",
"mpris",
"group/system",
],
"modules-right": [
"memory",
"cpu",
"temperature",
"modules-right": [
"group/hardware",
"custom/sep",
"bluetooth",
"network",

View file

@ -1,131 +0,0 @@
#!/usr/bin/env python3
# From:
# https://github.com/Alexays/Waybar/blob/master/resources/custom_modules/mediaplayer.py
import argparse
import logging
import sys
import signal
import gi
import json
gi.require_version('Playerctl', '2.0')
from gi.repository import Playerctl, GLib
logger = logging.getLogger(__name__)
def write_output(text, player):
logger.info('Writing output')
output = {'text': text,
'class': 'custom-' + player.props.player_name,
'alt': player.props.player_name}
sys.stdout.write(json.dumps(output) + '\n')
sys.stdout.flush()
def on_play(player, status, manager):
logger.info('Received new playback status')
on_metadata(player, player.props.metadata, manager)
def on_metadata(player, metadata, manager):
logger.info('Received new metadata')
track_info = ''
if player.props.player_name == 'spotify' and \
'mpris:trackid' in metadata.keys() and \
':ad:' in player.props.metadata['mpris:trackid']:
track_info = 'AD PLAYING'
elif player.get_artist() != '' and player.get_title() != '':
track_info = '{artist} - {title}'.format(artist=player.get_artist(),
title=player.get_title())
else:
track_info = player.get_title()
if player.props.status != 'Playing' and track_info:
track_info = '' + track_info
write_output(track_info, player)
def on_player_appeared(manager, player, selected_player=None):
if player is not None and (selected_player is None or player.name == selected_player):
init_player(manager, player)
else:
logger.debug("New player appeared, but it's not the selected player, skipping")
def on_player_vanished(manager, player):
logger.info('Player has vanished')
sys.stdout.write('\n')
sys.stdout.flush()
def init_player(manager, name):
logger.debug('Initialize player: {player}'.format(player=name.name))
player = Playerctl.Player.new_from_name(name)
player.connect('playback-status', on_play, manager)
player.connect('metadata', on_metadata, manager)
manager.manage_player(player)
on_metadata(player, player.props.metadata, manager)
def signal_handler(sig, frame):
logger.debug('Received signal to stop, exiting')
sys.stdout.write('\n')
sys.stdout.flush()
# loop.quit()
sys.exit(0)
def parse_arguments():
parser = argparse.ArgumentParser()
# Increase verbosity with every occurrence of -v
parser.add_argument('-v', '--verbose', action='count', default=0)
# Define for which player we're listening
parser.add_argument('--player')
return parser.parse_args()
def main():
arguments = parse_arguments()
# Initialize logging
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG,
format='%(name)s %(levelname)s %(message)s')
# Logging is set by default to WARN and higher.
# With every occurrence of -v it's lowered by one
logger.setLevel(max((3 - arguments.verbose) * 10, 0))
# Log the sent command line arguments
logger.debug('Arguments received {}'.format(vars(arguments)))
manager = Playerctl.PlayerManager()
loop = GLib.MainLoop()
manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player))
manager.connect('player-vanished', on_player_vanished)
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
for player in manager.props.player_names:
if arguments.player is not None and arguments.player != player.name:
logger.debug('{player} is not the filtered player, skipping it'
.format(player=player.name)
)
continue
init_player(manager, player)
loop.run()
if __name__ == '__main__':
main()

View file

@ -47,19 +47,6 @@
"tooltip-format": "Launch an application"
},
"custom/media": {
"escape": true,
"exec": "~/.config/waybar/mediaplayer.py 2> /dev/null",
"format": "{icon} {}",
"format-icons": {
"default": "\uf51f",
"spotify": "\uf1bc"
},
"max-length": 40,
"on-click": "playerctl play-pause",
"return-type": "json"
},
"custom/light-dark-toggle": {
"on-click": "bash ${SCRIPT_DIR}/toggle-light-dark.sh",
"tooltip-format": "Toggle between light and dark mode",
@ -71,7 +58,52 @@
"on-click": "bash ${SCRIPT_DIR}/sunset.sh",
"tooltip-format": "Toggle night-light on or off",
"format": "\uf0eb ",
"tooltip": true
"tooltip": true,
"tooltip-format": "Toggle night-light on or off",
},
"custom/scratchpad-indicator": {
"interval": 3,
"return-type": "json",
"exec": "swaymsg -t get_tree | jq --unbuffered --compact-output '(recurse(.nodes[]) | select(.name == \"__i3_scratch\") | .focus) as $scratch_ids | [.. | (.nodes? + .floating_nodes?) // empty | .[] | select(.id |IN($scratch_ids[]))] as $scratch_nodes | if ($scratch_nodes|length) > 0 then { text: \"\\($scratch_nodes | length)\", tooltip: $scratch_nodes | map(\"\\(.app_id // .window_properties.class) (\\(.id)): \\(.name)\") | join(\"\\n\") } else empty end'",
"format": "{} \uf2d2",
"on-click": "exec swaymsg 'scratchpad show'",
"on-click-right": "exec swaymsg 'move scratchpad'"
},
"custom/system-lock": {
"format": "\uf09c",
"tooltip": true,
"tooltip-format": "Lock device",
"on-click": "swaylock -f"
},
"custom/system-sleep": {
"format": "\uf186",
"tooltip": true,
"tooltip-format": "Put device to sleep",
"on-click": "swaylock -f; systemctl suspend"
},
"custom/system-hibernate": {
"format": "\uf2dc",
"tooltip": true,
"tooltip-format": "Hibernate device",
"on-click": "swaylock -f; systemctl hibernate"
},
"custom/system-reboot": {
"format": "\uf0e2",
"tooltip": true,
"tooltip-format": "Reboot device",
"on-click": "systemctl reboot"
},
"custom/system-shutdown": {
"format": "\uf011",
"tooltip": true,
"tooltip-format": "Shutdown device",
"on-click": "systemctl poweroff -i"
},
"custom/toggle-notifications": {
@ -83,10 +115,45 @@
"cpu": {
"format": "{usage}% \uf2db",
"on-click": "kitty -e htop",
"on-click": "foot -e htop",
"tooltip": true
},
"group/hardware": {
"orientation": "inherit",
"modules": [
"power-profiles-daemon",
"memory",
"cpu",
"temperature",
"custom/system-shutdown",
"custom/system-reboot",
"custom/system-hibernate",
"custom/system-sleep",
"custom/system-lock",
],
"drawer": {
"transition-duration": 500,
"transition-left-to-right": false,
"children-class": "drawer-child",
},
},
"group/system": {
"orientation": "inherit",
"modules": [
"idle_inhibitor",
"custom/light-dark-toggle",
"custom/night-light-toggle",
"custom/toggle-notifications",
],
"drawer": {
"transition-duration": 500,
"tansition-left-to-right": true,
"children-class": "drawer-child",
},
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
@ -96,11 +163,44 @@
"tooltip": false
},
"keyboard-state": {
"format": {
"capslock": "{icon}",
},
"format-icons": {
"locked": "\uf023",
"unlocked": ""
},
"numlock": false,
"capslock": true,
"scrollock": false,
},
"memory": {
"format": "{}% \uf1c0",
"on-click": "kitty -e zenith"
},
"mpris": {
// "ignored-players": ["firefox"]
"format": "{player_icon} {dynamic}",
"format-paused": "{status_icon} <i>{dynamic}</i>",
"tooltip-format": "{player} ({status}) {title} - {artist} - {album}",
"player-icons": {
"default": "\uf51f",
"spotify": "\uf1bc",
"mpv": "🎵"
},
"status-icons": {
"paused": "⏸"
},
"dynamic-order": [
"title",
"artist"
],
"dynamic-len": 40,
},
"network": {
"format-disconnected": "\uf127",
"format-ethernet": "\uf6ff {ifname}: {ipadds}/{cidr}",
@ -129,6 +229,36 @@
// }
},
"power-profiles-daemon": {
"format": "{icon}",
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
"tooltip": true,
"format-icons": {
"default": "",
"performance": "",
"balanced": "",
"power-saver": ""
}
},
"privacy": {
"icon-spacing": 4,
"icon-size": 18,
"transition-duration": 250,
"modules": [
{
"type": "screenshare",
"tooltip": true,
"tooltip-icon-size": 18,
},
{
"type": "audio-in",
"tooltip": true,
"tooltip-icon-size": 18,
},
],
},
"pulseaudio": {
"format": "{volume}% {icon}{format_source}",
"format-muted": "\uf6a9{format_source}",

View file

@ -15,7 +15,7 @@
@define-color accent #00897b;
window#waybar {
font-family: font-awesome, letter, monospace;
font-family: letter, "Font Awesome 6 Free", font-awesome, monospace;
font-size: 13px;
-webkit-font-smoothing: antialiased;
transition-property: background-color;
@ -49,10 +49,31 @@ window#waybar {
}
/* All modules individually. */
#backlight, #battery, #bluetooth, #clock, #cpu,
#custom-browser, #custom-media, #custom-light-dark-toggle, #custom-night-light-toggle, #custom-toggle-notifications,
#disk, #idle_inhibitor, #memory, #mode, #mpd, #network,
#pulseaudio, #temperature, #tray {
#backlight,
#battery,
#bluetooth,
#clock,
#cpu,
#custom-browser,
#custom-light-dark-toggle,
#custom-night-light-toggle,
#custom-system-lock, #custom-system-sleep, #custom-system-hibernate, #custom-system-reboot, #custom-system-shutdown,
#custom-toggle-notifications,
#disk,
#group-hardware,
#group-system,
#idle_inhibitor,
#keyboard-state,
#memory,
#mode,
#mpd,
#mpris,
#network,
#power-profiles-daemon,
#privacy-item.audio-in, #privacy-item.audio-out, #privacy-item.screenshare,
#pulseaudio,
#temperature,
#tray {
padding: 0 5px;
}
@ -101,17 +122,16 @@ label:focus {
opacity: 0.6;
}
#custom-media {
#mpris {
color: #2a5c45;
background-color: #66cc99;
min-width: 100px;
}
#custom-media.custom-spotify {
#mpris.spotify {
background-color: #66cc99;
}
#custom-media.custom-vlc {
#mpris.vlc {
background-color: #ffa000;
}
@ -134,5 +154,12 @@ label:focus {
background-color: #eb4d4b;
}
#privacy-item.audio-in,
#privacy-item.audio-out,
#privacy-item.screenshare {
background-color: #ffaa01;
color: #2d3436;
}
@import "sharp.css";