updated workspaces to use concise names, added a spotify unit to poly bar and a todo display that can be cycled

nvim
spinach 2 years ago
parent b0e5903679
commit e060df6c3d

4
\

@ -0,0 +1,4 @@
#!/usr/bin/env bash
calendar=$(calcurse --todo=1 | tail -n +2 | cut -d '1. ')
echo "$calendar"

@ -15,6 +15,10 @@ else
echo "st"
elif [ "$WM_CLASS" == "Brave-browser" ] ; then
echo "Brave"
elif [ "$WM_CLASS" == "Spotify" ] ; then
echo "Spotify"
elif [ "$WM_CLASS" == "Zathura" ] ; then
echo "Zathura"
else
echo "$WM_NAME"
fi

@ -1,6 +1,6 @@
#!/usr/bin/env bash
if [[ "$1" == "--toggle" ]] ; then
if [ "$1" == '--toggle' ]; then
playerctl play-pause
fi
@ -12,7 +12,7 @@ if [[ "$1" == "--scroll" ]] ; then
--match-command "playerctl status" \
--match-text "Playing" "--scroll 1" \
--match-text "Paused" "--scroll 0" \
"playerctl metadata --format '{{artist}} - {{title}}'" &
"playerctl metadata -s --format '{{artist}} - {{title}}'" &
wait
fi

@ -0,0 +1,28 @@
#!/usr/bin/env bash
calindx="$HOME/.local/share/calcurse/.env"
todoitems=$(calcurse --todo=1 --format-todo="%m\n"| tail -n +2 )
readarray -t todolist <<<$todoitems
# get index
if [[ ! -f "$calindx" ]] ; then
echo "INDEX=0" > "$calindx"
fi
source "$calindx"
if [[ "$1" == "inc" ]] ; then
((INDEX+=1))
if [[ $INDEX -ge ${#todolist[@]} ]] ; then
INDEX=0 # loops
fi
fi
if [[ "$1" == "dec" ]] ; then
((INDEX-=1))
if [[ $INDEX -lt 0 ]] ; then
INDEX=$((${#todolist[@]}-1))
fi
fi
echo "INDEX=$INDEX" > "$calindx"
printf '%s (%d/%d)\n' "${todolist[$INDEX]}" $(($INDEX+1)) ${#todolist[@]}

@ -23,7 +23,6 @@ smart_gaps on
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
workspace 1 output DP-2
@ -39,7 +38,14 @@ exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-blur --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
#exec --no-startup-id nm-applet
# loading layout
assign [class="st-256color"] 1
assign [class="Brave-browser"] 2
exec --no-startup-id st -e tmux
exec --no-startup-id brave
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
@ -51,10 +57,6 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
#set tiling_drag modifier titlebar
# start a terminal
bindsym $mod+Return exec st
@ -66,17 +68,25 @@ bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec --no-startup-id rofi-launcher
# A more modern dmenu replacement is rofi:
# setting up a vimscratch pad to use vimwiki
for_window [instance="todo"] move window to scratchpad
for_window [instance="cal"] move window to scratchpad
exec --no-startup-id st -n todo -e vim ~/vimwiki/todo/index.md
exec --no-startup-id st -n cal -e calcurse
bindsym $mod+s [instance="todo"] scratchpad show
bindsym $mod+c [instance="cal"] scratchpad show
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
@ -97,16 +107,16 @@ bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
#bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
#bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
# bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
@ -174,10 +184,10 @@ mode "resize" {
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
@ -199,9 +209,9 @@ bindsym $mod+r mode "resize"
#status_command
# }
exec_always --no-startup-id picom-launch.sh
exec --no-startup-id picom-launch.sh
# background
exec_always --no-startup-id feh --bg-scale ~/.config/i3/wallpaper.jpg
exec --no-startup-id feh --bg-scale ~/.config/i3/wallpaper.jpg
# poly bar
exec_always --no-startup-id polybar-launch.sh desktop-bar

@ -1,7 +1,8 @@
[colors]
background = #1D1F21
background = #001D1F21
background-alt = #373B41
foreground = #C5C8C6
#foreground = #C5C8C6
foreground = #DDD
primary = #F0C674
secondary = #8ABEB7
disabled = #707880
@ -44,7 +45,8 @@ inherit = section/base-bar
; height
height = 24pt
; modules
modules-left = xworkspaces focus spotify spotify-len
modules-left = xworkspaces focus spotify spotify-len todo
;modules-left = xworkspaces spotify spotify-len
modules-center = weather-desktop
modules-right = pulseaudio memory cpu temperature eth seafile date powermenu
@ -71,7 +73,7 @@ format = <label-state>
[module/focus]
; correct title size
type = custom/script
interval = 0
interval = 0.2
exec = ~/.dotfiles/bin/focus_class
[module/pulseaudio]
@ -208,11 +210,16 @@ click-right = rofi-music
[module/spotify-len]
; playerctl interaction for spotify
type = custom/script
tail = true
interval = 1
exec = playerctl metadata --format '{{duration(position)}}/{{duration(mpris:length)}}'
exec = playerctl metadata -s --format '{{duration(position)}}/{{duration(mpris:length)}}'
[module/todo]
; uses calcurse to cycle through todo items
type = custom/script
interval = 1
exec = todo_display.sh
click-left = todo_display.sh inc
click-right = todo_display.sh dec
[settings]
screenchange-reload = true

@ -8,6 +8,7 @@
- link:
~/.local/bin/ssh_agent_check: bin/ssh_agent_check
~/.local/bin/poly_spotify: bin/poly_spotify
~/.local/bin/todo_display.sh: bin/todo_display.sh
~/.local/bin/display_uptime: bin/display_uptime
~/.local/bin/docker_check: bin/docker_check
~/.local/bin/seafile_check: bin/seafile_check

@ -25,7 +25,7 @@ general.confirmdelete=yes
general.confirmquit=yes
general.firstdayofweek=monday
general.multipledays=yes
general.periodicsave=0
general.periodicsave=10
general.systemevents=yes
notification.command=printf '\a'
notification.notifyall=flagged-only

Loading…
Cancel
Save