Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- GetWindowSize() {
- local SIZE=$(xdotool getactivewindow getwindowgeometry | grep Geometry | cut -d: -f2)
- let WINDOWWIDTH=$(echo $SIZE | cut -dx -f1)
- let WINDOWHEIGHT=$(echo $SIZE | cut -dx -f2)
- }
- MaximizeWindow() {
- xdotool getactivewindow windowsize 100% 100%
- }
- RestoreWindowSize() {
- xdotool getactivewindow windowsize $WINDOWWIDTH $WINDOWHEIGHT
- }
- # Text in bold
- Bold() {
- echo -en '\e[1m'"$*"'\e[21m'
- }
- Cleanup() {
- RestoreWindowSize
- sleep 2
- }
- # Initializations
- GetWindowSize
- trap Cleanup 0 1 2
- # Test stuff...
- echo 'Test about console size handling with '`Bold xdotool`
- sleep 2
- MaximizeWindow
- echo 'Console have been '`Bold maximised`'.'
- sleep 2
- echo 'Test finished.'
- echo 'Console will return back to its '`Bold initial size`'.'
- sleep 2
Advertisement
Add Comment
Please, Sign In to add comment