Compare commits
5 Commits
3cc19cd9b8
...
0f8709784a
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f8709784a | |||
| bafa00a6a1 | |||
| 5fbd147cc4 | |||
|
|
56ae2cd201 | ||
|
|
0b238f52ef |
@@ -24,7 +24,7 @@ font=NotoSans Nerd Font
|
|||||||
# x-margin=0
|
# x-margin=0
|
||||||
# y-margin=0
|
# y-margin=0
|
||||||
# lines=15
|
# lines=15
|
||||||
width=80
|
width=40
|
||||||
# tabs=8
|
# tabs=8
|
||||||
# horizontal-pad=40
|
# horizontal-pad=40
|
||||||
# vertical-pad=8
|
# vertical-pad=8
|
||||||
|
|||||||
102
niri/config.kdl
102
niri/config.kdl
@@ -3,6 +3,10 @@
|
|||||||
// Check the wiki for a full description of the configuration:
|
// Check the wiki for a full description of the configuration:
|
||||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction
|
// https://github.com/YaLTeR/niri/wiki/Configuration:-Introduction
|
||||||
|
|
||||||
|
hotkey-overlay {
|
||||||
|
skip-at-startup
|
||||||
|
}
|
||||||
|
|
||||||
// Input device configuration.
|
// Input device configuration.
|
||||||
// Find the full list of options on the wiki:
|
// Find the full list of options on the wiki:
|
||||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
|
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
|
||||||
@@ -24,17 +28,18 @@ input {
|
|||||||
// Next sections include libinput settings.
|
// Next sections include libinput settings.
|
||||||
// Omitting settings disables them, or leaves them at their default values.
|
// Omitting settings disables them, or leaves them at their default values.
|
||||||
touchpad {
|
touchpad {
|
||||||
off
|
// off
|
||||||
// tap
|
// tap
|
||||||
// dwt
|
// dwt
|
||||||
// dwtp
|
// dwtp
|
||||||
// drag false
|
// drag false
|
||||||
// drag-lock
|
// drag-lock
|
||||||
// natural-scroll
|
natural-scroll
|
||||||
// accel-speed 0.2
|
// accel-speed 0.2
|
||||||
// accel-profile "flat"
|
// accel-profile "flat"
|
||||||
// scroll-method "two-finger"
|
scroll-method "two-finger"
|
||||||
// disabled-on-external-mouse
|
disabled-on-external-mouse
|
||||||
|
click-method "clickfinger"
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse {
|
mouse {
|
||||||
@@ -56,6 +61,18 @@ input {
|
|||||||
// middle-emulation
|
// middle-emulation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
touch {
|
||||||
|
// off
|
||||||
|
map-to-output "eDP-1"
|
||||||
|
}
|
||||||
|
|
||||||
|
tablet {
|
||||||
|
// off
|
||||||
|
map-to-output "eDP-1"
|
||||||
|
// left-handed
|
||||||
|
// calibration-matrix 1.0 0.0 0.0 0.0 1.0 0.0
|
||||||
|
}
|
||||||
|
|
||||||
// Uncomment this to make the mouse warp to the center of newly focused windows.
|
// Uncomment this to make the mouse warp to the center of newly focused windows.
|
||||||
warp-mouse-to-focus
|
warp-mouse-to-focus
|
||||||
|
|
||||||
@@ -65,6 +82,7 @@ input {
|
|||||||
|
|
||||||
// Change the Mod key to Alt
|
// Change the Mod key to Alt
|
||||||
mod-key "Alt"
|
mod-key "Alt"
|
||||||
|
mod-key-nested "Super"
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can configure outputs by their name, which you can find
|
// You can configure outputs by their name, which you can find
|
||||||
@@ -103,35 +121,25 @@ input {
|
|||||||
// automatically.
|
// automatically.
|
||||||
position x=1280 y=0
|
position x=1280 y=0
|
||||||
}
|
}
|
||||||
output "HDMI-A-1" {
|
output "Acer Technologies KG272U TP1SA002851C" {
|
||||||
// Uncomment this line to disable this output.
|
mode "2560x1440"
|
||||||
// off
|
|
||||||
|
|
||||||
// Resolution and, optionally, refresh rate of the output.
|
|
||||||
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
|
|
||||||
// If the refresh rate is omitted, niri will pick the highest refresh rate
|
|
||||||
// for the resolution.
|
|
||||||
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
|
|
||||||
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
|
|
||||||
mode "2560x1440@74.924"
|
|
||||||
|
|
||||||
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
|
|
||||||
scale 1
|
scale 1
|
||||||
|
|
||||||
// Transform allows to rotate the output counter-clockwise, valid values are:
|
|
||||||
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
|
|
||||||
transform "90"
|
transform "90"
|
||||||
|
position x=0 y=0
|
||||||
|
}
|
||||||
|
|
||||||
// Position of the output in the global coordinate space.
|
output "ViewSonic Corporation VX2758-Series VVF190100000" {
|
||||||
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
|
mode "2560x1440"
|
||||||
// The cursor can only move between directly adjacent outputs.
|
scale 1
|
||||||
// Output scale and rotation has to be taken into account for positioning:
|
transform "normal"
|
||||||
// outputs are sized in logical, or scaled, pixels.
|
position x=1440 y=755
|
||||||
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
|
focus-at-startup
|
||||||
// so to put another output directly adjacent to it on the right, set its x to 1920.
|
}
|
||||||
// If the position is unset or results in an overlap, the output is instead placed
|
|
||||||
// automatically.
|
output "AU Optronics 0x583D Unknown" {
|
||||||
position x=0 y=-730
|
mode "1920x1080"
|
||||||
|
scale 1.25
|
||||||
|
transform "normal"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings that influence how windows are positioned and sized.
|
// Settings that influence how windows are positioned and sized.
|
||||||
@@ -167,7 +175,7 @@ layout {
|
|||||||
// preset-window-heights { }
|
// preset-window-heights { }
|
||||||
|
|
||||||
// You can change the default width of the new windows.
|
// You can change the default width of the new windows.
|
||||||
default-column-width { proportion 0.5; }
|
default-column-width { proportion 0.66667; }
|
||||||
// If you leave the brackets empty, the windows themselves will decide their initial width.
|
// If you leave the brackets empty, the windows themselves will decide their initial width.
|
||||||
// default-column-width {}
|
// default-column-width {}
|
||||||
|
|
||||||
@@ -290,16 +298,14 @@ layout {
|
|||||||
// See the binds section below for more spawn examples.
|
// See the binds section below for more spawn examples.
|
||||||
|
|
||||||
// This line starts waybar, a commonly used bar for Wayland compositors.
|
// This line starts waybar, a commonly used bar for Wayland compositors.
|
||||||
// spawn-at-startup "waybar"
|
spawn-at-startup "waybar"
|
||||||
spawn-at-startup "/home/danmac/.local/bin/sway_startup" "/usr/share/backgrounds/pika/yurtle_s_travelling_pot_shop_by_neytirix_dfb2d8o.jpg"
|
spawn-at-startup "/home/danmac/.config/niri/sway_startup" "/home/danmac/Pictures/Nextcloud/IMG_8826-Enhanced-NR.jpg"
|
||||||
spawn-at-startup "xwayland-satellite"
|
spawn-at-startup "xwayland-satellite"
|
||||||
spawn-at-startup "xrdb" "/home/danmac/.Xresources"
|
|
||||||
spawn-at-startup "flatpak" "run" "com.nextcloud.desktopclient.nextcloud"
|
spawn-at-startup "flatpak" "run" "com.nextcloud.desktopclient.nextcloud"
|
||||||
|
spawn-at-startup "cosmic-app-library"
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
DISPLAY ":0"
|
DISPLAY ":0"
|
||||||
XCURSOR_THEME "Pop"
|
|
||||||
XCURSOR_SIZE "24"
|
|
||||||
}
|
}
|
||||||
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
||||||
// If the client will specifically ask for CSD, the request will be honored.
|
// If the client will specifically ask for CSD, the request will be honored.
|
||||||
@@ -333,13 +339,13 @@ animations {
|
|||||||
|
|
||||||
// Work around WezTerm's initial configure bug
|
// Work around WezTerm's initial configure bug
|
||||||
// by setting an empty default-column-width.
|
// by setting an empty default-column-width.
|
||||||
window-rule {
|
// window-rule {
|
||||||
// This regular expression is intentionally made as specific as possible,
|
// This regular expression is intentionally made as specific as possible,
|
||||||
// since this is the default config, and we want no false positives.
|
// since this is the default config, and we want no false positives.
|
||||||
// You can get away with just app-id="wezterm" if you want.
|
// You can get away with just app-id="wezterm" if you want.
|
||||||
match app-id=r#"^org\.wezfurlong\.wezterm$"#
|
// match app-id=r#"^org\.wezfurlong\.wezterm$"#
|
||||||
default-column-width {}
|
// default-column-width { }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Open the Firefox picture-in-picture player as floating by default.
|
// Open the Firefox picture-in-picture player as floating by default.
|
||||||
window-rule {
|
window-rule {
|
||||||
@@ -355,6 +361,14 @@ window-rule {
|
|||||||
open-floating true
|
open-floating true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window-rule {
|
||||||
|
// Zed and Zen should be 66% wide
|
||||||
|
match app-id="dev.zed.Zed"
|
||||||
|
match app-id="zen"
|
||||||
|
|
||||||
|
default-column-width { proportion 0.66667; }
|
||||||
|
}
|
||||||
|
|
||||||
// Example: block out two password managers from screen capture.
|
// Example: block out two password managers from screen capture.
|
||||||
// (This example rule is commented out with a "/-" in front.)
|
// (This example rule is commented out with a "/-" in front.)
|
||||||
/-window-rule {
|
/-window-rule {
|
||||||
@@ -391,10 +405,13 @@ binds {
|
|||||||
|
|
||||||
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
||||||
Mod+T hotkey-overlay-title="Open a Terminal: wezterm" { spawn "wezterm"; }
|
Mod+T hotkey-overlay-title="Open a Terminal: wezterm" { spawn "wezterm"; }
|
||||||
Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
|
Mod+D hotkey-overlay-title="Open the COSMIC App Launcher" { spawn "cosmic-app-library"; }
|
||||||
|
Mod+Shift+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
|
||||||
Mod+B hotkey-overlay-title="Open the Default Browser" { spawn "xdg-open" "http://"; }
|
Mod+B hotkey-overlay-title="Open the Default Browser" { spawn "xdg-open" "http://"; }
|
||||||
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
|
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock" "-f" "-i" "/usr/share/backgrounds/gnome/swoosh-l.jxl"; }
|
||||||
|
|
||||||
|
// toggle notification panel
|
||||||
|
Mod+Shift+N hotkey-overlay-title="Toggle notification window" { spawn "swaync-client" "-t"; }
|
||||||
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
||||||
// Note: the entire command goes as a single argument in the end.
|
// Note: the entire command goes as a single argument in the end.
|
||||||
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
||||||
@@ -572,6 +589,7 @@ binds {
|
|||||||
Mod+Shift+R { switch-preset-window-height; }
|
Mod+Shift+R { switch-preset-window-height; }
|
||||||
Mod+Ctrl+R { reset-window-height; }
|
Mod+Ctrl+R { reset-window-height; }
|
||||||
Mod+F { maximize-column; }
|
Mod+F { maximize-column; }
|
||||||
|
Mod+G { reset-window-height; }
|
||||||
Mod+Shift+F { fullscreen-window; }
|
Mod+Shift+F { fullscreen-window; }
|
||||||
|
|
||||||
// Expand the focused column to space not taken up by other fully visible columns.
|
// Expand the focused column to space not taken up by other fully visible columns.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"layer": "top", // Waybar at top layer
|
"layer": "top", // Waybar at top layer
|
||||||
"output": "DP-1", // Only display on on monitor
|
"output": ["eDP-1", "DP-1"], // Only display on on monitor
|
||||||
"position": "top", // Waybar position (top|bottom|left|right)
|
"position": "top", // Waybar position (top|bottom|left|right)
|
||||||
"height": 36, // Waybar height (to be removed for auto height)
|
"height": 36, // Waybar height (to be removed for auto height)
|
||||||
// Choose the order of the modules
|
// Choose the order of the modules
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
"cpu",
|
"cpu",
|
||||||
"memory",
|
"memory",
|
||||||
"temperature",
|
"temperature",
|
||||||
|
"battery",
|
||||||
"custom/pl-stats",
|
"custom/pl-stats",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
"custom/pl-pulse",
|
"custom/pl-pulse",
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
"on-click-right": "exec wezterm -e btm"
|
"on-click-right": "exec wezterm -e btm"
|
||||||
},
|
},
|
||||||
"memory": {
|
"memory": {
|
||||||
"format": "{percentage}% / {used:0.1f}GiB / {avail:0.1f}GiB ",
|
"format": "{percentage}% / {used:0.1f}GiB ",
|
||||||
"on-click-right": "exec wezterm -e btm"
|
"on-click-right": "exec wezterm -e btm"
|
||||||
},
|
},
|
||||||
"temperature": {
|
"temperature": {
|
||||||
@@ -115,9 +116,9 @@
|
|||||||
"warning": 30,
|
"warning": 30,
|
||||||
"critical": 15
|
"critical": 15
|
||||||
},
|
},
|
||||||
"format": "{icon}",
|
"format": "{capacity}% {icon}",
|
||||||
"format-charging": "",
|
"format-charging": "{capacity}% ",
|
||||||
"format-plugged": "",
|
"format-plugged": "{capacity}% ",
|
||||||
"format-alt": "{capacity}% {time}",
|
"format-alt": "{capacity}% {time}",
|
||||||
"format-icons": ["", "", "", "", ""]
|
"format-icons": ["", "", "", "", ""]
|
||||||
},
|
},
|
||||||
@@ -171,7 +172,7 @@
|
|||||||
"format" : "⏻ ",
|
"format" : "⏻ ",
|
||||||
"tooltip": false,
|
"tooltip": false,
|
||||||
"menu": "on-click",
|
"menu": "on-click",
|
||||||
"menu-file": "/usr/share/waybar/custom_modules/power_menu.xml", // Menu file in resources folder
|
"menu-file": "~/.config/waybar/custom_modules/power_menu.xml", // Menu file in resources folder
|
||||||
"menu-actions": {
|
"menu-actions": {
|
||||||
"shutdown": "systemctl poweroff",
|
"shutdown": "systemctl poweroff",
|
||||||
"reboot": "systemctl reboot",
|
"reboot": "systemctl reboot",
|
||||||
|
|||||||
195
waybar/custom_modules/mediaplayer.py
Executable file
195
waybar/custom_modules/mediaplayer.py
Executable file
@@ -0,0 +1,195 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import gi
|
||||||
|
gi.require_version("Playerctl", "2.0")
|
||||||
|
from gi.repository import Playerctl, GLib
|
||||||
|
from gi.repository.Playerctl import Player
|
||||||
|
import argparse
|
||||||
|
import logging
|
||||||
|
import sys
|
||||||
|
import signal
|
||||||
|
import gi
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
def signal_handler(sig, frame):
|
||||||
|
logger.info("Received signal to stop, exiting")
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
sys.stdout.flush()
|
||||||
|
# loop.quit()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
class PlayerManager:
|
||||||
|
def __init__(self, selected_player=None, excluded_player=[]):
|
||||||
|
self.manager = Playerctl.PlayerManager()
|
||||||
|
self.loop = GLib.MainLoop()
|
||||||
|
self.manager.connect(
|
||||||
|
"name-appeared", lambda *args: self.on_player_appeared(*args))
|
||||||
|
self.manager.connect(
|
||||||
|
"player-vanished", lambda *args: self.on_player_vanished(*args))
|
||||||
|
|
||||||
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
signal.signal(signal.SIGTERM, signal_handler)
|
||||||
|
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||||
|
self.selected_player = selected_player
|
||||||
|
self.excluded_player = excluded_player.split(',') if excluded_player else []
|
||||||
|
|
||||||
|
self.init_players()
|
||||||
|
|
||||||
|
def init_players(self):
|
||||||
|
for player in self.manager.props.player_names:
|
||||||
|
if player.name in self.excluded_player:
|
||||||
|
continue
|
||||||
|
if self.selected_player is not None and self.selected_player != player.name:
|
||||||
|
logger.debug(f"{player.name} is not the filtered player, skipping it")
|
||||||
|
continue
|
||||||
|
self.init_player(player)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
logger.info("Starting main loop")
|
||||||
|
self.loop.run()
|
||||||
|
|
||||||
|
def init_player(self, player):
|
||||||
|
logger.info(f"Initialize new player: {player.name}")
|
||||||
|
player = Playerctl.Player.new_from_name(player)
|
||||||
|
player.connect("playback-status",
|
||||||
|
self.on_playback_status_changed, None)
|
||||||
|
player.connect("metadata", self.on_metadata_changed, None)
|
||||||
|
self.manager.manage_player(player)
|
||||||
|
self.on_metadata_changed(player, player.props.metadata)
|
||||||
|
|
||||||
|
def get_players(self) -> List[Player]:
|
||||||
|
return self.manager.props.players
|
||||||
|
|
||||||
|
def write_output(self, text, player):
|
||||||
|
logger.debug(f"Writing output: {text}")
|
||||||
|
|
||||||
|
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 clear_output(self):
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
def on_playback_status_changed(self, player, status, _=None):
|
||||||
|
logger.debug(f"Playback status changed for player {player.props.player_name}: {status}")
|
||||||
|
self.on_metadata_changed(player, player.props.metadata)
|
||||||
|
|
||||||
|
def get_first_playing_player(self):
|
||||||
|
players = self.get_players()
|
||||||
|
logger.debug(f"Getting first playing player from {len(players)} players")
|
||||||
|
if len(players) > 0:
|
||||||
|
# if any are playing, show the first one that is playing
|
||||||
|
# reverse order, so that the most recently added ones are preferred
|
||||||
|
for player in players[::-1]:
|
||||||
|
if player.props.status == "Playing":
|
||||||
|
return player
|
||||||
|
# if none are playing, show the first one
|
||||||
|
return players[0]
|
||||||
|
else:
|
||||||
|
logger.debug("No players found")
|
||||||
|
return None
|
||||||
|
|
||||||
|
def show_most_important_player(self):
|
||||||
|
logger.debug("Showing most important player")
|
||||||
|
# show the currently playing player
|
||||||
|
# or else show the first paused player
|
||||||
|
# or else show nothing
|
||||||
|
current_player = self.get_first_playing_player()
|
||||||
|
if current_player is not None:
|
||||||
|
self.on_metadata_changed(current_player, current_player.props.metadata)
|
||||||
|
else:
|
||||||
|
self.clear_output()
|
||||||
|
|
||||||
|
def on_metadata_changed(self, player, metadata, _=None):
|
||||||
|
logger.debug(f"Metadata changed for player {player.props.player_name}")
|
||||||
|
player_name = player.props.player_name
|
||||||
|
artist = player.get_artist()
|
||||||
|
title = player.get_title()
|
||||||
|
title = title.replace("&", "&")
|
||||||
|
|
||||||
|
track_info = ""
|
||||||
|
if player_name == "spotify" and "mpris:trackid" in metadata.keys() and ":ad:" in player.props.metadata["mpris:trackid"]:
|
||||||
|
track_info = "Advertisement"
|
||||||
|
elif artist is not None and title is not None:
|
||||||
|
track_info = f"{artist} - {title}"
|
||||||
|
else:
|
||||||
|
track_info = title
|
||||||
|
|
||||||
|
if track_info:
|
||||||
|
if player.props.status == "Playing":
|
||||||
|
track_info = " " + track_info
|
||||||
|
else:
|
||||||
|
track_info = " " + track_info
|
||||||
|
# only print output if no other player is playing
|
||||||
|
current_playing = self.get_first_playing_player()
|
||||||
|
if current_playing is None or current_playing.props.player_name == player.props.player_name:
|
||||||
|
self.write_output(track_info, player)
|
||||||
|
else:
|
||||||
|
logger.debug(f"Other player {current_playing.props.player_name} is playing, skipping")
|
||||||
|
|
||||||
|
def on_player_appeared(self, _, player):
|
||||||
|
logger.info(f"Player has appeared: {player.name}")
|
||||||
|
if player.name in self.excluded_player:
|
||||||
|
logger.debug(
|
||||||
|
"New player appeared, but it's in exclude player list, skipping")
|
||||||
|
return
|
||||||
|
if player is not None and (self.selected_player is None or player.name == self.selected_player):
|
||||||
|
self.init_player(player)
|
||||||
|
else:
|
||||||
|
logger.debug(
|
||||||
|
"New player appeared, but it's not the selected player, skipping")
|
||||||
|
|
||||||
|
def on_player_vanished(self, _, player):
|
||||||
|
logger.info(f"Player {player.props.player_name} has vanished")
|
||||||
|
self.show_most_important_player()
|
||||||
|
|
||||||
|
def parse_arguments():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
|
# Increase verbosity with every occurrence of -v
|
||||||
|
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||||
|
|
||||||
|
parser.add_argument("-x", "--exclude", "- Comma-separated list of excluded player")
|
||||||
|
|
||||||
|
# Define for which player we"re listening
|
||||||
|
parser.add_argument("--player")
|
||||||
|
|
||||||
|
parser.add_argument("--enable-logging", action="store_true")
|
||||||
|
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
arguments = parse_arguments()
|
||||||
|
|
||||||
|
# Initialize logging
|
||||||
|
if arguments.enable_logging:
|
||||||
|
logfile = os.path.join(os.path.dirname(
|
||||||
|
os.path.realpath(__file__)), "media-player.log")
|
||||||
|
logging.basicConfig(filename=logfile, level=logging.DEBUG,
|
||||||
|
format="%(asctime)s %(name)s %(levelname)s:%(lineno)d %(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))
|
||||||
|
|
||||||
|
logger.info("Creating player manager")
|
||||||
|
if arguments.player:
|
||||||
|
logger.info(f"Filtering for player: {arguments.player}")
|
||||||
|
if arguments.exclude:
|
||||||
|
logger.info(f"Exclude player {arguments.exclude}")
|
||||||
|
|
||||||
|
player = PlayerManager(arguments.player, arguments.exclude)
|
||||||
|
player.run()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
28
waybar/custom_modules/power_menu.xml
Normal file
28
waybar/custom_modules/power_menu.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<object class="GtkMenu" id="menu">
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="suspend">
|
||||||
|
<property name="label">Suspend</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="reboot">
|
||||||
|
<property name="label">Reboot</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="shutdown">
|
||||||
|
<property name="label">Shutdown</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkMenuItem" id="logout">
|
||||||
|
<property name="label">Logout</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
||||||
1
waybar/icons/cachy-logo.svg
Normal file
1
waybar/icons/cachy-logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 6.1 KiB |
@@ -1 +1 @@
|
|||||||
pika-logo.svg
|
cachy-logo.svg
|
||||||
@@ -43,6 +43,7 @@
|
|||||||
#clock,
|
#clock,
|
||||||
#idle_inhibitor,
|
#idle_inhibitor,
|
||||||
#cpu,
|
#cpu,
|
||||||
|
#battery,
|
||||||
#memory,
|
#memory,
|
||||||
#temperature,
|
#temperature,
|
||||||
#pulseaudio,
|
#pulseaudio,
|
||||||
@@ -149,6 +150,7 @@
|
|||||||
|
|
||||||
#cpu,
|
#cpu,
|
||||||
#memory,
|
#memory,
|
||||||
|
#battery,
|
||||||
#temperature {
|
#temperature {
|
||||||
background: @peach;
|
background: @peach;
|
||||||
padding: 0px 6px;
|
padding: 0px 6px;
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
local wezterm = require 'wezterm'
|
local wezterm = require("wezterm")
|
||||||
local c = {}
|
local c = {}
|
||||||
|
|
||||||
-- Display Configuration
|
-- Display Configuration
|
||||||
|
|
||||||
c.font = wezterm.font 'NotoMono Nerd Font'
|
c.font = wezterm.font("NotoMono Nerd Font")
|
||||||
c.color_scheme = 'Catppuccin Macchiato'
|
c.color_scheme = "Catppuccin Macchiato"
|
||||||
c.window_background_opacity = 0.7
|
c.window_background_opacity = 0.7
|
||||||
c.window_decorations = 'RESIZE'
|
c.window_decorations = "NONE"
|
||||||
c.visual_bell = {
|
c.visual_bell = {
|
||||||
fade_in_function = 'EaseIn',
|
fade_in_function = "EaseIn",
|
||||||
fade_in_duration_ms = 150,
|
fade_in_duration_ms = 150,
|
||||||
fade_out_function = 'EaseOut',
|
fade_out_function = "EaseOut",
|
||||||
fade_out_duration_ms = 150,
|
fade_out_duration_ms = 150,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,6 +23,6 @@ c.switch_to_last_active_tab_when_closing_tab = true
|
|||||||
|
|
||||||
-- Stop Confirming shit please
|
-- Stop Confirming shit please
|
||||||
|
|
||||||
c.window_close_confirmation = 'NeverPrompt'
|
c.window_close_confirmation = "NeverPrompt"
|
||||||
|
|
||||||
return c
|
return c
|
||||||
|
|||||||
Reference in New Issue
Block a user