Slowly moving to Sway instead of i3

This commit is contained in:
Jesper Fussing Mørk 2019-03-29 10:32:11 +01:00
parent 501b0dbbb7
commit e147fb0447
37 changed files with 920 additions and 32 deletions

View File

@ -158,7 +158,7 @@ eval "$(pipenv --completion)"
PS1='\[\e[1;32m\u@\h \e[1;34m\w\]\n\[\e[1;33m\]$(__git_ps1 "(%s) ")\[\e[m\]⇨ ' PS1='\[\e[1;32m\u@\h \e[1;34m\w\]\n\[\e[1;33m\]$(__git_ps1 "(%s) ")\[\e[m\]⇨ '
#Disable CapsLock #Disable CapsLock
setxkbmap -option ctrl:nocaps #setxkbmap -option ctrl:nocaps
#Disable some CTRL for VIM commands #Disable some CTRL for VIM commands
bind -r '\C-s' bind -r '\C-s'
@ -166,6 +166,7 @@ stty -ixon
stty -echoctl stty -echoctl
#Paths #Paths
export _JAVA_AWT_WM_NONREPARENTING=1
export M2_HOME=/home/jfm/Tools/apache-maven export M2_HOME=/home/jfm/Tools/apache-maven
export PATH=$PATH:$M2_HOME/bin:/home/jfm/Tools/openshift-origin-client/:/home/jfm/Tools/aws/ export PATH=$PATH:$M2_HOME/bin:/home/jfm/Tools/openshift-origin-client/:/home/jfm/Tools/aws/
export GIT_EDITOR=nvim export GIT_EDITOR=nvim

View File

@ -121,7 +121,7 @@ set $ws3 3:
set $ws4 4: set $ws4 4:
set $ws5 5: set $ws5 5:
set $ws6 6: set $ws6 6:
set $ws7 7: set $ws7 7:
set $ws8 8: set $ws8 8:
set $ws9 9: set $ws9 9:
set $ws10 10: set $ws10 10:

View File

@ -91,8 +91,8 @@
"percent": 0.35, "percent": 0.35,
"swallows": [ "swallows": [
{ {
"class": "^Google Play Music Desktop Player$", "class": "^Spotify$",
"instance": "^google play music desktop player$" "instance": "^spotify$"
} }
], ],
"type": "con" "type": "con"

View File

@ -1,15 +1,19 @@
#!/bin/bash #!/bin/bash
if [[ $(iwgetid -r) = *adazio* ]]; connected_displays=$(xrandr | grep -v disconnected | grep connected | wc -l)
#echo $connected_displays
if [[ $connected_displays = 3 ]];
then then
echo "WORK"
~/.config/i3/scripts/work-monitors.sh & ~/.config/i3/scripts/work-monitors.sh &
~/.config/i3/scripts/work-layout.sh & ~/.config/i3/scripts/work-layout.sh &
fi fi
if [[ $(iwgetid -r) = *moerks.dk* ]]; if [[ $connected_displays = 2 ]];
then then
~/.config/i3/scripts/home-monitors.sh & ~/.config/i3/scripts/home-monitors.sh &
sleep 5
~/.config/i3/scripts/home-layout.sh & ~/.config/i3/scripts/home-layout.sh &
echo "HOME"
fi fi
sleep 1 sleep 1
@ -30,4 +34,4 @@ i3-msg "workspace 8:; move workspace to output $SECONDARY"
i3-msg "workspace 9:; move workspace to output $SECONDARY" i3-msg "workspace 9:; move workspace to output $SECONDARY"
i3-msg "workspace 10:; move workspace to output $SECONDARY" i3-msg "workspace 10:; move workspace to output $SECONDARY"
exit exit 0

View File

