mirror of https://github.com/E-Almqvist/dotfiles
parent
fccb3116e8
commit
089464890c
@ -0,0 +1,75 @@ |
||||
// Font stuff |
||||
$font-size: 16px; |
||||
|
||||
// Basic color |
||||
$bg-color: #181818; |
||||
$bg-alt-color: #242424; |
||||
$fg-color: #ebdbb2; |
||||
$fg-alt-color: #635c4b; |
||||
$border-color: #484848; |
||||
|
||||
// Colors |
||||
$black: #121212; |
||||
$red: #f7768c; |
||||
$green: #9ece6a; |
||||
$yellow: #e0af68; |
||||
$blue: #aabbff; |
||||
$magenta: #ad8ee6; |
||||
$cyan: #449dab; |
||||
$white: #787c99; |
||||
|
||||
* { |
||||
all: unset; //Unsets everything so you can style everything from scratch |
||||
font-family: "Hack Mono"; |
||||
// color: $fg-color; |
||||
} |
||||
|
||||
// Bar styles |
||||
.time-thing { |
||||
opacity: 0.2; |
||||
} |
||||
|
||||
.bar-1, .bar-2 { |
||||
background-color: $bg-color; |
||||
color: $fg-color; |
||||
border-right: solid 1px $border-color; |
||||
} |
||||
|
||||
// Styles on classes (see eww.yuck for more information) |
||||
|
||||
button.ws { |
||||
color: $fg-color; |
||||
font-size: $font-size; |
||||
margin: 4px; |
||||
transition: opacity 300ms; |
||||
} |
||||
|
||||
button.ws:hover { |
||||
color: $yellow; |
||||
opacity: 1.0; |
||||
} |
||||
|
||||
.logo { |
||||
margin-top: $font-size; |
||||
font-size: 24px; |
||||
opacity: 0.8; |
||||
|
||||
} |
||||
|
||||
logo:hover { |
||||
color: red; |
||||
} |
||||
|
||||
.workspaces { |
||||
// background-color: $black; |
||||
// border-radius: $font-size; |
||||
// border: 1px solid $border-color; |
||||
} |
||||
|
||||
.ws-active { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.ws-inactive { |
||||
opacity: 0.2; |
||||
} |
@ -0,0 +1,90 @@ |
||||
(defwidget bar [screen] |
||||
(centerbox :orientation "v" |
||||
(box :class "segment-start" :valign "start" |
||||
(logo) |
||||
) |
||||
(box :class "segment-mid" :valign "middle" |
||||
(workspaces :wsp workspaces-data :ori "v") |
||||
) |
||||
(box :class "segment-end" :valign "end" |
||||
;; (music) |
||||
;; (sidestuff) |
||||
;; (volum) |
||||
) |
||||
) |
||||
) |
||||
|
||||
;; Logo |
||||
(defwidget logo [] |
||||
(button :class "logo" |
||||
"Λ" |
||||
)) |
||||
|
||||
;; Workspaces container |
||||
(defwidget workspaces [wsp] |
||||
(box :space-evenly true :spacing 4 :orientation "v" :class "workspaces" |
||||
(for ws in wsp |
||||
(workspace :data ws) |
||||
))) |
||||
|
||||
;; Workspace widget |
||||
(defwidget workspace [data] |
||||
(button :onclick "wmctrl -s ${data['index']}" |
||||
:class {data["iscurrent"] == true ? "ws ws-active" : "ws ws-inactive"} |
||||
"${data['name']}" |
||||
)) |
||||
(deflisten workspaces-data "scripts/workspace.py") |
||||
|
||||
|
||||
(defwidget metric [label value onchange] |
||||
(box :orientation "v" |
||||
:class "metric" |
||||
:space-evenly false |
||||
(box :class "label" label) |
||||
(scale :min 0 |
||||
:max 101 |
||||
;; :orientation "v" |
||||
:active {onchange != ""} |
||||
:value {value == "" ? "0" : value} |
||||
:onchange onchange))) |
||||
|
||||
(defwidget time [] |
||||
(box |
||||
"${time}")) |
||||
(defpoll time :interval "500ms" |
||||
"date '+%H%M.%S %Y-%m-%d'") |
||||
|
||||
;; WINDOWS |
||||
(defwindow bar-1 |
||||
:monitor 0 |
||||
:windowtype "dock" |
||||
:geometry (geometry :x "0%" |
||||
:y "0%" |
||||
:width "42px" |
||||
:height "100%" |
||||
:anchor "left center") |
||||
:reserve (struts :side "left" :distance "42px") |
||||
(bar :screen 1)) |
||||
|
||||
(defwindow bar-2 |
||||
:monitor 1 |
||||
:windowtype "dock" |
||||
:geometry (geometry :x "0%" |
||||
:y "0%" |
||||
:width "42px" |
||||
:height "100%" |
||||
:anchor "left center") |
||||
:reserve (struts :side "left" :distance "42px") |
||||
(bar :screen 2)) |
||||
|
||||
(defwindow time-thing |
||||
:monitor 0 |
||||
:geometry (geometry :x "0%" |
||||
:y "0%" |
||||
:width "182px" |
||||
:height "32px" |
||||
:anchor "right top" |
||||
) |
||||
:reserve (struts :side "right" :distance "0px" :orientation "h") |
||||
(time)) |
||||
|
Binary file not shown.
@ -0,0 +1,20 @@ |
||||
#!/bin/sh |
||||
#source https://github.com/x70b1/polybar-scripts |
||||
|
||||
|
||||
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then |
||||
updates_arch=0 |
||||
fi |
||||
|
||||
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then |
||||
if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then |
||||
updates_aur=0 |
||||
fi |
||||
|
||||
updates=$(("$updates_arch" + "$updates_aur")) |
||||
|
||||
if [ "$updates" -gt 0 ]; then |
||||
echo " $updates" |
||||
else |
||||
echo "0" |
||||
fi |
@ -0,0 +1,20 @@ |
||||
#!/bin/bash |
||||
|
||||
prepend_zero () { |
||||
seq -f "%02g" $1 $1 |
||||
} |
||||
|
||||
artist=$(echo -n $(cmus-remote -C status | grep "tag artist" | cut -c 12-)) |
||||
|
||||
if [[ $artist = *[!\ ]* ]]; then |
||||
song=$(echo -n $(cmus-remote -C status | grep title | cut -c 11-)) |
||||
position=$(cmus-remote -C status | grep position | cut -c 10-) |
||||
minutes1=$(prepend_zero $(($position / 60))) |
||||
seconds1=$(prepend_zero $(($position % 60))) |
||||
duration=$(cmus-remote -C status | grep duration | cut -c 10-) |
||||
minutes2=$(prepend_zero $(($duration / 60))) |
||||
seconds2=$(prepend_zero $(($duration % 60))) |
||||
echo -n "$artist - $song [$minutes1:$seconds1/$minutes2:$seconds2]" |
||||
else |
||||
echo |
||||
fi |
@ -0,0 +1,50 @@ |
||||
#!/bin/bash |
||||
|
||||
# The name of polybar bar which houses the main spotify module and the control modules. |
||||
PARENT_BAR="now-playing" |
||||
PARENT_BAR_PID=$(pgrep -a "polybar" | grep "$PARENT_BAR" | cut -d" " -f1) |
||||
|
||||
# Set the source audio player here. |
||||
# Players supporting the MPRIS spec are supported. |
||||
# Examples: spotify, vlc, chrome, mpv and others. |
||||
# Use `playerctld` to always detect the latest player. |
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control |
||||
PLAYER="spotify" |
||||
|
||||
# Format of the information displayed |
||||
# Eg. {{ artist }} - {{ album }} - {{ title }} |
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata |
||||
FORMAT="{{ title }} - {{ artist }}" |
||||
|
||||
# Sends $2 as message to all polybar PIDs that are part of $1 |
||||
update_hooks() { |
||||
while IFS= read -r id |
||||
do |
||||
polybar-msg -p "$id" hook spotify-play-pause $2 1>/dev/null 2>&1 |
||||
done < <(echo "$1") |
||||
} |
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null) |
||||
EXIT_CODE=$? |
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then |
||||
STATUS=$PLAYERCTL_STATUS |
||||
else |
||||
STATUS="No player is running" |
||||
fi |
||||
|
||||
if [ "$1" == "--status" ]; then |
||||
echo "$STATUS" |
||||
else |
||||
if [ "$STATUS" = "Stopped" ]; then |
||||
echo "No music is playing" |
||||
elif [ "$STATUS" = "Paused" ]; then |
||||
update_hooks "$PARENT_BAR_PID" 2 |
||||
playerctl --player=$PLAYER metadata --format "$FORMAT" |
||||
elif [ "$STATUS" = "No player is running" ]; then |
||||
echo "$STATUS" |
||||
else |
||||
update_hooks "$PARENT_BAR_PID" 1 |
||||
playerctl --player=$PLAYER metadata --format "$FORMAT" |
||||
fi |
||||
fi |
@ -0,0 +1,2 @@ |
||||
#!/bin/sh |
||||
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') |
@ -0,0 +1,2 @@ |
||||
#!/bin/sh |
||||
amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1 |
@ -0,0 +1,20 @@ |
||||
#!/bin/sh |
||||
#source https://github.com/x70b1/polybar-scripts |
||||
|
||||
|
||||
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then |
||||
updates_arch=0 |
||||
fi |
||||
|
||||
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then |
||||
if ! updates_aur=$(yay -Su --aur --quiet | wc -l); then |
||||
updates_aur=0 |
||||
fi |
||||
|
||||
updates=$(("$updates_arch" + "$updates_aur")) |
||||
|
||||
if [ "$updates" -gt 0 ]; then |
||||
echo " $updates" |
||||
else |
||||
echo "0" |
||||
fi |
Loading…
Reference in new issue