How to create Chrome/Chromium web application desktop shortcut?
Solution 1
After some research on the internet I found how to create web apps desktop short cuts for Google Chrome/Chromium web browser in Ubuntu 12.10.
1. Install the application you want from Chrome Webstore and right click on the app icon and select create desktop short-cut.
2. It will creates a desktop short-cut and it will not work on Ubuntu 12.10, we need to edit the
**chrome-applicationid here-Default.desktop like file**
3. Open the file using Gedit using this command
~$ gedit Desktop/chrome-aknpkdffaafgjchaibgeefbgmgeghloj-Default.desktop
(change the file name to yours application ID)
4. It will open the Gedit text editor and you will need to change first two lines of the text
#!/usr/bin/env xdg-open[Desktop Entry]
Version=1.0
to
[Desktop Entry]
Encoding=UTF-8
5. Finally save the changes and you will be noticed the change of icon in the desktop and double click on it to run.
Time for playing Angry Birds!
Solution 2
Fixing Chromium webapp shortcuts in Lubuntu 12.10 http://computers4christians.org/Chromium-app-shortcut-fix-lubuntu.html
Related videos on Youtube
user3581970
Updated on September 18, 2022Comments
-
user3581970 over 1 year
I'm trying to make a war card game, but I am having difficulties getting my code to connect. I keep getting the error that deck1 isn't defined. I cannot see why this is happening. I am trying to connect the deck1 and deck2 to the playerA=deck1.pop and so forth. Thanks for the help!
import random total = { 'winA':0, 'winB':0 } def shuffleDeck(): suits = {'\u2660', '\u2661', '\u2662', '\u2663'} ranks = {'2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'} deck = [] for suit in suits: for rank in ranks: deck.append(rank+' '+suit) random.shuffle(deck) return deck def dealDecks(deck): deck1 = deck[:26] deck2= deck[26:] hand = [] return hand def total(hand): values = {'2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, '1':10, 'J':11, 'Q':12, 'K':13,'A':14} def war(playerA, playerB): if playerA==playerB: print("Tie") elif playerA > playerB: print("Winner:Player A") return 1 else: print("Winner:player B") return -1 def process_game(playerA,playerB): result = game(p1c,p2c) if result == -1: total['winB'] += 1 else: total['winA'] += 1 deck = shuffleDeck() dealDecks(deck); gameplay = input("Ready to play a round: ") while gameplay == 'y': playerA = deck1.pop(random.choice(deck1)) playerB = deck2.pop(random.choice(deck2)) print("Player A: {}. \nPlayer B: {}. \n".format(playerA,playerB)) gameplay = input("Ready to play a round: ") if total['winA'] > total['winB']: print("PlayerA won overall with a total of {} wins".format(total['winA'])) else: print("PlayerB won overall with a total of {} wins".format(total['winB']))
-
Aditya over 11 yearsSee if this question helps your cause: askubuntu.com/questions/72535/…
-
Danial José over 11 yearsYes, your comment helps me to create desktop short cut for Google chrome.
-
Michelle almost 10 years
deck1
is only defined insidedealDecks()
. You can't access it outside the function.
-
-
Danial José over 11 yearsThis is not what I am looking for exactly. Read the above description carefully. Any way now I am able to create desktop short cut for google chrome apps.
-
Uri Herrera over 11 yearsMenu/Wrench>Tools>Create App. Done, easier.
-
vishal over 11 yearsthis is the correct one :) I was able to solve my problem
-
Kevin Bowen over 11 yearsWelcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
-
jonrsharpe almost 10 yearsWhy have you suggested an implementation then immediately pointed out that the OP shouldn't adopt it?
-
BeetDemGuise almost 10 yearsMainly because my actual suggestions would have required a bigger refactoring of the code than is appropriate here on SO. So I offered a quick solution to their problem, though I do like your refactor more than mine.
-
user3581970 almost 10 yearsThanks! But now I get this error and I don't know exactly what it means...Traceback (most recent call last): File "C:\Users\Morgan\Desktop\homework8.py", line 56, in <module> playerA = deck1.pop(random.choice(deck1)) TypeError: 'str' object cannot be interpreted as an integer >>>
-
jonrsharpe almost 10 yearsThe error tells you exactly what it means. Try reading the documentation.
-
user3581970 almost 10 yearsI am now getting an error like this...Ready to play a round: n Traceback (most recent call last): File "C:\Users\Morgan\Desktop\homework8.py", line 62, in <module> if total['winA'] > total['winB']: TypeError: 'function' object is not subscriptable (Am I missing something?)
-
jonrsharpe almost 10 yearsYes, you are; much of your code makes no sense. Many issues are similar to the one I have solved for you, because you aren't using functions and variables correctly. I suggest you read through the tutorial before continuing.