#export QT_STYLE_OVERRIDE="kvantum"
export XDG_DATA_DIRS="/usr/local/share/:/usr/share/"
export CM_LAUNCHER=rofi
+export $(dbus-launch)
# Tailoring LESS
# If any syntax highlighters are available, use them.
mount | \grep -E '^[^[:lower:]_-]+' | awk '{print $1,$3,$5}'
) | column -t
}
+
# read user config
USER_CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
USER_CONF="$USER_CONF_DIR/betterlockscreenrc"
+ USER_THEME="$USER_CONF_DIR/betterlockscreen.theme"
SYS_CONF="/etc/betterlockscreenrc"
XDG_USER_CONF_DIR="$USER_CONF_DIR/betterlockscreen"
XDG_USER_CONF="$XDG_USER_CONF_DIR/betterlockscreenrc"
+ XDG_USER_THEME="$XDG_USER_CONF_DIR/betterlockscreen.theme"
if [ -e "$SYS_CONF" ]; then
# shellcheck source=/dev/null
# shellcheck source=/dev/null
source "$USER_CONF"
+ source "$USER_THEME"
fi
if [ -e "$XDG_USER_CONF" ]; then
# shellcheck source=/dev/null
source "$XDG_USER_CONF"
+ source "$XDG_USER_THEME"
fi
if ! cmd_exists "$i3lockcolor_bin"; then
--- /dev/null
+#!/bin/bash
+
+# The name of polybar bar which houses the main spotify module and the control modules.
+PARENT_BAR="bottom"
+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
+
+++ /dev/null
-#! /bin/bash
-
-# uncomment for debug
-# set -x
-
-PID=$$
-PIDFILE=${PIDFILE:-/tmp/wallpaper.pid}
-WAIT_CYCLE="5m"
-INPUT=$1
-
-trap "rm -f $PIDFILE" SIGTERM
-
-WP_SETTER="/usr/bin/feh"
-QARMA="/usr/bin/qarma"
-
-function set_wp() {
- NEW_WP=$1
- $WP_SETTER --bg-fill $NEW_WP
-}
-
-# set background function (requires input)
-function wpapers() {
- if [[ -f $1 ]]; then
- # We have a single file as input
- set_wp $1
- exit 0
- elif [[ -d $1 ]]; then
- # directory as input
- while true; do
- BGIMG=$(find $1 -type f -print | shuf -n1)
- set_wp ${BGIMG}
- sleep $WAIT_CYCLE
- done
- fi
-}
-
-function file_or_dir() {
- if [[ -f /tmp/choice ]]; then
- rm /tmp/choice
- fi
-
- FOD=$($QARMA --list --text="single image or directory?" --hide-header "file" "directory" > /tmp/choice)
- case $? in
- 0 )
- file_chooser $(cat /tmp/choice)
- ;;
- 1 )
- $QARMA --info --title="Exiting!" --text="No wallpaper was changed."
- ;;
- -1 )
- $QARMA --error --title="Ooops!!" --text="Something unexpected happened."
- ;;
- esac
-}
-
-function file_chooser() {
- case $1 in
- "file" )
- FILE="$($QARMA --file-selection --title='Choose your Wallpaper')"
- case $? in
- 0 )
- wpapers $FILE
- ;;
- 1 )
- $QARMA --info --title="Exiting!" --text="No wallpaper was changed."
- ;;
- -1 )
- $QARMA --error --title="Ooops!!" --text="Something unexpected happened."
- esac
- ;;
- "directory" )
- FILE="$($QARMA --file-selection --directory --title='Choose your Wallpaper directory')"
- case $? in
- 0 )
- wpapers $FILE
- ;;
- 1 )
- $QARMA --info --title="Exiting!" --text="No wallpaper was changed."
- ;;
- -1 )
- $QARMA --error --title="Ooops!!" --text="Something unexpected happened."
- esac
- ;;
- * )
- $QARMA --error --title="Ooops!!" --text="Something unexpected happened."
- ;;
- esac
-}
-
-function run() {
- if [[ $(basename $0) == "wallpaper.sh" ]]; then
- # we were called as wallpaper.sh, so simple wallpaper setter without qarma interaction
- wpapers "$1"
- elif [[ $(basename $0) == "change_wallpaper.sh" ]]; then
- # we use qarma to set the wallpaper
- $QARMA --question --title="Change Wallpaper" --text="Do you want to change the wallpaper?"
- case $? in
- 0 )
- file_or_dir
- ;;
- 1 )
- $QARMA --info --title="Exiting!" --text="No wallpaper was changed."
- ;;
- -1 )
- $QARMA --error --title="Ooops!!" --text="Something unexpected happened."
- esac
- fi
-}
-
-if [[ -r $PIDFILE ]]; then
- # PIDFILE exists, so I guess there's already an instance running
- # let's kill it and run again
- kill -s 15 $(cat $PIDFILE) > /dev/null 2>&1
- # should already be deleted by trap, but just to be sure
- rm /tmp/choice || true
- rm $PIDFILE
-fi
-
-# create PIDFILE
-echo $PID > $PIDFILE
-
-if [[ ! -z $1 ]]; then
- run $1
-else
- run
-fi
-
--- /dev/null
+# ~/.config/betterlockscreenrc
+
+# default options
+display_on=0
+span_image=false
+lock_timeout=300
+#fx_list=(dim blur dimblur pixel dimpixel color)
+fx_list=(blur)
+dim_level=40
+blur_level=1
+pixel_scale=10,1000
+solid_color=333333
+wallpaper_cmd="feh --bg-fill"
+quiet=false
+
+# default theme moved to betterlockscreen.theme
+# inside this same directory
+
+#
+# expert options (change at own risk!)
+#
+
+# i3lockcolor_bin="i3lock-color" # Manually set command for i3lock-color
+# suspend_command="systemctl suspend" # Manually change action e.g. hibernate/suspend-command
+
+# i3lock-color - custom arguments
+# lockargs=() # overwriting default "(-n)"
+# lockargs+=(--ignore-empty-password) # appending new argument
# Alt+Return Alt+h Ctrl+Win+r Alt+w #
# #
# #
-# Ctrl+F1 Ctrl+F1 Ctrl+F1 Ctrl+F1 #
+# Ctrl+F1 Ctrl+F2 Ctrl+F3 Ctrl+F4 #
# #
# #
# #
floating_modifier $win
# start a terminal
-# macropad 5
-bindsym $alt+Return exec --no-startup-id kitty
-# macropad Shift+5
-bindsym Shift+$alt+Return exec --no-startup-id blackpearl-sshmenu.sh
-# custom binding
-# macropad 4
+#### MACROPAD top encoder
+# multimedia binding
+bindsym XF86AudioMute exec --no-startup-id dunst_vol_brig.sh mute
+bindsym XF86AudioLowerVolume exec --no-startup-id dunst_vol_brig.sh vol_d
+bindsym XF86AudioRaiseVolume exec --no-startup-id dunst_vol_brig.sh vol_u
+# MACROPAD bottom encoder
+bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
+bindsym XF86AudioPrev exec --no-startup-id playerctl previous
+bindsym XF86AudioNext exec --no-startup-id playerctl next
+
+# brightness bindings
+# MACROPAD Alt + top encoder
+bindsym $alt+XF86AudioLowerVolume exec --no-startup-id dunst_vol_brig.sh brig_d
+bindsym $alt+XF86AudioRaiseVolume exec --no-startup-id dunst_vol_brig.sh brig_u
+
+#### MACROPAD 1
+bindsym $win+w exec $browser
+#### MACROPAD Shift+1
+bindsym $win+Shift+w exec $incognito-browser
+#### MACROPAD 2
+bindsym $win+r exec $prog-editor
+#### MACROPAD Shift+2
+bindsym $win+Shift+r exec Typora
+#### MACROPAD 3
+bindsym $win+g exec gimp
+#### MACROPAD 4
bindsym Shift+$ctrl+l exec --no-startup-id clipmenu -no-lazy-grab -show run -theme darknix/notes
-# macropad Shift+4
+#### MACROPAD Shift+4
bindsym $alt+Shift+$ctrl+l exec --no-startup-id xclip -o | qrencode -o - | feh -Z -
+#### MACROPAD 5
+bindsym $alt+Return exec --no-startup-id kitty
+#### MACROPAD Shift+5
+bindsym Shift+$alt+Return exec --no-startup-id blackpearl-sshmenu.sh
+#### MACROPAD 6
+# split in horizontal orientation
+bindsym $alt+h exec notify-send 'splitting windows horizontally';split h
+# split in vertical orientation
+bindsym Shift+$alt+h exec notify-send 'splitting windows vertically';split v
+#### MACROPAD 7
+bindsym $win+Ctrl+r exec notify-send 'Resize Mode';mode "resize"
+#### MACROPAD 8
+# change container layout (stacked, tabbed, toggle split)
+bindsym $alt+w exec notify-send 'layout tabbed';layout tabbed
+bindsym Shift+$alt+w exec notify-send 'layout stacking';layout stacking
+bindsym Ctrl+$alt+w exec notify-send 'layout split';layout toggle split
+#### custom bindings
bindsym Shift+$win+s exec --no-startup-id blackpearl-scrotmenu.sh
bindsym $alt+Menu exec --no-startup-id qwalwal.sh
bindsym $win+period exec --no-startup-id blackpearl-emoji.sh
bindsym XF86Search exec --no-startup-id blackpearl-appsmenu.sh
bindsym $alt+Escape --release exec xkill
bindsym $win+e exec pcmanfm-qt
-
-# macropad 3
-bindsym $win+g exec gimp
-
-bindsym $win+l exec --no-startup-id betterlockscreen -l
-
-# macropad 1
-bindsym $win+w exec $browser
-# macropad Shift+1
-bindsym $win+Shift+w exec $incognito-browser
-
-bindsym XF86Calculator exec kcalc
-bindsym XF86Sleep exec i3suspend
-# macropad 2
-bindsym $win+r exec $prog-editor
-# macropad Shift+2
-bindsym $win+Shift+r exec Typora
-
-bindsym XF86HomePage exec --no-startup-id blackpearl-appsmenu.sh
-#bindsym $win+p exec uxterm -T "spt" -geometry 90x30+800+30 -e spt
+bindsym $win+l exec --no-startup-id betterlockscreen -l blur
bindsym $win+m exec Telegram
+bindsym XF86Calculator exec kcalc
+# start rofi in dmenu mode (a program launcher)
+bindsym $alt+F2 exec --no-startup-id blackpearl-runner.sh
+# Set shut down, restart and locking features
+bindsym $win+x exec --no-startup-id blackpearl-powermenu.sh
# notes bindings
bindsym $ctrl+F5 exec --no-startup-id blackpearl-notes.sh -a
#bindsym $alt+Tab exec --no-startup-id "killall -s SIGUSR1 i3expod"
#bindsym $alt+Ctrl+Tab exec --no-startup-id "blackpearl-window.sh all"
-# multimedia binding
-# macropad top encoder
-bindsym XF86AudioMute exec --no-startup-id dunst_vol_brig.sh mute
-bindsym XF86AudioLowerVolume exec --no-startup-id dunst_vol_brig.sh vol_d
-bindsym XF86AudioRaiseVolume exec --no-startup-id dunst_vol_brig.sh vol_u
-# macropad bottom encoder
-bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
-bindsym XF86AudioPrev exec --no-startup-id playerctl previous
-bindsym XF86AudioNext exec --no-startup-id playerctl next
-
-# brightness bindings
-# macropad Alt + top encoder
-bindsym $alt+XF86AudioLowerVolume exec --no-startup-id dunst_vol_brig.sh brig_d
-bindsym $alt+XF86AudioRaiseVolume exec --no-startup-id dunst_vol_brig.sh brig_u
# kill focused window
#bindsym $ctrl+Shift+q kill
-bindsym --whole-window $alt+button2 kill
+bindsym --whole-window $alt+button3 kill
# restart polybar
-# macropad Alt + bottom encoder
-bindsym $alt+XF86AudioPlay exec --no-startup-id polybar-msg cmd restart
+# MACROPAD Alt + bottom encoder
+bindsym $alt+XF86AudioPlay exec --no-startup-id run-polybar.sh
-# start rofi in dmenu mode (a program launcher)
-bindsym $alt+F2 exec --no-startup-id blackpearl-runner.sh
# change focus
bindsym $alt+j focus left
bindsym $alt+Shift+Up move up
bindsym $alt+Shift+Right move right
-# split in horizontal orientation
-bindsym $alt+h exec notify-send 'splitting windows horizontally';split h
-# split in vertical orientation
-bindsym Shift+$alt+h exec notify-send 'splitting windows vertically';split v
-
# enter fullscreen mode for the focused container
bindsym $alt+f fullscreen toggle
-# change container layout (stacked, tabbed, toggle split)
-bindsym $alt+w exec notify-send 'layout tabbed';layout tabbed
-bindsym Shift+$alt+w exec notify-send 'layout stacking';layout stacking
-bindsym Ctrl+$alt+w exec notify-send 'layout split';layout toggle split
-
# toggle tiling / floating
bindsym $alt+Shift+space floating toggle
workspace $ws2 gaps inner 0
workspace $ws5 gaps inner 0
-# Set shut down, restart and locking features
-bindsym $win+x exec --no-startup-id blackpearl-powermenu.sh
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym Escape exec notify-send 'Resize Mode OFF';mode "default"
}
-bindsym $win+Ctrl+r exec notify-send 'Resize Mode';mode "resize"
-
set $wine_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $wine_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $win+Shift+g mode "$wine_gaps"
# start both polybar
exec_always --no-startup-id $HOME/bin/run-polybar.sh
+
+exec_always --no-startup-id playerctld daemon
+
separator-foreground = ${colors.secondary}
font-0 = "Inconsolata Nerd Font:weight=regular;2"
padding = 1px
-modules-left = duckstation dunst-snooze
-modules-center = windowlist
+modules-left = duckstation dunst-snooze windowlist
+modules-center = spotify spotify-prev spotify-play-pause spotify-next
modules-right = date
dpi = 96
enable-ipc = true
# windowlist
include-file = /home/danix/.config/polybar/modules/windowlist.ini
+# spotify
+include-file = /home/danix/.config/polybar/modules/spotify.ini
--- /dev/null
+[module/spotify]
+type = custom/script
+tail = true
+interval = 1
+format-prefix = " "
+format = <label>
+exec = ~/bin/get_spotify_status.sh
+
+[module/spotify-prev]
+type = custom/script
+exec = echo " "
+format = <label>
+click-left = playerctl previous -p spotify
+
+[module/spotify-play-pause]
+type = custom/ipc
+hook-0 = echo " "
+hook-1 = echo " "
+initial = 1
+click-left = playerctl play-pause -p spotify
+
+[module/spotify-next]
+type = custom/script
+exec = echo " "
+format = <label>
+click-left = playerctl next -p spotify
--- /dev/null
+# default theme
+loginbox={background.strip}66
+loginshadow={background.strip}00
+locktext="Se na sai dassa stari..."
+font="Inconsolata Nerd Font"
+ringcolor={foreground.strip}ff
+insidecolor={background.strip}00
+separatorcolor={background.strip}00
+ringvercolor={foreground.strip}ff
+insidevercolor={background.strip}00
+ringwrongcolor={color4.strip}ff
+insidewrongcolor={color4.strip}ff
+timecolor={foreground.strip}ff
+time_format="%H:%M:%S"
+greetercolor={foreground.strip}ff
+layoutcolor={foreground.strip}ff
+keyhlcolor={color4.strip}ff
+bshlcolor={color4.strip}ff
+veriftext="Vidimu..."
+verifcolor={foreground.strip}ff
+wrongtext="A cacasti!!!"
+wrongcolor={foreground.strip}ff
+modifcolor={color4.strip}ff
+bgcolor={background.strip}ff
# Start i3
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
- exec ck-launch-session dbus-launch --exit-with-session /usr/bin/i3
+ exec ck-launch-session dbus-launch --autolaunch=$(cat /var/lib/dbus/machine-id) --exit-with-session /usr/bin/i3
else
- exec /usr/bin/i3
+ exec dbus-launch --autolaunch=$(cat /var/lib/dbus/machine-id) --exit-with-session /usr/bin/i3
fi