@ -7,7 +7,7 @@ then
i3-msg "workspace 9:; exec termite -t newsboat -e newsboat --hold" i3-msg "workspace 9:; exec termite -t newsboat -e newsboat --hold"
i3-msg "workspace 9:; exec termite -t bark -d '/home/jfm/Repositories/bark' -e 'pipenv run python Bark.py' --hold" i3-msg "workspace 9:; exec termite -t bark -d '/home/jfm/Repositories/bark' -e 'pipenv run python Bark.py' --hold"
i3-msg "workspace 9:; exec termite -t rtv -e 'rtv --enable-media --theme default' --hold" i3-msg "workspace 9:; exec termite -t rtv -e 'rtv --enable-media --theme default' --hold"
i3-msg "workspace 9:; exec gpmdp" i3-msg "workspace 9:; exec spotify"
i3-msg "workspace 9:; move workspace to output $PRIMARY" i3-msg "workspace 9:; move workspace to output $PRIMARY"
else else
i3-msg "workspace 9:; append_layout ~/.config/i3/layouts/workspace9-news.json" i3-msg "workspace 9:; append_layout ~/.config/i3/layouts/workspace9-news.json"

7
mako/.config/mako/config Normal file
View File

@ -0,0 +1,7 @@
default-timeout=3000
anchor=bottom-right
format=%a\n%b\n%s
border-size=0
background-color=#5E81ACFF
text-color=#D8DEE9FF

View File

@ -0,0 +1,17 @@
set mail_check=30
set timeout=15
set imap_user=jfm@doel.dk
set imap_pass=s89YA7vAkTXakps
set folder=imaps://mail.unoeuro.com/
set spoolfile=+INBOX
set realname = 'Jesper Fussing Mørk'
set from = jfm@doel.dk
set use_from = yes
set smtp_url=smtps://$imap_user:$imap_pass@asmtp.unoeuro.com
set ssl_force_tls = yes
alternative_order text/plain text/html
auto_view text/html

View File

@ -13,6 +13,8 @@ set autoread
set hidden set hidden
set background=dark set background=dark
set rtp^=/usr/share/vim/vimfiles/ set rtp^=/usr/share/vim/vimfiles/
set undodir=~/.local/share/nvim/undodir
set undofile
"Plugins "Plugins
call plug#begin('~/.local/share/nvim/plugged') call plug#begin('~/.local/share/nvim/plugged')
@ -20,7 +22,9 @@ Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdcommenter'
Plug 'Valloric/YouCompleteMe' Plug 'Shougo/deoplete.nvim'
Plug 'zchee/deoplete-jedi'
"Plug 'Valloric/YouCompleteMe'
Plug 'vim-syntastic/syntastic' Plug 'vim-syntastic/syntastic'
Plug 'luochen1990/rainbow' Plug 'luochen1990/rainbow'
Plug 'numirias/semshi' Plug 'numirias/semshi'
@ -45,14 +49,17 @@ let g:Powerline_symbols='unicode'
let g:airline_theme='nord' let g:airline_theme='nord'
"YCM "YCM
let mapleader = " "let mapleader = \"½\"
let g:ycm_server_python_interpreter = 'python3' "let g:ycm_server_python_interpreter = 'python3'
let g:ycm_autoclose_preview_window_after_completion=1 "let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_min_num_of_chars_for_completion=3 "let g:ycm_min_num_of_chars_for_completion=3
let g:ycm_add_preview_to_completeopt = 1 "let g:ycm_add_preview_to_completeopt = 1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR> "map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" " Deoplete
let g:deoplete#enable_at_startup = 1
" Syntastic
let g:syntastic_python_checkers = ['python'] let g:syntastic_python_checkers = ['python']
"Rainbow Parentheses "Rainbow Parentheses
@ -65,6 +72,7 @@ let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" NerdTree " NerdTree
map <M-1> :NERDTreeToggle<CR> map <M-1> :NERDTreeToggle<CR>
map <M-2> :NERDTreeFocus<CR>
let g:NERDTreeWinSize=40 let g:NERDTreeWinSize=40
let NERDTreeShowBookmarks=1 let NERDTreeShowBookmarks=1
let NERDTreeMinimalUI=1 let NERDTreeMinimalUI=1

View File

