diff options
-rw-r--r-- | .config/i3/config | 29 | ||||
-rw-r--r-- | .config/i3blocks/config | 8 | ||||
-rw-r--r-- | .config/nvim/init.vim | 4 | ||||
-rw-r--r-- | .config/shell/profile | 4 | ||||
-rwxr-xr-x | .local/bin/blocks/dunst | 59 |
5 files changed, 86 insertions, 18 deletions
diff --git a/.config/i3/config b/.config/i3/config index f716524..90207a8 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -12,20 +12,22 @@ font pango:monospace 10 set $gi "5" set $go "10" ## i3config variables. + # Totally needed. set $mon2 "HDMI-0" set $mon1 "DP-0" set $dmenu --no-startup-id i3-dmenu-desktop set $term --no-startup-id $TERMINAL - # Really no need in making this variable... set $fmgr $FILE set $ibwsr --no-startup-id $BROWSER set $edit --no-startup-id $EDITOR set $read --no-startup-id $READER set $rstbar pkill -RTMIN+1 $STATUSBAR - set $music --no-startup-id $MUSIC - set $msgs --no-startup-id $MSGCHAT + # Other. set $ss --no-startup-id $SSMGR set $sspath "$HOME/pix/ss/" + set $music --no-startup-id $MUSIC + set $msgs --no-startup-id $MSGCHAT + set $mail --no-startup-id $MAILMGR ## Colors from ~/.Xresources. # set_from_resource $bg background # set_from_resource $fg foreground @@ -52,7 +54,7 @@ font pango:monospace 10 set $ws4 "4: Files" set $ws5 "5: Multimedia" set $ws6 "6: Browser" - set $ws7 "7: Chat" + set $ws7 "7: Messaging" set $ws8 "8: Reader" set $ws9 "9: Gaming" set $ws10 "10: Music" @@ -75,28 +77,24 @@ font pango:monospace 10 # WS5 assign [class="vlc"] $ws5 # WS6 - # The title regex is a negative lookahead. - assign [class="Google-chrome" title="^(?!Save File).*$" title="^(?!GtkFileChooserDialog).*$"] $ws6 + # For a negative regex lookup: "^(?!Save As).*$", for example. + assign [class="firefox"] $ws6 # WS7 - assign [class="TelegramDesktop"] $ws7 + assign [class="Thunderbird"] $ws7 # WS8 # WS9 assign [class="discord"] $ws9 - # assign [class="Discord" window_role="GtkFileChooserDialog"] $ws9 assign [class="Steam" title="steam"] $ws9 + for_window [title="/^Steam$/"] move to workspace $ws9 # WS10 - for_window [class="Spotify"] move to workspace $ws10 -## Window properties for windows. +## Window properties and or behaviour. for_window [class="Yad"] floating enable for_window [class="mogli"] floating enable - # for_window [title="Picture in picture"] resize set 640 360 px, move position 1270 30, move to output $mon1 - for_window [class="Google-chrome" instance="crx_kmfikkopdhmbdbkndkamabamlkkgkpod"] floating enable, resize set 640 360, move position 1270 30, move to output $mon1 # Steam specific. for_window [class="Steam" title="Steam Guard"] floating enable for_window [class="Steam" title="Steam - News"] floating enable for_window [class="Steam" title="Friends List"] floating enable - for_window [title="/^Steam$/"] move to workspace $ws9 ##---i3 color scheme---## # Class bor bgt txt ind chb @@ -158,8 +156,9 @@ client.background $c15 bindsym $mod+Delete exec $term -e htop bindsym $mod+Shift+w exec $ibwsr bindsym $mod+Shift+f workspace $ws4 exec $term -e $fmgr - bindsym $mod+m exec $music - bindsym $mod+Shift+m exec $msgs + # bindsym $mod+m exec $music + # bindsym $mod+Shift+m exec $msgs + bindsym $mod+Shift+m exec $mail # Screenshots. bindsym Print exec $ss gui bindsym $mod+Print exec $ss full -c diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 979a37e..d26d8ec 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -59,3 +59,11 @@ DATEFMT=+%d/%b/%y %H:%M # SHORTFMT=+%H:%M:%S HEIGHT=180 WIDTH=220 + +[dunst] +interval=once +format=json +markup=pango +#min_width=50 +#align=center +#DUNST_MUTE=off diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 746ff2e..0f48c01 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -61,7 +61,8 @@ set showcmd Plug 'vim-scripts/indentpython.vim' " Plug 'jmcantrell/vim-virtualenv' " Plug 'Yggdroot/indentLine' - Plug 'nvie/vim-flake8' + " No longer needed as synstastic includes flake8 linter. + " Plug 'nvie/vim-flake8' " Java Plug 'uiiaoo/java-syntax.vim' @@ -99,6 +100,7 @@ set showcmd hi Normal ctermbg=NONE set encoding=utf-8 set number relativenumber + set cursorline set clipboard+=unnamedplus " Custom colors/highlights diff --git a/.config/shell/profile b/.config/shell/profile index e16322b..5a487ce 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -11,9 +11,9 @@ export BROWSER="firefox" export READER="zathura" export FILE="ranger" export STATUSBAR="i3blocks" -export MUSIC="spotify" +# export MUSIC="spotify" export MAILMGR="thunderbird" -export MSGCHAT="telegram-desktop" +# export MSGCHAT="telegram-desktop" export SSMGR="flameshot" ## ~/ cleanup. diff --git a/.local/bin/blocks/dunst b/.local/bin/blocks/dunst new file mode 100755 index 0000000..6f7ab0c --- /dev/null +++ b/.local/bin/blocks/dunst @@ -0,0 +1,59 @@ +#!/usr/bin/python +""" +A do-not-disturb button for muting Dunst notifications in i3 using i3blocks +Mute is handled by passing 'DUNST_COMMAND_PAUSE' and 'DUNST_COMMAND_RESUME' to +the notify-send script and the 'DUNST_MUTE' environment variable is set to keep +track of the toggle. +""" +import os +import subprocess +import json + + +def mute_on(): + '''Turns off dunst notifications''' + subprocess.run(["notify-send", "DUNST_COMMAND_PAUSE"], check=True) + return { + "full_text":"<span font='Font Awesome 5 Free Solid' color='#BE616E'>\uf1f6</span>", + "DUNST_MUTE":"on" + } + + +def mute_off(): + '''Turns back on dunst notifications''' + subprocess.run(["notify-send", "DUNST_COMMAND_RESUME"], check=True) + return { + "full_text":"<span font='Font Awesome 5 Free Solid' color='#A4B98E'>\uf0f3</span>", + "DUNST_MUTE":"off" + } + + +def clicked(): + '''Returns True if the button was clicked''' + button = "BLOCK_BUTTON" in os.environ and os.environ["BLOCK_BUTTON"] + return bool(button) + + +def muted(): + '''Returns True if Dunst is muted''' + mute = "DUNST_MUTE" in os.environ and os.environ["DUNST_MUTE"] + return mute == 'on' + + +if clicked(): + # toggle button click to turn mute on and off + if muted(): + RTN = mute_off() + else: + RTN = mute_on() + + +else: + # Set default state using 'DUNST_MUTE' environment variable + if muted(): + RTN = mute_on() + else: + RTN = mute_off() + + +print(json.dumps(RTN)) |