Skip to content

makccr/pyt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

MAKC lgoo

Polybar YouTube Module

This is a module, and a python script that enables users to place the YouTube subscriber count for any YouTube channel into their polybar configuration.

Dependencies

  • python3, you may very well be able to run this with older versions of python, but it couldn't hurt to just go ahead and install the newest version.
sudo pacman -S python
sudo yay -S nerd-fonts-source-code-pro
  • Product Sans, is the default font for text I've configured this module with.
sudo yay -S ttf-google-fonts-git
  • Gnome Character Map (gucharmap), is a handy tool that will let you pick glyphs or icons, if you wan't to use a different font.

Installation Instructions

  1. Change directory into your polybar config, clone the repo:
cd ~/.config/polybar
git clone https://github.com/makccr/pyt.git
  1. Make the script executable
cd pyt
chmod +x sub.py
cd ..
  1. Edit polybar/config, to include the new module:
;You'll need to update the following areas of your polybar/config file:

font-0 = Product Sans:size=10;2
font-1 = Sauce Code Pro NF:size=18;4

modules-left = 
modules-center = 
modules-right = yt 

[module/yt]
type = custom/script
interval = 1800
format-prefix = ""
format = <label>
exec = /home/makc/.config/polybar/pyt/sub.py

YouTube Video

I've also created a YouTube video with details for setting up and API key, and using the module. If you have any questions, feel free to check out the video:

YT Sub Count Module

Trouble-shooting

  1. You may need to run chmod to make the sub.py file executable after unzipping the files:
chmod +x ~/.config/polybar/sub.py
  1. There is a limit to how many times you can fetch with a standard YouTube API key. By default the module's interval is set to 1800 (thirty minutes).
interval = 1800

You can set this interval to whatever value you want, but I experienced issues when refreshing at any point higher than once every five minutes (interval = 300). Do what you want, but you have been warned.

About

A polybar module to fetch the sub count for a YouTube channel.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%