@ -103,7 +103,7 @@ font-1 = FontAwesome:pixelsize=12;1
modules-left = i3 modules-left = i3
modules-center = modules-center =
modules-right = gpmdp spotify modules-right = spotify
[bar/laptop] [bar/laptop]
monitor = ${env:LAPTOP} monitor = ${env:LAPTOP}
@ -144,7 +144,7 @@ ws-icon-3 = 3:;
ws-icon-4 = 4:; ws-icon-4 = 4:;
ws-icon-5 = 5:; ws-icon-5 = 5:;
ws-icon-6 = 6:; ws-icon-6 = 6:;
ws-icon-7 = 7:; ws-icon-7 = 7:;
ws-icon-8 = 8:; ws-icon-8 = 8:;
ws-icon-9 = 9:; ws-icon-9 = 9:;
ws-icon-10 = 10:; ws-icon-10 = 10:;

View File

@ -1,22 +1,15 @@
! rofi.eh: 1
! rofi.line-margin: 15
!rofi.location: 4
!rofi.font: SanFranciscoDisplay-Regular 20
! rofi.levenshtein-sort: true
! rofi.sidebar-mode: true
! rofi.auto-select: true
rofi.fullscreen: false rofi.fullscreen: false
rofi.separator-style: dash rofi.separator-style: dash
rofi.hide-scrollbar: true rofi.hide-scrollbar: true
rofi.padding: 50 rofi.padding: 20
rofi.bw: 0 rofi.bw: 0
rofi.lines: 10 rofi.lines: 10
rofi.line-padding: 10 rofi.line-padding: 5
rofi.font: Source Code Pro for Powerline 15 rofi.font: Source Code Pro for Powerline 12
rofi.show-icons: true rofi.show-icons: true
! Window 'background''border' 'separator' ! Window 'background''border' 'separator'
rofi.color-window: #A65E81AC, #00000000, #268bd2 rofi.color-window: #FF5E81AC, #00000000, #268bd2
! State 'bg', 'fg', 'altbg', 'hlbg', 'hlfg' ! State 'bg', 'fg', 'altbg', 'hlbg', 'hlfg'
rofi.color-normal: #00000000, #D8DEE9, #00000000, #00000000, #8FBCBB rofi.color-normal: #00000000, #D8DEE9, #00000000, #00000000, #8FBCBB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

19
rofi/.config/rofi/wifi Normal file
View File

@ -0,0 +1,19 @@
# Config for rofi-wifi-menu
# position values:
# 1 2 3
# 8 0 4
# 7 6 5
POSITION=0
#y-offset
YOFF=17
#x-offset
XOFF=0
#fields to be displayed
FIELDS=SSID,SECURITY,BARS
#font
FONT="Source Code Pro for Powerline 15"

View File

