feat(sway): initial configuration
This commit is contained in:
parent
8dab10bb0a
commit
a7e761ab1a
BIN
dots/.config/dconf/user
Normal file
BIN
dots/.config/dconf/user
Normal file
Binary file not shown.
55
dots/.config/kraxarn/spotify-qt.json
Normal file
55
dots/.config/kraxarn/spotify-qt.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"Account": {
|
||||
"access_token": "",
|
||||
"client_id": "",
|
||||
"client_secret": "",
|
||||
"last_refresh": 1659838296,
|
||||
"refresh_token": ""
|
||||
},
|
||||
"General": {
|
||||
"check_for_updates": true,
|
||||
"close_to_tray": false,
|
||||
"custom_playlist_order": [],
|
||||
"fallback_icons": false,
|
||||
"fixed_width_time": true,
|
||||
"hidden_song_headers": [],
|
||||
"last_device": "",
|
||||
"last_playlist": "",
|
||||
"last_version": "v3.9",
|
||||
"last_volume": 20,
|
||||
"media_controller": false,
|
||||
"notify_track_change": false,
|
||||
"playlist_order": 0,
|
||||
"refresh_interval": 3,
|
||||
"relative_added": true,
|
||||
"show_changelog": true,
|
||||
"song_header_sort_by": -1,
|
||||
"style": "",
|
||||
"style_palette": 0,
|
||||
"track_list_resize_mode": 0,
|
||||
"track_numbers": 1,
|
||||
"tray_album_art": false,
|
||||
"tray_icon": true,
|
||||
"tray_light_icon": false
|
||||
},
|
||||
"Qt": {
|
||||
"album_size": 0,
|
||||
"custom_font_name": "",
|
||||
"custom_font_size": 0,
|
||||
"mirror_title_bar": false,
|
||||
"system_title_bar": false
|
||||
},
|
||||
"Spotify": {
|
||||
"always_start": true,
|
||||
"backend": "",
|
||||
"bitrate": 320,
|
||||
"device_type": 0,
|
||||
"disable_discovery": false,
|
||||
"global_config": false,
|
||||
"keyring_password": false,
|
||||
"max_queue": 500,
|
||||
"path": "",
|
||||
"start_client": false,
|
||||
"username": ""
|
||||
}
|
||||
}
|
0
dots/.config/ncspot/config.toml
Normal file
0
dots/.config/ncspot/config.toml
Normal file
BIN
dots/.config/ncspot/userstate.cbor
Normal file
BIN
dots/.config/ncspot/userstate.cbor
Normal file
Binary file not shown.
8
dots/.config/pavucontrol.ini
Normal file
8
dots/.config/pavucontrol.ini
Normal file
@ -0,0 +1,8 @@
|
||||
[window]
|
||||
width=1703
|
||||
height=1416
|
||||
sinkInputType=1
|
||||
sourceOutputType=1
|
||||
sinkType=0
|
||||
sourceType=1
|
||||
showVolumeMeters=1
|
4
dots/.config/pulse/cookie
Normal file
4
dots/.config/pulse/cookie
Normal file
@ -0,0 +1,4 @@
|
||||
•7–jé̾èOГ¬ŒQ
|
||||
÷
o<>Ù£<C399>ŒÐ3ƒ¤‡Ré—î__ûÈëâÆz˜”NVKg,Àh©á+“#“bnQšŸúX™ò fèœ+?;…N
|
||||
O¼tà½ü¹ŒÒ‰¶m<C2B6>Ÿ<EFBFBD>…t•[yg)²~ð4ã)̳c<C2B3>þQ¸¾Aùü’nd=–Ø
̆ïvN†ïgU.úmçúò˘¤I¯ ·.,>—Ð|I2<49>‡ÆÂB|˜¡ó89`ƒ
|
||||
.ñƒ'"¯ª·Ö(4„Mx+Pl#c§Ê)Ïú¢º¼…0¼<ÍFTJ>8'3ÝÂ<C39D>Ð(÷š©Sî>\¼Ty6á°Ú‰<C39A>öé®çëÙoW_
|
161
dots/.config/river/init
Executable file
161
dots/.config/river/init
Executable file
@ -0,0 +1,161 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This is the example configuration file for river.
|
||||
#
|
||||
# If you wish to edit this, you will probably want to copy it to
|
||||
# $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first.
|
||||
#
|
||||
# See the river(1), riverctl(1), and rivertile(1) man pages for complete
|
||||
# documentation.
|
||||
|
||||
# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc.
|
||||
|
||||
# Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot)
|
||||
riverctl map normal Super+Shift Return spawn foot
|
||||
|
||||
# Super+Q to close the focused view
|
||||
riverctl map normal Super Q close
|
||||
|
||||
# Super+Shift+E to exit river
|
||||
riverctl map normal Super+Shift E exit
|
||||
|
||||
# Super+J and Super+K to focus the next/previous view in the layout stack
|
||||
riverctl map normal Super J focus-view next
|
||||
riverctl map normal Super K focus-view previous
|
||||
|
||||
# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous
|
||||
# view in the layout stack
|
||||
riverctl map normal Super+Shift J swap next
|
||||
riverctl map normal Super+Shift K swap previous
|
||||
|
||||
# Super+Period and Super+Comma to focus the next/previous output
|
||||
riverctl map normal Super Period focus-output next
|
||||
riverctl map normal Super Comma focus-output previous
|
||||
|
||||
# Super+Shift+{Period,Comma} to send the focused view to the next/previous output
|
||||
riverctl map normal Super+Shift Period send-to-output next
|
||||
riverctl map normal Super+Shift Comma send-to-output previous
|
||||
|
||||
riverctl map normal Super Return spawn 'wezterm'
|
||||
riverctl map normal Super S spawn 'wofi --show drun'
|
||||
# Super+Return to bump the focused view to the top of the layout stack
|
||||
riverctl map normal Super+Ctrl Return zoom
|
||||
|
||||
# Super+H and Super+L to decrease/increase the main ratio of rivertile(1)
|
||||
riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05"
|
||||
riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05"
|
||||
|
||||
# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1)
|
||||
riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1"
|
||||
riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1"
|
||||
|
||||
# Super+Alt+{H,J,K,L} to move views
|
||||
riverctl map normal Super+Alt H move left 100
|
||||
riverctl map normal Super+Alt J move down 100
|
||||
riverctl map normal Super+Alt K move up 100
|
||||
riverctl map normal Super+Alt L move right 100
|
||||
|
||||
# Super+Alt+Control+{H,J,K,L} to snap views to screen edges
|
||||
riverctl map normal Super+Alt+Control H snap left
|
||||
riverctl map normal Super+Alt+Control J snap down
|
||||
riverctl map normal Super+Alt+Control K snap up
|
||||
riverctl map normal Super+Alt+Control L snap right
|
||||
|
||||
# Super+Alt+Shift+{H,J,K,L} to resize views
|
||||
riverctl map normal Super+Alt+Shift H resize horizontal -100
|
||||
riverctl map normal Super+Alt+Shift J resize vertical 100
|
||||
riverctl map normal Super+Alt+Shift K resize vertical -100
|
||||
riverctl map normal Super+Alt+Shift L resize horizontal 100
|
||||
|
||||
# Super + Left Mouse Button to move views
|
||||
riverctl map-pointer normal Super BTN_LEFT move-view
|
||||
|
||||
# Super + Right Mouse Button to resize views
|
||||
riverctl map-pointer normal Super BTN_RIGHT resize-view
|
||||
|
||||
for i in $(seq 1 9); do
|
||||
tags=$((1 << ($i - 1)))
|
||||
|
||||
# Super+[1-9] to focus tag [0-8]
|
||||
riverctl map normal Super $i set-focused-tags $tags
|
||||
|
||||
# Super+Shift+[1-9] to tag focused view with tag [0-8]
|
||||
riverctl map normal Super+Shift $i set-view-tags $tags
|
||||
|
||||
# Super+Ctrl+[1-9] to toggle focus of tag [0-8]
|
||||
riverctl map normal Super+Control $i toggle-focused-tags $tags
|
||||
|
||||
# Super+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view
|
||||
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
|
||||
done
|
||||
|
||||
# Super+0 to focus all tags
|
||||
# Super+Shift+0 to tag focused view with all tags
|
||||
all_tags=$(((1 << 32) - 1))
|
||||
riverctl map normal Super 0 set-focused-tags $all_tags
|
||||
riverctl map normal Super+Shift 0 set-view-tags $all_tags
|
||||
|
||||
# Super+Space to toggle float
|
||||
riverctl map normal Super Space toggle-float
|
||||
|
||||
# Super+F to toggle fullscreen
|
||||
riverctl map normal Super F toggle-fullscreen
|
||||
|
||||
# Super+{Up,Right,Down,Left} to change layout orientation
|
||||
riverctl map normal Super Up send-layout-cmd rivertile "main-location top"
|
||||
riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
|
||||
riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom"
|
||||
riverctl map normal Super Left send-layout-cmd rivertile "main-location left"
|
||||
|
||||
# Declare a passthrough mode. This mode has only a single mapping to return to
|
||||
# normal mode. This makes it useful for testing a nested wayland compositor
|
||||
riverctl declare-mode passthrough
|
||||
|
||||
# Super+F11 to enter passthrough mode
|
||||
riverctl map normal Super F11 enter-mode passthrough
|
||||
|
||||
# Super+F11 to return to normal mode
|
||||
riverctl map passthrough Super F11 enter-mode normal
|
||||
|
||||
# Various media key mapping examples for both normal and locked mode which do
|
||||
# not have a modifier
|
||||
for mode in normal locked; do
|
||||
# Eject the optical drive (well if you still have one that is)
|
||||
riverctl map $mode None XF86Eject spawn 'eject -T'
|
||||
|
||||
# Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
|
||||
riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5'
|
||||
riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5'
|
||||
riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute'
|
||||
|
||||
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
|
||||
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
|
||||
riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause'
|
||||
riverctl map $mode None XF86AudioPrev spawn 'playerctl previous'
|
||||
riverctl map $mode None XF86AudioNext spawn 'playerctl next'
|
||||
|
||||
# Control screen backlight brightness with light (https://github.com/haikarainen/light)
|
||||
riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5'
|
||||
riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5'
|
||||
done
|
||||
|
||||
# Set background and border color
|
||||
riverctl background-color 0x002b36
|
||||
riverctl border-color-focused 0x93a1a1
|
||||
riverctl border-color-unfocused 0x586e75
|
||||
|
||||
# Set keyboard repeat rate
|
||||
riverctl set-repeat 50 300
|
||||
|
||||
# Make certain views start floating
|
||||
riverctl float-filter-add app-id float
|
||||
riverctl float-filter-add title "popup title with spaces"
|
||||
|
||||
# Set app-ids and titles of views which should use client side decorations
|
||||
riverctl csd-filter-add app-id "gedit"
|
||||
|
||||
# Set the default layout generator to be rivertile and start it.
|
||||
# River will send the process group of the init executable SIGTERM on exit.
|
||||
riverctl default-layout rivertile
|
||||
rivertile -view-padding 6 -outer-padding 6
|
||||
Footer
|
3
dots/.config/rog/rog-control-center.cfg
Normal file
3
dots/.config/rog/rog-control-center.cfg
Normal file
@ -0,0 +1,3 @@
|
||||
run_in_background = true
|
||||
startup_in_background = false
|
||||
enable_notifications = true
|
7
dots/.config/sway/conf/appearance.conf
Normal file
7
dots/.config/sway/conf/appearance.conf
Normal file
@ -0,0 +1,7 @@
|
||||
gaps inner 5
|
||||
gaps outer 10
|
||||
default_border pixel 2
|
||||
default_floating_border pixel 2
|
||||
|
||||
set $wallpapers_path $HOME/.local/share/wallpapers
|
||||
output * bg $wallpapers_path/Industrial-Shaded.png fill
|
125
dots/.config/sway/conf/bindings.conf
Normal file
125
dots/.config/sway/conf/bindings.conf
Normal file
@ -0,0 +1,125 @@
|
||||
### Global Binding Variables ###
|
||||
input "type:keyboard" {
|
||||
# remap caps to escape
|
||||
xkb_options caps:escape
|
||||
}
|
||||
|
||||
# Set mod to Super
|
||||
set $mod Mod4
|
||||
|
||||
# Allow floating windows to bV dragged
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Toggle fullscreen
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# Rotate through layouts
|
||||
bindsym $mod+ctrl+space layout toggle all
|
||||
|
||||
# Execs
|
||||
bindsym {
|
||||
$mod+Return exec wezterm
|
||||
$mod+Space exec wofi --show drun
|
||||
$mod+c exec wl-copy
|
||||
$mod+v exec wl-paste
|
||||
}
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+q kill
|
||||
|
||||
# Focus workspaces
|
||||
bindsym {
|
||||
$mod+Ctrl+A workspace prev
|
||||
$mod+Ctrl+S workspace next
|
||||
}
|
||||
|
||||
# Focus Windows
|
||||
bindsym {
|
||||
$mod+Left focus left
|
||||
$mod+Down focus down
|
||||
$mod+Up focus up
|
||||
$mod+Right focus right
|
||||
}
|
||||
|
||||
# Reload configuration file
|
||||
bindsym $mod+Shift+R reload
|
||||
|
||||
# Exit sway
|
||||
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||
|
||||
### Media Keys ###
|
||||
bindsym {
|
||||
XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% #increase sound volume
|
||||
XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% #decrease sound volume
|
||||
XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound
|
||||
|
||||
# Media player controls
|
||||
XF86AudioPlay exec playerctl play-pause
|
||||
XF86AudioPause exec playerctl play-pause
|
||||
XF86AudioForward exec playerctl next
|
||||
XF86AudioRewind exec playerctl previous
|
||||
}
|
||||
|
||||
#### MODES ####
|
||||
## Movement Modes ##
|
||||
# Move focused window
|
||||
set $mode_move_window "Move Window"
|
||||
mode $mode_move_window {
|
||||
bindsym {
|
||||
Right move right
|
||||
Left move left
|
||||
Down move down
|
||||
Up move up
|
||||
Escape mode "default"
|
||||
}
|
||||
}
|
||||
|
||||
# Move focused window to workspace
|
||||
set $mode_move_window_workspace "Move Window to Workspace"
|
||||
mode $mode_move_window_workspace {
|
||||
bindsym {
|
||||
Right move window to workspace next
|
||||
Left move window to workspace prev
|
||||
Escape mode "default"
|
||||
}
|
||||
}
|
||||
|
||||
# Move focused workspace to monitor
|
||||
set $mode_move_workspace_monitor "Move Workspace Monitor"
|
||||
mode $mode_move_workspace_monitor {
|
||||
bindsym {
|
||||
Right move workspace to output right
|
||||
Left move workspace to output left
|
||||
Down move workspace to output down
|
||||
Up move workspace to output up
|
||||
Escape mode "default"
|
||||
}
|
||||
}
|
||||
|
||||
# Move mode
|
||||
set $mode_move "Move"
|
||||
mode $mode_move {
|
||||
bindsym {
|
||||
m mode $mode_move_window
|
||||
w mode $mode_move_window_workspace
|
||||
d mode $mode_move_workspace_monitor
|
||||
Escape mode "default"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bindsym $mod+m mode $mode_move
|
||||
## End Movement Modes ##
|
||||
|
||||
## Scratchpad Mode ##
|
||||
set $mode_scratchpad "Scratchpad"
|
||||
mode $mode_scratchpad {
|
||||
bindsym {
|
||||
a move window to scratchpad; mode "default"
|
||||
s scratchpad show; mode "default"
|
||||
Escape mode "default"
|
||||
}
|
||||
}
|
||||
|
||||
bindsym $mod+s mode $mode_scratchpad
|
||||
## End Scratchpad Mode ##
|
13
dots/.config/sway/conf/screens.conf
Normal file
13
dots/.config/sway/conf/screens.conf
Normal file
@ -0,0 +1,13 @@
|
||||
set $laptop eDP-2
|
||||
output $laptop
|
||||
output DP-3 pos -2560 0
|
||||
|
||||
# Shut off the laptop screen when closed
|
||||
bindswitch lid:on output $laptop disable
|
||||
bindswitch lid:off output $laptop enable
|
||||
exec_always ~/.config/sway/scripts/laptop-clamshell.bash
|
||||
|
||||
input "type:keyboard" {
|
||||
repeat_delay 300
|
||||
repeat_rate 40
|
||||
}
|
3
dots/.config/sway/config
Normal file
3
dots/.config/sway/config
Normal file
@ -0,0 +1,3 @@
|
||||
include conf/*.conf
|
||||
|
||||
xwayland enable
|
6
dots/.config/sway/scripts/laptop-clamshell.bash
Normal file
6
dots/.config/sway/scripts/laptop-clamshell.bash
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
if grep -q open /proc/acpi/button/lid/LID/state; then
|
||||
swaymsg output eDP-2 enable
|
||||
else
|
||||
swaymsg output eDP-2 disable
|
||||
fi
|
79
dots/.config/waybar/config
Normal file
79
dots/.config/waybar/config
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"modules-left": ["custom/launcher","cpu","memory","custom/media","tray"],
|
||||
"modules-center": ["river/tags"],
|
||||
"modules-right": ["custom/updates","custom/wallpaper","backlight","pulseaudio","clock", "battery","custom/power"],
|
||||
|
||||
"pulseaudio": {
|
||||
"tooltip": false,
|
||||
"scroll-step": 5,
|
||||
"format": "{icon} {volume}%",
|
||||
"format-muted": "{icon} {volume}%",
|
||||
"on-click":"pactl set-sink-mute @DEFAULT_SINK@ toggle",
|
||||
"format-icons": {
|
||||
"default": ["", "", ""]
|
||||
}
|
||||
},
|
||||
|
||||
"river/tags": {
|
||||
"num-tags": 6
|
||||
},
|
||||
"network": {
|
||||
"tooltip": false,
|
||||
"format-wifi": " {essid}",
|
||||
"format-ethernet": ""
|
||||
},
|
||||
"backlight": {
|
||||
"tooltip": false,
|
||||
"format": " {}%",
|
||||
"interval":1,
|
||||
"on-scroll-up": "light -A 5",
|
||||
"on-scroll-down": "light -U 5"
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
"good": 95,
|
||||
"warning": 30,
|
||||
"critical": 20
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-charging": " {capacity}%",
|
||||
"format-plugged": " {capacity}%",
|
||||
"format-alt": "{time} {icon}",
|
||||
"format-icons": ["", "", "", "", ""]
|
||||
},
|
||||
"tray":{
|
||||
"icon-size":18,
|
||||
"spacing": 10
|
||||
},
|
||||
"clock": {
|
||||
"format": "{: %I:%M %p %d/%m/%Y}"
|
||||
},
|
||||
"cpu": {
|
||||
"interval": 15,
|
||||
"format": " {}%",
|
||||
"max-length": 10
|
||||
},
|
||||
"memory": {
|
||||
"interval": 30,
|
||||
"format": " {}%",
|
||||
"max-length": 10
|
||||
},
|
||||
"custom/media": {
|
||||
"interval": 30,
|
||||
"format": "{icon} {}",
|
||||
"return-type": "json",
|
||||
"max-length": 20,
|
||||
"format-icons": {
|
||||
"default": " "
|
||||
},
|
||||
"escape": true,
|
||||
"exec": "$HOME/.config/waybar/scripts/mediaplayer.py 2> /dev/null",
|
||||
"on-click": "playerctl play-pause"
|
||||
},
|
||||
"custom/launcher":{
|
||||
"format": " ",
|
||||
"on-click": "wofi --show drun",
|
||||
"on-click-right": "killall wofi"
|
||||
},
|
||||
}
|
127
dots/.config/waybar/scripts/mediaplayer.py
Normal file
127
dots/.config/waybar/scripts/mediaplayer.py
Normal file
@ -0,0 +1,127 @@
|
||||
#!/usr/bin/env python3
|
||||
from gi.repository import Playerctl, GLib
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
import signal
|
||||
import gi
|
||||
import json
|
||||
gi.require_version('Playerctl', '2.0')
|
||||
|
||||
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)
|
||||
|
||||
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()
|
248
dots/.config/waybar/style.css
Normal file
248
dots/.config/waybar/style.css
Normal file
@ -0,0 +1,248 @@
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 10;
|
||||
font-family: "JetbrainsMono Nerd Font";
|
||||
font-size: 15px;
|
||||
min-height: 10px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
#window {
|
||||
margin-top: 6px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
#tags {
|
||||
margin-top: 6px;
|
||||
margin-left: 12px;
|
||||
font-size: 4px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
background: #161320;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
#tags button {
|
||||
transition: none;
|
||||
color: #b5e8e0;
|
||||
background: transparent;
|
||||
font-size: 16px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#tags button.occupied {
|
||||
transition: none;
|
||||
color: #f28fad;
|
||||
background: transparent;
|
||||
font-size: 4px;
|
||||
}
|
||||
|
||||
#tags button.focused {
|
||||
color: #abe9b3;
|
||||
border-top: 2px solid #abe9b3;
|
||||
border-bottom: 2px solid #abe9b3;
|
||||
}
|
||||
|
||||
#tags button:hover {
|
||||
transition: none;
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
color: #fae3b0;
|
||||
border-color: #e8a2af;
|
||||
color: #e8a2af;
|
||||
}
|
||||
|
||||
#tags button.focused:hover {
|
||||
color: #e8a2af;
|
||||
}
|
||||
|
||||
#network {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #bd93f9;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #1a1826;
|
||||
background: #fae3b0;
|
||||
}
|
||||
|
||||
#battery {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #b5e8e0;
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged {
|
||||
color: #161320;
|
||||
background-color: #b5e8e0;
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #b5e8e0;
|
||||
color: #161320;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #bf616a;
|
||||
color: #b5e8e0;
|
||||
}
|
||||
}
|
||||
|
||||
#backlight {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #f8bd96;
|
||||
}
|
||||
#clock {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #abe9b3;
|
||||
/*background: #1A1826;*/
|
||||
}
|
||||
|
||||
#memory {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 0px;
|
||||
padding-right: 10px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #ddb6f2;
|
||||
}
|
||||
#cpu {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 0px;
|
||||
padding-right: 10px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #96cdfb;
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 0px;
|
||||
padding-right: 10px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #b5e8e0;
|
||||
background: #161320;
|
||||
}
|
||||
|
||||
#custom-launcher {
|
||||
font-size: 24px;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 5px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #89dceb;
|
||||
background: #161320;
|
||||
}
|
||||
|
||||
#custom-power {
|
||||
font-size: 20px;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 5px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #f28fad;
|
||||
}
|
||||
|
||||
#custom-wallpaper {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #c9cbff;
|
||||
}
|
||||
|
||||
#custom-updates {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #e8a2af;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #161320;
|
||||
background: #f2cdcd;
|
||||
}
|
Loading…
Reference in New Issue
Block a user