Uses Jetpack WindowManager to work with new form factor devices.Detects when the application is running on a foldable or dual-screen device.Experience with Activities, Fragments, View binding, and xml-layouts.When you're finished, you'll be able to enhance your app to support devices like the Microsoft Surface Duo and the Samsung Galaxy Z Fold3. To look for other types, just change the word compiz to another like mutter, kwin, etc.This practical codelab will teach you the basics of developing for dual-screen and foldable devices. You can then use this to create a script that does an action based on the Window Manager. Pgrep -l compiz |cut -d " " -f2 since the process is running by the same user there is no need to prefix the sudo part. I did the following to get the name since the parameter -l adds the process ID: To do this there is a command called pgrep ( Wikipedia ). Since what you are looking for is the name of what Window Manager is in use, the only way I see how to get this is by looking in the process list. You have others if you look closer at the output of env like DESKTOP_SESSION and COMPIZ_CONFIG_PROFILE (Will output for example 'ubuntu' if you selected ubuntu in the login or 'ubuntu-2d' if you selected that one in the login.) (Will output for example 'unity' if you are using Unity) To use them, go to the terminal and type: echo $XDG_CURRENT_DESKTOP GDMSESSION - Tells you what option you selected from the lightdm greeter to login. XDG_CURRENT_DESKTOP - Tells you what desktop environment you are using In the terminal type env to see all environment variables. Other Ubuntu based distributions Mint 13 (Cinnamon) You can use this line to get the output: printf 'Desktop: %s\nSession: %s\n' "$XDG_CURRENT_DESKTOP" "$GDMSESSION" On Linux systems I tested environment variables XDG_CURRENT_DESKTOP and GDMSESSION and got the following results.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |