mirror of
https://github.com/DerTyp7/.dotfiles.git
synced 2025-10-28 12:32:08 +01:00
Fixed setup
This commit is contained in:
29
.gitignore
vendored
Normal file
29
.gitignore
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
*
|
||||||
|
!install-packages.sh
|
||||||
|
!README.md
|
||||||
|
!install-software.md
|
||||||
|
!.gitignore
|
||||||
|
|
||||||
|
!alacritty
|
||||||
|
!alacritty/alacritty.toml
|
||||||
|
|
||||||
|
!fastfetch
|
||||||
|
!fastfetch/config.jsonc
|
||||||
|
|
||||||
|
!fish
|
||||||
|
!fish/*
|
||||||
|
!fish/*/**
|
||||||
|
|
||||||
|
!hypr
|
||||||
|
!hypr/*
|
||||||
|
!hypr/*/**
|
||||||
|
|
||||||
|
!swaylock
|
||||||
|
!swaylock/config
|
||||||
|
|
||||||
|
!waybar
|
||||||
|
!waybar/*
|
||||||
|
!waybar/*/**
|
||||||
|
|
||||||
|
!wofi
|
||||||
|
!wofi/*
|
||||||
@@ -4,13 +4,14 @@ My personal configuration files for various applications and tools running on Ca
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. To set up my dotfiles on your system, you can use the following command:
|
1. Install packages:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -sL https://raw.githubusercontent.com/DerTyp7/.dotfiles/refs/heads/master/setup.sh | bash
|
curl -sL https://raw.githubusercontent.com/DerTyp7/.dotfiles/refs/heads/master/install-packages.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Follow these guides:
|
2. (optional) Download config files from this repository to your `~/.config` directory
|
||||||
|
3. Follow these guides:
|
||||||
- [Setting Up Proton-CachyOS with Lutris and Heroic](https://wiki.cachyos.org/configuration/gaming/#setting-up-proton-cachyos-with-lutris-and-heroic)
|
- [Setting Up Proton-CachyOS with Lutris and Heroic](https://wiki.cachyos.org/configuration/gaming/#setting-up-proton-cachyos-with-lutris-and-heroic)
|
||||||
- [Pre-caching shaders with Proton-CachyOS, -GE and -EM](https://wiki.cachyos.org/configuration/gaming/#pre-caching-shaders-with-proton-cachyos--ge-and--em)
|
- [Pre-caching shaders with Proton-CachyOS, -GE and -EM](https://wiki.cachyos.org/configuration/gaming/#pre-caching-shaders-with-proton-cachyos--ge-and--em)
|
||||||
- [How to add game-performance to Steam, Lutris and Heroic Games Launcher](https://wiki.cachyos.org/configuration/gaming/#how-to-add-game-performance-to-steam-lutris-and-heroic-games-launcher)
|
- [How to add game-performance to Steam, Lutris and Heroic Games Launcher](https://wiki.cachyos.org/configuration/gaming/#how-to-add-game-performance-to-steam-lutris-and-heroic-games-launcher)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
sudo pacman -Syu --noconfirm\
|
sudo pacman -Syu --noconfirm\
|
||||||
cachyos-gaming-meta \
|
cachyos-gaming-meta \
|
||||||
cachyos-gaming-applications \
|
cachyos-gaming-applications \
|
||||||
@@ -10,7 +8,8 @@ sudo pacman -Syu --noconfirm\
|
|||||||
discord \
|
discord \
|
||||||
obs-studio \
|
obs-studio \
|
||||||
vlc \
|
vlc \
|
||||||
brave-bin
|
brave-bin \
|
||||||
|
ttf-jetbrains-mono-nerd
|
||||||
|
|
||||||
paru -Syu --noconfirm \
|
paru -Syu --noconfirm \
|
||||||
teamspeak \
|
teamspeak \
|
||||||
@@ -18,14 +17,5 @@ paru -Syu --noconfirm \
|
|||||||
brave-bin \
|
brave-bin \
|
||||||
prismlauncher \
|
prismlauncher \
|
||||||
bottles \
|
bottles \
|
||||||
signal-desktop
|
signal-desktop \
|
||||||
|
visual-studio-code-bin
|
||||||
git clone https://github.com/DerTyp7/.dotfiles.git ~/.config/
|
|
||||||
rsync -a ~/.config/.dotfiles/ ~/.config/ && rm -rf ~/.config/.dotfiles
|
|
||||||
|
|
||||||
read -r -p "Reboot now? (Y/n) " reply
|
|
||||||
if [[ $reply =~ ^[Yy] ]]; then
|
|
||||||
sudo reboot now
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
127
waybar/mediaplayer.py
Executable file
127
waybar/mediaplayer.py
Executable file
@@ -0,0 +1,127 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
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 occurance 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()
|
||||||
10
waybar/waybar.sh
Executable file
10
waybar/waybar.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Terminate already running bar instances
|
||||||
|
killall -q waybar
|
||||||
|
|
||||||
|
# Wait until the processes have been shut down
|
||||||
|
while pgrep -x waybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
|
# Launch main
|
||||||
|
waybar &
|
||||||
Reference in New Issue
Block a user