Giter VIP home page Giter VIP logo

cosmic-launcher's Introduction

Cosmic Launcher

Layer Shell frontend for https://github.com/pop-os/launcher. Currently the underlying protocol being used in the plugin for managing toplevels in wayland is defined here but it will be switched to use wlr-foreign-toplevel-management when it is ready.

Building

Cosmic Launcher is set up to build a deb and a Nix flake, but it can be built using just.

Some Build Dependencies:

  cargo,
  just,
  intltool,
  appstream-util,
  desktop-file-utils,
  libxkbcommon-dev,
  pkg-config,
  desktop-file-utils,

Build Commands

For a typical install from source, use just followed with sudo just install.

just
sudo just install

If you are packaging, run just vendor outside of your build chroot, then use just build-vendored inside the build-chroot. Then you can specify a custom root directory and prefix.

# Outside build chroot
just clean-dist
just vendor

# Inside build chroot
just build-vendored
sudo just rootdir=debian/cosmic-launcher prefix=/usr install

Translators

Translation files may be found in the i18n directory. New translations may copy the English (en) localization of the project and rename en to the desired ISO 639-1 language code. Translations may be submitted through GitHub as an issue or pull request. Submissions by email or other means are also acceptable; with the preferred name and email to associate with the changes.

Debugging & Profiling

Profiling async tasks with tokio-console

To debug issues with asynchronous code, install tokio-console and run it within a separate terminal. Then kill the cosmic-launcher process a couple times in quick succession to prevent cosmic-session from spawning it again. Then you can start cosmic-launcher with tokio-console support either by running just tokio-console from this repository to test code changes, or env TOKIO_CONSOLE=1 cosmic-launcher to enable it with the installed version of cosmic-launcher.

cosmic-launcher's People

Contributors

1280px avatar 13r0ck avatar aanzel avatar bittin avatar drakulix avatar edfloreshz avatar evnct avatar gabriele2000 avatar gildemberg-santos avatar ids1024 avatar jackpot51 avatar julianbraha avatar mmstick avatar moi-cest-matthew avatar nimafanniasl avatar ryanabx avatar vandalhj avatar wash2 avatar wsx-udscbt avatar xalt7x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cosmic-launcher's Issues

Cursor placement wrong during certain searches