@ -25,9 +25,9 @@
# Feh is a simple and effective image viewer # Feh is a simple and effective image viewer
# Note that rtv returns a list of urls for imgur albums, so we don't put quotes # Note that rtv returns a list of urls for imgur albums, so we don't put quotes
# around the `%s` # around the `%s`
image/x-imgur-album; feh --scale-down --auto-zoom %s; test=test -n "$DISPLAY" image/x-imgur-album; curl %s | imv -; test=test -n "$DISPLAY"
image/gif; mpv '%s' --autofit-larger 1024x768 --loop=inf; test=test -n "$DISPLAY" image/gif; mpv '%s' --autofit-larger 1024x768 --loop=inf; test=test -n "$DISPLAY"
image/*; feh --scale-down --auto-zoom '%s'; test=test -n "$DISPLAY" image/*; curl '%s' | imv -; test=test -n "$DISPLAY"
# Youtube videos are assigned a custom mime-type, which can be streamed with # Youtube videos are assigned a custom mime-type, which can be streamed with
# vlc or youtube-dl. # vlc or youtube-dl.
@ -68,3 +68,6 @@ video/*; mpv '%s' --autofit-larger 1024x768 --loop=inf; test=test -n "$DISPLAY"
# Ascii videos # Ascii videos
# video/x-youtube; youtube-dl -q -o - '%s' | mplayer -cache 8192 -vo caca -quiet -; needsterminal # video/x-youtube; youtube-dl -q -o - '%s' | mplayer -cache 8192 -vo caca -quiet -; needsterminal
# video/*; wget '%s' -O - | mplayer -cache 8192 -vo caca -quiet -; needsterminal # video/*; wget '%s' -O - | mplayer -cache 8192 -vo caca -quiet -; needsterminal
#
text/html; /usr/bin/google-chrome-stable '--app=file://%s' &> /dev/null & sleep 1; test=test -n "$DISPLAY"; nametemplate=%s.html; needsterminal
text/html; w3m %s; nametemplate=%s.html; copiousoutput

185
sway/.config/sway/config Normal file
View File

@ -0,0 +1,185 @@
# Input Config
input * xkb_layout "dk"
input * xkb_variant "nodeadkeys"
input * xkb_options "grp:menu_toggle,caps:none"
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4
# Configure border style <normal|1pixel|pixel xx|none|pixel>
new_window none
default_border pixel 2
#new_window pixel 0
#new_float normal
new_float none
# Hide borders
hide_edge_borders none
# change borders
bindsym $mod+u border none
bindsym $mod+y border pixel 2
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font xft:DejaVu Sans Mono for Powerline 14
font xft:Source Code Pro for Powerline 14
# Use Mouse+$mod to drag floating windows
floating_modifier $mod
# start a terminal
#bindsym $mod+Return exec termite
bindsym $mod+Return exec termite
# kill focused window
bindsym $mod+Shift+q kill
# Start rofi program launcher
bindsym $mod+d exec --no-startup-id rofi -show drun -config ~/.config/rofi/config
# Start Rofi Wifi Menu
bindsym $mod+n exec rofi-wifi-menu
# Start Applications
bindsym $mod+Shift+d --release exec "killall mako; exec notify-send 'restart mako'"
bindsym Print exec --no-startup-id scrot '%Y-%m-%d_$wx$h_scrot.png' -e 'mv $f ~/Pictures/screenshots/'
bindsym $mod+Print --release exec --no-startup-id scrot -u '%Y-%m-%d_$wx$h_scrot.png' -e 'mv $f ~/Pictures/screenshots/'
bindsym $mod+Shift+Print --release exec --no-startup-id scrot -s '%Y-%m-%d_$wx$h_scrot.png' -e 'mv $f ~/Pictures/screenshots/'
# Music Control
bindsym $mod+Ctrl+Mod1+9 exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
bindsym $mod+Ctrl+Mod1+0 exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"
bindsym $mod+Ctrl+Mod1+8 exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"
# focus_follows_mouse no
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Resize help
bindsym $mod+Ctrl+Shift+Right resize shrink width 1 px or 1 ppt
bindsym $mod+Ctrl+Shift+Up resize grow height 1 px or 1 ppt
bindsym $mod+Ctrl+Shift+Down resize shrink height 1 px or 1 ppt
bindsym $mod+Ctrl+Shift+Left resize grow width 1 px or 1 ppt
# workspace back and forth (with/without active container)
workspace_auto_back_and_forth no
bindsym $mod+b workspace back_and_forth
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
# split orientation
bindsym $mod+h split h;exec notify-send -u low -a "Sway" "Tile Horizontally"
bindsym $mod+v split v;exec notify-send -u low -a "Sway" "Tile Vertically"
bindsym $mod+q split toggle
# toggle 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+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# Scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
#navigate workspaces next / previous
bindsym $mod+Ctrl+Right workspace next
bindsym $mod+Ctrl+Left workspace prev
# Workspace names
set $ws1 1:
set $ws2 2:
set $ws3 3:
set $ws4 4:
set $ws5 5:
set $ws6 6:
set $ws7 7:
set $ws8 8:
set $ws9 9:
set $ws10 10:
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# Move to workspace with focused container
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10; workspace $ws10
# Open specific applications in floating mode
for_window [class="^.*"] border pixel 2
for_window [class="mpv"] floating enable sticky enable border none
for_window [class="Google-chrome" instance="tmp_neomutt.html"] floating enable, sticky enable, border pixel 2, resize set 1024px 768px
# reload the configuration file
bindsym $mod+Shift+c reload
# Lock screen
bindsym $mod+l exec swaylock -i ~/.config/sway/wallpapers/stars_3840x2160.jpg -s stretch --indicator-radius 100 --indicator-thickness 20
# Theme colors
# class border backgr. text indic #childborder
client.focused #5E81AC #556064 #80FFF9 #b58900 #5E81AC
client.focused_inactive #2E3440 #2E3440 #1ABC9C #454948 #2E3440
client.unfocused #2E3440 #2E3440 #1ABC9C #454948 #2E3440
client.urgent #2E3440 #FDF6E3 #1ABC9C #268BD2 #2E3440
client.placeholder #000000 #0c0c0c #ffffff #000000 #2E3440
client.background #2B2C2B #0c0c0c #ffffff #000000 #2E3440
#############################
### settings for i3-gaps: ###
#############################
# Set inner/outer gaps
gaps inner 10
gaps outer -4
# Smart gaps (gaps used if only more than one container on the workspace)
smart_gaps on
smart_borders on
#### Exit Menu
set $exitmenu "system: [r]eboot [s]hutdown"
mode $exitmenu {
bindsym r exec shutdown -r now
bindsym s exec shutdown -P now
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+backspace mode $exitmenu
#### Custom Config
exec /home/jfm/.config/sway/scripts/start_layout.sh
exec mako

View File

@ -0,0 +1,17 @@
#!/bin/bash
CONNECTED_CMD="swaymsg -t get_outputs | jq -c '. | length'"
monitors=`eval $CONNECTED_CMD`
echo $monitors
if [[ $monitors = 3 ]];
then
echo "WORK"
~/.config/sway/scripts/work-sway.sh &
fi
if [[ $monitors = 2 ]];
then
echo "HOME"
~/.config/sway/scripts/home-sway.sh &
fi
exit 0

View File

@ -0,0 +1,11 @@
#!/bin/bash
swaymsg output DP-5 enable
swaymsg output eDP-1 disable
swaymsg output DP-5 pos 0 0 res 3440 1440
swaymsg output DP-5 background ~/.config/sway/wallpapers/space_ultrawide.jpg fill
killall waybar
waybar -c ~/.config/waybar/home-config &
exit 0

View File

@ -0,0 +1,11 @@
#!/bin/bash
swaymsg output DP-5 disable
swaymsg output eDP-1 enable
swaymsg output eDP-1 pos 0 0 res 2560 1440
swaymsg output eDP-1 background ~/.config/sway/wallpapers/space_2560x1440.jpg fill
killall waybar
waybar -c ~/.config/waybar/laptop-config &
exit 0

View File

@ -0,0 +1,16 @@
#!/bin/bash
CONNECTED_CMD="swaymsg -t get_outputs | jq -c '. | length'"
monitors=`eval $CONNECTED_CMD`
if [[ $monitors = 1 ]];
then
export LOCATION="laptop"
elif [[ $monitors = 2 ]];
then
export LOCATION="home"
elif [[ $monitors = 3 ]];
then
export LOCATION="work"
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
CONNECTED_CMD="swaymsg -t get_outputs | jq -c '. | length'"
monitors=`eval $CONNECTED_CMD`
if [ $monitors -gt 1 ]
then
echo "DOCKED"
~/.config/sway/scripts/dock.sh &
else
echo "UNDOCKED"
~/.config/sway/scripts/undock.sh &
fi
exit 0

View File

@ -0,0 +1,5 @@
#!/bin/bash
~/.config/sway/scripts/laptop-sway.sh &
exit 0

View File

@ -0,0 +1,16 @@
#!/bin/bash
swaymsg output eDP-1 enable
swaymsg output DP-4 enable
swaymsg output DB-5 enable
swaymsg output eDP-1 pos 0 0 res 2560 1440
swaymsg output DP-5 pos 2560 0 res 1920 1080
swaymsg output DP-4 pos 4480 0 res 1680 1050
swaymsg output eDP-1 background ~/.config/sway/wallpapers/space_2560x1440.jpg fill
swaymsg output DP-4 background ~/.config/sway/wallpapers/planet_rings_1680x1050.jpg fill
swaymsg output DP-5 background ~/.config/sway/wallpapers/solar_eclipse_1920x1080.jpg fill
killall waybar
waybar -c ~/.config/waybar/work-config &
exit 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,4 @@
#!/bin/bash
swaymsg splith
swaymsg exec "termite -t weechat -e weechat"
swaymsg exec slack

View File

@ -0,0 +1,13 @@
#!/bin/bash
source ~/.config/sway/scripts/location-helper.sh
if [ $LOCATION = "home" ];
then
swaymsg exec "google-chrome-stable --app=https://mail.google.com"
swaymsg exec "google-chrome-stable --app=https://calendar.google.com"
swaymsg exec "google-chrome-stable --app=https://hangouts.google.com"
swaymsg exec "google-chrome-stable --app=https://messages.android.com"
swaymsg exec slack
else
swaymsg "exec google-chrome-stable --proxy-pac-url=file:///home/jfm/Customers/TDC/Scripts/tdcproxy.js --no-default-browser-check --new-window https://www.toggl.com/app/timer https://mail.google.com/mail/u/0/#inbox https://calendar.google.com/calendar/r?tab=mc https://hangouts.google.com https://messages.android.com"
fi

View File

@ -0,0 +1,8 @@
#!/bin/bash
source ~/.config/sway/scripts/location-helper.sh
if [ $LOCATION = "home" ];
then
swaymsg "exec google-chrome-stable --no-default-browser-check --new-window"
swaymsg "exec /home/jfm/Tools/idea-2018.3/bin/idea.sh"
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
source ~/.config/sway/scripts/location-helper.sh
if [ $LOCATION = "home" ];
then
swaymsg layout splith
swaymsg exec google-chrome-stable
swaymsg exec "termite -t vim -e nvim"
swaymsg exec "termite -t shell1"
swaymsg exec "termite -t shell2"
else
swaymsg exec "termite -t vim -e nvim"
swaymsg exec "termite -t shell1"
swaymsg exec "termite -t shell2"
fi

View File

@ -0,0 +1,14 @@
#!/bin/bash
source ~/.config/sway/scripts/location-helper.sh
if [ $LOCATION = "home" ];
then
swaymsg "exec termite -t newsboat -e newsboat"
swaymsg "exec termite -t bark -d '/home/jfm/Repositories/bark' -e 'pipenv run python Bark.py'"
swaymsg "exec termite -t rtv -e 'rtv --enable-media --theme default'"
swaymsg "exec spotify"
else
swaymsg "exec termite -t newsboat -e newsboat"
swaymsg "exec termite -t twitter -d '/home/jfm/Repositories/bark' -e 'pipenv run python Bark.py'"
swaymsg "exec termite -t rtv -e 'rtv --enable-media --theme default'"
fi

View File

@ -0,0 +1,79 @@
{
"layer": "top", // Waybar at top layer
"output": "DP-5",
"position": "bottom", // Waybar at the bottom of your screen
// "height": 30, // Waybar height
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["tray"],
"modules-right": ["custom/arch", "custom/spotify", "pulseaudio", "network", "cpu", "memory", "battery", "clock"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{:%Y-%m-%d | %H:%M}",
"tooltip-format": "{:%Y-%m-%d | %H:%M}",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": " {usage}%"
},
"memory": {
"format": " {}%"
},
"battery": {
"states": {
"good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": " {ifname}: {ipaddr}",
"format-disconnected": "⚠ Disconnected"
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}% ",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
},
"custom/spotify": {
"format": " {}",
"max-length": 40,
"interval": 3,
"exec": "python $HOME/.config/waybar/scripts/spotify_status.py 2> /dev/null" // Script in resources folder
},
"custom/arch": {
"format": " {}",
"max-length": 40,
"interval": 300,
"exec": "$HOME/.config/waybar/scripts/updates-arch-combined.sh 2> /dev/null" // Script in resources folder
}
}

View File

@ -0,0 +1,79 @@
{
"layer": "top", // Waybar at top layer
"output": "eDP-1",
"position": "bottom", // Waybar at the bottom of your screen
// "height": 30, // Waybar height
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["tray"],
"modules-right": ["custom/arch", "custom/spotify", "pulseaudio", "network", "cpu", "memory", "battery", "clock"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{:%Y-%m-%d | %H:%M}",
"tooltip-format": "{:%Y-%m-%d | %H:%M}",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": " {usage}%"
},
"memory": {
"format": " {}%"
},
"battery": {
"states": {
"good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": " {ifname}: {ipaddr}",
"format-disconnected": "⚠ Disconnected"
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}% ",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
},
"custom/spotify": {
"format": " {}",
"max-length": 40,
"interval": 3,
"exec": "python $HOME/.config/waybar/scripts/spotify_status.py 2> /dev/null" // Script in resources folder
},
"custom/arch": {
"format": " {}",
"max-length": 40,
"interval": 300,
"exec": "$HOME/.config/waybar/scripts/updates-arch-combined.sh 2> /dev/null" // Script in resources folder
}
}

View File

@ -0,0 +1,111 @@
#!/bin/python
import sys
import dbus
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--trunclen", type=int, metavar="trunclen")
parser.add_argument(
"-f", "--format", type=str, metavar="custom format", dest="custom_format"
)
parser.add_argument(
"-p", "--playpause", type=str, metavar="play-pause indicator", dest="play_pause"
)
parser.add_argument(
"--font",
type=str,
metavar="the index of the font to use for the main label",
dest="font",
)
parser.add_argument(
"--playpause-font",
type=str,
metavar="the index of the font to use to display the playpause indicator",
dest="play_pause_font",
)
args = parser.parse_args()
def fix_string(string):
# corrects encoding for the python version used
if sys.version_info.major == 3:
return string
else:
return string.encode("utf-8")
def clean_string(string):
return string.replace("&", "&amp;")
# Default parameters
# output = fix_string(u"{play_pause} {artist}: {song}")
output = fix_string(u" {artist}: {song}")
trunclen = 25
play_pause = fix_string(u"\u25B6,\u23F8") # first character is play, second is paused
label_with_font = "%{{T{font}}}{label}%{{T-}}"
font = args.font
play_pause_font = args.play_pause_font
# parameters can be overwritten by args
if args.trunclen is not None:
trunclen = args.trunclen
if args.custom_format is not None:
output = args.custom_format
if args.play_pause is not None:
play_pause = args.play_pause
try:
session_bus = dbus.SessionBus()
spotify_bus = session_bus.get_object(
"org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2"
)
spotify_properties = dbus.Interface(spotify_bus, "org.freedesktop.DBus.Properties")
metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata")
status = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "PlaybackStatus")
# Handle play/pause label
play_pause = play_pause.split(",")
if status == "Playing":
play_pause = play_pause[0]
elif status == "Paused":
play_pause = play_pause[1]
else:
play_pause = str()
if play_pause_font:
play_pause = label_with_font.format(font=play_pause_font, label=play_pause)
# Handle main label
artist = fix_string(metadata["xesam:artist"][0]) if metadata["xesam:artist"] else ""
song = fix_string(metadata["xesam:title"]) if metadata["xesam:title"] else ""
if not artist and not song:
print("")
else:
if len(song) > trunclen:
song = song[0:trunclen]
song += "..."
if ("(" in song) and (")" not in song):
song += ")"
if font:
artist = label_with_font.format(font=font, label=artist)
song = label_with_font.format(font=font, label=song)
print(output.format(artist=artist, song=song, play_pause=play_pause))
except Exception as e:
if isinstance(e, dbus.exceptions.DBusException):
print("")
else:
print(e)

View File

@ -0,0 +1,17 @@
#!/bin/sh
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
if ! updates_aur=$(yay -Qum | wc -l); then
updates_aur=0
fi
updates=$(("$updates_arch" + "$updates_aur"))
if [ "$updates" -gt 0 ]; then
echo "$updates"
else
echo ""
fi

View File

@ -0,0 +1,118 @@
@define-color nord00 #2E3440;
@define-color nord01 #3B4252;
@define-color nord02 #434C5E;
@define-color nord03 #4C566A;
@define-color nord04 #D8DEE9;
@define-color nord05 #E5E9F0;
@define-color nord06 #ECEFF4;
@define-color nord07 #8FBCBB;
@define-color nord08 #88C0D0;
@define-color nord09 #81A1C1;
@define-color nord10 #5E81AC;
@define-color nord11 #BF616A;
@define-color nord12 #D08770;
@define-color nord13 #EBCB8B;
@define-color nord14 #A3BE8C;
@define-color nord15 #B48EAD;
* {
border: none;
border-radius: 0;
font-family: 'Source Code Pro', Roboto, Helvetica, Arial, sans-serif;
font-size: 13px;
min-height: 0;
}
window#waybar {
background: @nord00;
border-bottom: 3px solid @nord03;
color: white;
}
#workspaces button {
padding: 0 5px;
background: transparent;
color: @nord04;
border-bottom: 3px solid transparent;
}
#workspaces button.focused {
background: @nord03;
border-bottom: 3px solid @nord14;
}
#clock, #battery {
padding: 0 10px;
margin: 0 5px;
}
#cpu, #memory, #pulseaudio {
padding: 0 5px;
margin: 0 5px;
}
#clock {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#cpu {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#memory {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#network {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#pulseaudio {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#battery {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#battery.charging {
color: @nord04;
border-bottom: 3px solid @nord07;
}
#battery.discharging {
color: @nord04;
border-bottom: 3px solid @nord11;
}
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
#battery.warning:not(.charging) {
background: #f53c3c;
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#custom-spotify {
border-bottom: 3px solid @nord14;
color: @nord04;
}
#custom-arch {
border-bottom: 3px solid @nord11;
color: @nord04;
}

View File

@ -0,0 +1,102 @@
[{
"layer": "top", // Waybar at top layer
"output": "DP-5",
"position": "bottom", // Waybar at the bottom of your screen
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["tray"],
"modules-right": ["custom/arch", "pulseaudio", "network", "cpu", "memory", "battery", "clock"],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{name}"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{:%Y-%m-%d | %H:%M}",
"tooltip-format": "{:%Y-%m-%d | %H:%M}",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": " {usage}%"
},
"memory": {
"format": " {}%"
},
"battery": {
"states": {
"good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": " {ifname}: {ipaddr}",
"format-disconnected": "⚠ Disconnected"
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}% ",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
},
"custom/arch": {
"format": " {}",
"max-length": 40,
"interval": 300,
"exec": "$HOME/.config/waybar/scripts/updates-arch-combined.sh 2> /dev/null"
}
},
{
"layer": "top", // Waybar at top layer
"output": "DP-4",
"position": "bottom", // Waybar at the bottom of your screen
"modules-left": ["sway/workspaces"],
"modules-center": [],
"modules-right": ["custom/spotify"],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{name}"
},
"custom/spotify": {
"format": " {}",
"max-length": 40,
"interval": 3,
"exec": "python $HOME/.config/waybar/scripts/spotify_status.py 2> /dev/null"
}
},
{
"layer": "top", // Waybar at top layer
"output": "eDP-1",
"position": "bottom", // Waybar at the bottom of your screen
"modules-left": ["sway/workspaces"],
"modules-center": [],
"modules-right": [],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{name}"
}
}
]