Added zoom and keyboard

This commit is contained in:
julian 2020-11-11 10:44:24 +01:00
parent 27703c6949
commit 598fcc41f9
7 changed files with 175 additions and 8 deletions

View File

@ -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

7
i3/setupZoom Executable file
View File

@ -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"

86
i3/workspace-zoom.json Normal file
View File

@ -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"
}
]
}

View File

@ -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")"

35
i3blocks/calendar.test Normal file
View File

@ -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")"

View File

@ -16,6 +16,11 @@ LABEL=
interval=10
signal=10
[keyboard]
command=./keyboard
interval=10
LABEL=
[calendar]
command=./calendar
interval=1

26
i3blocks/keyboard Executable file
View File

@ -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"