If I try to search for firefox (or files), the cursor jumps back to the beginning of the input box after fi, then remains one letter behind the end of the string (this doesn't actually affect where text is input):

2023-12-27.12-55-01.mp4

This doesn't seem to happen with some other search strings (e.g. cosmic).

Refresh applications launcher

Any time software is installed via Wine or otherwise adds additional .desktop files to the applications folder, the list doesn't update and as far as I can tell, there's no way to tell it to refresh. The only way I've managed to get it to is by logging out and logging back in. For obvious reasons, this is less than ideal. Ideally this would be accomplished by either a refresh button in the launcher window itself or some kind of key combination.

Search result highlights covered up by separator line

The second, fourth, fifth, and seventh search results appear to have a gap in their lower border because the separator line (that goes between results) shows up on top of the highlight.

Screenshot_2023-12-27_14-03-44

The other results aren't quite as bad, but still have a thinner bottom border than all the other sides because the separator partially overlaps.

Screenshot_2023-12-27_14-04-20

Closing launcher with Super + / and re-opening can make the launcher briefly reappear with previous search results

Summary:

After typing a search term, then closing the launcher with Super + /, then re-opening the launcher with Super + / again, the launcher briefly shows the results from the last search query when it reappears.

Steps to reproduce:

  • Open launcher with Super + /
  • Type a search query so that some results are displayed
  • Close the launcher with Super + /
  • Re-open the launcher with Super + /

Expected behavior:

When the launcher reappears, it should not show any results.

Version:

cosmic-launcher:
  Installed: 0.1.0~1660784291~22.04~14a8eca
  Candidate: 0.1.0~1660784291~22.04~14a8eca
  Version table:
 *** 0.1.0~1660784291~22.04~14a8eca 1002
       1001 http://apt.pop-os.org/release jammy/main amd64 Packages
       1002 http://apt.pop-os.org/staging/master jammy/main amd64 Packages
        100 /var/lib/dpkg/status

`t:`, `:`, and `run` functions still utilizing gnome-terminal, not cosmic-term

In the current launcher used in Gnome with Pop/Cosmic extensions, a user can execute a cli command using :, t:, and run which is leveraging gnome-terminal.

The cosmic-launcher is also currently still leveraging gnome-terminal instead of cosmic-term.

At a certain level, this may provide a bit of a safety net at current. I've found it useful for launching gnome-terminal itself on an nvidia system in light of the current incompatability between wgpu driven rendering for cosmic-term and proprietary nvidia drivers.

However, this is probably one of many changes that will need to be eventually made to cosmic-launcher's integrated features.

Not able to find terminal applications in search

When searching for either terminal (for GNOME Terminal) or Tilix I am not seeing them in the search results.

cosmic-launcher:
  Installed: 0.1.0~1695751086~22.04~5c272d8
  Candidate: 0.1.0~1695751086~22.04~5c272d8
  Version table:
 *** 0.1.0~1695751086~22.04~5c272d8 1001
       1001 http://apt.pop-os.org/release jammy/main amd64 Packages
        100 /var/lib/dpkg/status

Text field does not maintain focus with certain keyboard inputs.

As designed (figma), text entry should always maintain input focus when using cosmic-launcher. This is not currently the case when using keyboard inputs.

For example: It should be possible to open a file at any location in the file system by typing the file path. This feature should also support tab completion in launcher.

In this case, I wish to open the "Cosmic-components" folder in my user's home folder. I type ~/Cos
screenshot-2024-02-29-20-57-56_crop

I then hit [tab], and two failures occur: The first is that the focus is removed from the text field. The second is that the path does not tab-complete (probably because of the loss of focus):
screenshot-2024-02-29-20-58-08_crop

Searching for an application can have a similar problem. If I am for a Cosmic application I might type cosmic and then want to navigate through search results with arrow keys. When I do so, the text field loses focus:
screenshot-2024-02-29-21-12-01_crop screenshot-2024-02-29-21-12-13_crop

Our current gnome release for launcher allows the use of tab or of up/down arrows to navigate the results without loss of focus.

Launcher Comparision

This is a feature comparison between Pop Launcher and Cosmic Launcher.

Feature List Pop Launcher Cosmic Launcher Issues
calc working working can't Ctrl-C copy active option and close window
desktop_entries working working
files working partially working no tab auto complete
find working working
pulse working partially working volume changes are not equal to 5% as stated in the launcher (e.g., vol=100 down 5% brings it to 86 not 95), volume up is not working when starting from 0
recent working working
scripts working partially working user local scripts are not detected
terminal working working (t: and :)
web working working no icon
suspend working working stops working sometime after suspend
restart working working
lock working not working no lock screen
shutdown working working
options “?” working working
when searching the nth item launches with keyboard Ctrl+n (e.g., Ctrl+1) working working
switching open windows working working
search settings working not working
all windows on all workspaces appear working working
choosing an app on another workspace moves workspaces and focus to that app working working
launching an application works working working
typing text and then removing it will re-show those windows working working
search works for applications and windows working working
the overlay hint correctly highlights the selected window working not working no change in highlighted window
open windows are sorted above applications (e.g., "web browser") working working
cal returns Calendar and Calculator before Color working working
pops returns Popsicle first working working
shop returns the Pop!_Shop first working working
opens with Super + / and opens with Super key working working
first item is highlighted by default (starting launcher or searching) working not working
navigate/select with Emacs or Vim keybindings working working
Other issues
Key presses repeat sometime similar to sticky keys

Launcher Design Checklist

Design File: https://www.figma.com/file/KjWhHsdjRU8Ih3Ib1m3t7B/Launcher?node-id=17-1116&t=8CkjVJeArmK6ekNI-0

SearchField Widget Design: https://www.figma.com/file/SkAtS5qlVOGQC0n895AHzX/Design-System-(WIP)?node-id=8195-15503&t=CxhHGKrTZe7wA1Gp-0

ListView Widget Design: https://www.figma.com/file/SkAtS5qlVOGQC0n895AHzX/Design-System-(WIP)?node-id=6671-4481&t=XS4QMBc6i6kbVfY3-0

  • Initial State (no apps) the bottom and top padding should be 24 px (currently different on top and bottom)
  • Starting Position is 16 pixels from the bottom of the top bar OR 16 pixels from top of the display if there is no top bar. Launches at the top of the screen to accommodate future on screen keyboards (OSKs) without moving launcher/applibrary overlays.
  • Top position does not move. The list expands from the bottom.
  • Search Widget: use libcosmic search widget
  • Use or match ListItems (or current equivalent name in libcosmic) for search results list with padding per design.
  • Results application name: First line "Application Name" | Second line "Type - Description" - "Flatpak - Browse the World Wide Web" for Firefox for instance
  • Show an already open app first then launching a new instance of the app
  • Highlight the first application with when the launcher is initiated or results shown. This is to indicate that pressing "Enter" will launch or switch to the first app in the list.
  • "Help" (?) results layout - see attached image. Let's copy this for now but it will eventually need design love.

cosmic-launcher-help

cosmic-launcher is not executable anymore (after justification)

cosmic-launcher is being installed in usr/share/bin shouldn't it be usr/bin?

Also it doesn't have executable permission anymore.

ls -l /usr/share/bin/cosmic-launcher
.rw-r--r-- 12M root  3 Feb 09:34 /usr/share/bin/cosmic-launcher

This also causes cosmic-session to panic:

thread 'main' panicked at 'failed to start launcher: Process(Os { code: 2, kind: NotFound, message: "No such file or directory" })':  src/main.rs:124

Pressing tab jumps over items in the search list

After searching for something and pressing tab to cycle through the search results, tab jumps over the first item and selects the second item. If you press tab again, it will jump over the 3rd item and select the 4th item.

Pressing ctrl+j or ctrl+n or down arrow works correctly.

❯ apt info cosmic-launcher
Package: cosmic-launcher
Version: 0.1.0~1692988129~22.04~4440f7d
Priority: optional
Section: admin
Maintainer: Ashley Wulber <[email protected]>
Installed-Size: 18.3 MB
Depends: libc6 (>= 2.35), libgcc-s1 (>= 4.2), libxkbcommon0 (>= 0.5.0)
Homepage: https://github.com/pop-os/cosmic-launcher
Download-Size: 5,047 kB
APT-Manual-Installed: no
APT-Sources: http://apt.pop-os.org/release jammy/main amd64 Packages
Description: Cosmic Launcher

`nix build` fails with error message

Hey everyone 👋 Nix build fails with the following message:

cosmic-launcher on  master is 📦 v0.1.0 via 🦀 
❯ nix build
warning: ignoring untrusted substituter 'https://nix-community.cachix.org', you are not a trusted user.
Run `man nix.conf` for more information on the `substituters` configuration option.
error: builder for '/nix/store/gjd7kvv35iypazl7z3vk4a7f3ib2wspj-cosmic-launcher-deps-0.1.0.drv' failed with exit code 101;
       last 10 log lines:
       > will append /build/source/.cargo-home/config.toml with contents of /nix/store/kjjjn9jnmqpcg9ds45jj5a5ix84qsdi8-vendor-cargo-deps/config.toml
       > default configurePhase, nothing to do
       > building
       > ++ command cargo --version
       > cargo 1.70.0 (ec8a8a0ca 2023-04-25)
       > ++ command cargo check --release --all-targets
       > error: package `libcosmic v0.1.0 (https://github.com/pop-os/libcosmic/#bf050881)` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.70.0
       > Either upgrade to rustc 1.71 or newer, or use
       > cargo update -p [email protected] --precise ver
       > where `ver` is the latest version of `libcosmic` supporting rustc 1.70.0
       For full logs, run 'nix log /nix/store/gjd7kvv35iypazl7z3vk4a7f3ib2wspj-cosmic-launcher-deps-0.1.0.drv'.
error: 1 dependencies of derivation '/nix/store/yw5xkaw5mdrhd4jm52yzqy8gv4h3dfwh-cosmic-launcher-0.1.0.drv' failed to build

Am I doing sth wrong?

Text cursor doesn't update when selecting plugins

Cosmic-launcher supports a number of plugins that allow the use of advanced features directly from the launcher. These include running commands, searching files, processing equations, or doing web searches directly from the launcher. Many of these features can be discovered by typing ? in the launcher:
screenshot-2024-02-29-17-59-38

However, if I select one of the revealed features, such as the file-search feature, the cursor position does not update:
screenshot-2024-02-29-18-00-06_inset-find

This seems true of all plugins I've checked so far. That said, when I begin typing, the cursor does correctly update. But this is a regression in behaviour when compared with our gnome-extension implementation of a launcher.

After attempting to launch from terminal, no results every other search

Version: a1270e3

When I first log into the COSMIC session, search results work as expected.

If I open a terminal and run cosmic-launcher, the command completes with no output; from then on, every other search returns no results.

Logs of running the command, performing one successful search, and performing one non-working search: launcher-issue-1.txt

Running the command additional times doesn't seem to affect the behavior (e.g. launching cosmic-launcher again doesn't make it work 1 in 3 times, it still works 1 in 2 times.)

Ideally, search behavior should be consistent, and running the command should handle an already-running process and/or show an appropriate message instead of silently breaking results. (I found this while trying to figure out how to start the launcher, since plain Super wasn't working, but later figured out that it requires Super + /.)

Different behaviour with life time of scripts compared to pop-shell

Hello,

I am currently test driving this launcher in a sway environment. What I am seeing is that compared to pop-shell. pop-launcher is started at the beginning and keeps all the plugins running once they are started.

One of my plug-in is currently caching the results it receives from a web search to make filtering faster. This works just fine in pop-shell since once the launcher is closed the script is closed as well.

With cosmic-launcher it is not closed, so even if the launcher is closed and reopened my script will still use the cached values.
Right now i use a timer to invalidate the cache but this is more of a workaround.
Would it be possible to either:

  • close the plugins once the launcher is closed. I think this is a little bit too much and requires several changes looking at the current setup
  • Send a "Close" message to the plugins so they are aware that the window has been closed and therefore invalidate their state

I think the second option would be the best solution because then it is up to the plugin to decide what to do in this case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.