add current playing music to polybar
This commit is contained in:
@@ -33,7 +33,9 @@ tiling_drag modifier titlebar
|
||||
# start a terminal
|
||||
bindsym $mod+q exec kitty
|
||||
bindsym $mod+e exec thunar
|
||||
bindsym Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png
|
||||
#bindsym Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png
|
||||
|
||||
bindsym Print exec --no-startup-id flameshot gui
|
||||
# kill focused window
|
||||
bindsym $mod+c kill
|
||||
# lock with wallpaper
|
||||
@@ -270,8 +272,8 @@ exec --no-startup-id nm-applet
|
||||
# set lock timeout to 20 minutes
|
||||
exec_always --no-startup-id xset dpms 0 0 1200 &
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- ~/.config/i3/scripts/lock.sh
|
||||
# prevent screen locking
|
||||
exec --no-startup-id caffeine
|
||||
# prevent screen locking, has xdg autostart
|
||||
# exec --no-startup-id caffeine
|
||||
|
||||
|
||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||
|
||||
12
.config/polybar/player-mpris-simple.sh
Executable file
12
.config/polybar/player-mpris-simple.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# hack nerd font required for icons
|
||||
|
||||
player_status=$(playerctl status 2> /dev/null)
|
||||
|
||||
if [ "$player_status" = "Playing" ]; then
|
||||
echo " $(playerctl metadata artist) - $(playerctl metadata title)"
|
||||
elif [ "$player_status" = "Paused" ]; then
|
||||
echo " $(playerctl metadata artist) - $(playerctl metadata title)"
|
||||
else
|
||||
echo "" # nothing is playing
|
||||
fi
|
||||
@@ -43,7 +43,8 @@ in {
|
||||
line-size = "3pt";
|
||||
font-0 = "Noto Sans:size=11;1";
|
||||
font-1 = "Hack-Regular.ttf: Hack:style=Regular";
|
||||
font-2 = "Noto Sans CJK JP:style=Regular";
|
||||
font-2 = "HackNerdFont-Regular.ttf: Hack Nerd Font:style=Regular";
|
||||
font-3 = "Noto Sans CJK JP:style=Regular";
|
||||
border-top-size = 0;
|
||||
border-right-size = 0;
|
||||
border-left-size = 0;
|
||||
@@ -52,10 +53,10 @@ in {
|
||||
padding-left = 2;
|
||||
padding-right = 2;
|
||||
module-margin = 1;
|
||||
modules-left = "i3";
|
||||
modules-center = "xwindow";
|
||||
modules-left = "i3 xwindow";
|
||||
modules-center = "";
|
||||
modules-right =
|
||||
"network memory cpu cpu-temp gpu pulseaudio date tray";
|
||||
"music network memory cpu cpu-temp gpu pulseaudio date tray";
|
||||
cursor-click = "pointer";
|
||||
cursor-scroll = "ns-resize";
|
||||
enable-ipc = true;
|
||||
@@ -187,6 +188,14 @@ in {
|
||||
exec = "~/.config/polybar/nvidia.sh";
|
||||
interval = 3;
|
||||
};
|
||||
"module/music" = {
|
||||
type = "custom/script";
|
||||
exec = "~/.config/polybar/player-mpris-simple.sh";
|
||||
interval = 3;
|
||||
"click-left" = "playerctl previous &";
|
||||
"click-right" = "playerctl next &";
|
||||
"click-middle" = "playerctl play-pause &";
|
||||
};
|
||||
# "network-base" = {
|
||||
# type = "internal/network";
|
||||
# interval = 5;
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
{
|
||||
plugins.diffview = {
|
||||
enable = true;
|
||||
};
|
||||
plugins.neogit = {
|
||||
enable = true;
|
||||
integrations = {
|
||||
diffview = true;
|
||||
plugins = {
|
||||
diffview = { enable = true; };
|
||||
neogit = {
|
||||
enable = true;
|
||||
integrations = { diffview = true; };
|
||||
};
|
||||
};
|
||||
plugins.gitsigns = {
|
||||
enable = true;
|
||||
settings = {
|
||||
current_line_blame = true;
|
||||
trouble = true;
|
||||
gitsigns = {
|
||||
enable = true;
|
||||
settings = {
|
||||
current_line_blame = true;
|
||||
trouble = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ in {
|
||||
brightnessctl
|
||||
i3blocks
|
||||
autotiling
|
||||
flameshot
|
||||
pmutils # suspend with pm-suspend
|
||||
lm_sensors # for cpu in polybar
|
||||
feh # sets the wallpaper
|
||||
|
||||
Reference in New Issue
Block a user