diff --git a/i3/config b/i3/config index 8b858b9..a4e206a 100644 --- a/i3/config +++ b/i3/config @@ -236,13 +236,15 @@ workspace_auto_back_and_forth yes default_border normal default_floating_border normal -assign [class="firefox"] workspace $ws1 +assign [class="firefox" title="Mozilla Firefox$"] workspace $ws1 assign [class="TelegramDesktop"] workspace $ws9 assign [class="Thunderbird"] workspace $ws10 +assign [class="zoom"] workspace $ws5 for_window [title="Manjaro Settings Manager"] floating enable for_window [class="Pamac-manager"] floating enable for_window [class="Pamac-updater"] floating enable +#for_window [class="zoom" title="Chat"] floating enable #for_window [class="Thunderbird" instance="Msgcompose"] floating enable ########## Autostart applications ########## @@ -258,6 +260,8 @@ exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec --no-startup-id pamac-tray # Notify about kernel updates exec --no-startup-id msm_notifier +# Audio +exec --no-startup-id start-pulseaudio-x11 # Default workspaces at startup exec --no-startup-id i3-msg workspace $ws1 diff --git a/i3/setupZoom b/i3/setupZoom new file mode 100755 index 0000000..243b709 --- /dev/null +++ b/i3/setupZoom @@ -0,0 +1,7 @@ +#!/bin/bash + +i3-msg "workspace --no-auto-back-and-forth 5; append_layout ~/.config/i3/workspace-zoom.json" + +zoom & + +i3-msg "workspace --no-auto-back-and-forth 5; exec mousepad /home/julian/jhome/nextcloud/studium/zoom.txt" diff --git a/i3/workspace-zoom.json b/i3/workspace-zoom.json new file mode 100644 index 0000000..295d350 --- /dev/null +++ b/i3/workspace-zoom.json @@ -0,0 +1,86 @@ +// vim:ts=4:sw=4:et +{ + "border": "normal", + "current_border_width": 2, + "floating": "auto_off", + "geometry": { + "height": 800, + "width": 1188, + "x": 246, + "y": 125 + }, + "name": "Zoom Meeting", + "percent": 0.8, + "swallows": [ + { + "class": "^zoom$", + "instance": "^zoom$", + "title": "^Zoom\\ Meeting$" + } + ], + "type": "con" +} + +{ + // splitv split container with 2 children + "border": "normal", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.2, + "type": "con", + "nodes": [ + { + // splith split container with 1 children + "border": "normal", + "floating": "auto_off", + "layout": "splith", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "normal", + "current_border_width": 2, + "floating": "auto_off", + "geometry": { + "height": 1002, + "width": 220, + "x": 1458, + "y": 46 + }, + "name": "Participants", + "percent": 1, + "swallows": [ + { + "class": "^zoom$", + "instance": "^zoom$", + "title": "^Participants" + } + ], + "type": "con" + } + ] + }, + { + "border": "normal", + "current_border_width": 2, + "floating": "user_off", + "geometry": { + "height": 350, + "width": 355, + "x": 662, + "y": 350 + }, + "name": "Chat", + "percent": 0.5, + "swallows": [ + { + "class": "^zoom$", + "instance": "^zoom$", + "title": "^Chat$" + } + ], + "type": "con" + } + ] +} + diff --git a/i3blocks/calendar b/i3blocks/calendar index b05d7b9..78fdc7c 100755 --- a/i3blocks/calendar +++ b/i3blocks/calendar @@ -4,11 +4,9 @@ DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"} SHORTFMT=${SHORTFMT:-"+%H:%M:%S"} OPTIND=1 -while getopts ":f:W:H:" opt; do +while getopts ":f:" opt; do case $opt in f) DATEFMT="$OPTARG" ;; - W) WIDTH="$OPTARG" ;; - H) HEIGHT="$OPTARG" ;; \?) echo "Invalid option: -$OPTARG" >&2 exit 1 @@ -22,10 +20,16 @@ done case "$BLOCK_BUTTON" in 1|2|3) - # Focus Thunderbird and open calendar - i3-msg -q [class="Thunderbird" instance="Mail"] focus; \ - sleep 0.005; \ + # Try to focus Thunderbird + i3-msg -q [class="Thunderbird" instance="Mail"] focus + if [ $? == 2 ] + then + # Open Thunderbird if it was not open + i3-msg -q "exec thunderbird -mail -calendar" + else + # Open calendar xdotool key --clearmodifiers --delay 5 ctrl+shift+c + fi esac echo "$LABEL$(date "$DATEFMT")" echo "$LABEL$(date "$SHORTFMT")" diff --git a/i3blocks/calendar.test b/i3blocks/calendar.test new file mode 100644 index 0000000..78fdc7c --- /dev/null +++ b/i3blocks/calendar.test @@ -0,0 +1,35 @@ +#!/bin/bash + +DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"} +SHORTFMT=${SHORTFMT:-"+%H:%M:%S"} + +OPTIND=1 +while getopts ":f:" opt; do + case $opt in + f) DATEFMT="$OPTARG" ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +case "$BLOCK_BUTTON" in + 1|2|3) + # Try to focus Thunderbird + i3-msg -q [class="Thunderbird" instance="Mail"] focus + if [ $? == 2 ] + then + # Open Thunderbird if it was not open + i3-msg -q "exec thunderbird -mail -calendar" + else + # Open calendar + xdotool key --clearmodifiers --delay 5 ctrl+shift+c + fi +esac +echo "$LABEL$(date "$DATEFMT")" +echo "$LABEL$(date "$SHORTFMT")" diff --git a/i3blocks/config b/i3blocks/config index d370a58..5400b38 100644 --- a/i3blocks/config +++ b/i3blocks/config @@ -16,7 +16,12 @@ LABEL= interval=10 signal=10 +[keyboard] +command=./keyboard +interval=10 +LABEL= + [calendar] command=./calendar interval=1 -LABEL= +LABEL= \ No newline at end of file diff --git a/i3blocks/keyboard b/i3blocks/keyboard new file mode 100755 index 0000000..19102c6 --- /dev/null +++ b/i3blocks/keyboard @@ -0,0 +1,26 @@ +#!/bin/sh + +get_current_layout () { + setxkbmap -print | grep -q dvorak + if [ "$?" -eq "0" ]; then + echo dvorak + else + echo qwertz + fi +} + +case "$BLOCK_BUTTON" in + 1|2|3) + # Switch layout + current_layout=$(get_current_layout) + if [ $current_layout == dvorak ]; then + setxkbmap -layout de + else + setxkbmap -layout de -variant dvorak + fi +esac + +current_layout=$(get_current_layout) + +echo "$LABEL $current_layout" +echo "$LABEL $current_layout"